]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
test/TEST-99-RPM: speedup test
authorHarald Hoyer <harald@redhat.com>
Fri, 11 Nov 2016 15:04:31 +0000 (16:04 +0100)
committerHarald Hoyer <harald@redhat.com>
Fri, 11 Nov 2016 15:04:31 +0000 (16:04 +0100)
test/TEST-99-RPM/finished-false.sh [deleted file]
test/TEST-99-RPM/test.sh

diff --git a/test/TEST-99-RPM/finished-false.sh b/test/TEST-99-RPM/finished-false.sh
deleted file mode 100755 (executable)
index ecdbef9..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exit 1
index 0e3a1a688e5fb60bb744308dc7d88b0a6e85477e..1485278ea5b5c4a3391f7c36dc07bf0672c79151 100755 (executable)
@@ -16,6 +16,7 @@ test_run() {
     mkdir -p "$rootdir/proc"
     mkdir -p "$rootdir/sys"
     mkdir -p "$rootdir/dev"
+    mkdir -p "$rootdir/boot"
 
 trap 'ret=$?; [[ -d $rootdir ]] && { umount "$rootdir/proc"; umount "$rootdir/sys"; umount "$rootdir/dev"; rm -rf -- "$rootdir"; } || :; exit $ret;' EXIT
 trap '[[ -d $rootdir ]] && { umount "$rootdir/proc"; umount "$rootdir/sys"; umount "$rootdir/dev"; rm -rf -- "$rootdir"; } || :; exit 1;' SIGINT
@@ -24,26 +25,38 @@ trap '[[ -d $rootdir ]] && { umount "$rootdir/proc"; umount "$rootdir/sys"; umou
     mount --bind /sys "$rootdir/sys"
     mount -t devtmpfs devtmpfs "$rootdir/dev"
 
+    mkdir -p "$rootdir/$TESTDIR"
+    cp --reflink=auto -a \
+       "$TESTDIR"/dracut-[0-9]*.$(arch).rpm \
+       "$TESTDIR"/dracut-network-[0-9]*.$(arch).rpm \
+       "$rootdir/$TESTDIR/"
+
     dnf_or_yum=yum
-    command -v dnf >/dev/null && dnf_or_yum=dnf
-    $dnf_or_yum --nogpgcheck --installroot "$rootdir"/ --releasever 25 --disablerepo=updates-testing install --allowerasing -y \
+    dnf_or_yum_cmd=yum
+    command -v dnf >/dev/null && { dnf_or_yum="dnf"; dnf_or_yum_cmd="dnf --allowerasing"; }
+    $dnf_or_yum_cmd -v --nogpgcheck --installroot "$rootdir"/ --releasever 25 --disablerepo='*' \
+                --enablerepo=fedora \
+                install -y \
        $dnf_or_yum \
        passwd \
        rootfiles \
        systemd \
+    systemd-udev \
        kernel \
-       fedora-release \
+       kernel-core \
+       redhat-release \
        device-mapper-multipath \
        lvm2 \
        mdadm \
-        bash \
-        iscsi-initiator-utils \
-        "$TESTDIR"/dracut-[0-9]*.$(arch).rpm \
-        "$TESTDIR"/dracut-network-[0-9]*.$(arch).rpm
+    bash \
+    iscsi-initiator-utils \
+    "$TESTDIR"/dracut-[0-9]*.$(arch).rpm \
+    "$TESTDIR"/dracut-network-[0-9]*.$(arch).rpm \
+    ${NULL}
 
     cat >"$rootdir"/test.sh <<EOF
 #!/bin/bash
-set -xe
+set -x
 export LC_MESSAGES=C
 rpm -Va |& grep -F -v '85-display-manager.preset' &> /test.output
 find / -xdev -type f -not -path '/var/*' \
@@ -61,7 +74,8 @@ find / -xdev -type f -not -path '/var/*' \
   -not -path '/dev/null' \
   -not -path "/boot/loader/entries/\$(cat /etc/machine-id)-*" \
   -not -path "/boot/\$(cat /etc/machine-id)/*" \
-  -exec rpm -qf '{}' ';' | \
+  -not -path '/etc/openldap/certs/*' \
+  -print0 | xargs -0 rpm -qf | \
   grep -F 'not owned' &>> /test.output || :
 exit 0
 EOF