Blame 0164-test-TEST-99-RPM-speedup-test.patch

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