3 TEST_DESCRIPTION
="rpm integrity after dracut and kernel install"
8 export rootdir
=$TESTDIR/root
12 mkdir
-p "$rootdir/proc"
13 mkdir
-p "$rootdir/sys"
14 mkdir
-p "$rootdir/dev"
16 trap 'ret=$?; [[ -d $rootdir ]] && { umount "$rootdir/proc"; umount "$rootdir/sys"; umount "$rootdir/dev"; rm -rf -- "$rootdir"; }; exit $ret;' EXIT
17 trap '[[ -d $rootdir ]] && { umount "$rootdir/proc"; umount "$rootdir/sys"; umount "$rootdir/dev"; rm -rf -- "$rootdir"; }; exit 1;' SIGINT
19 mount
--bind /proc
"$rootdir/proc"
20 mount
--bind /sys
"$rootdir/sys"
21 mount
-t devtmpfs devtmpfs
"$rootdir/dev"
23 yum
--nogpgcheck --releasever=/ --installroot "$rootdir"/ install -y \
30 device-mapper-multipath \
34 iscsi-initiator-utils \
35 $basedir/dracut-
[0-9]*.$
(arch
).rpm \
36 $basedir/dracut-network-
[0-9]*.$
(arch
).rpm
38 cat >"$rootdir"/test.sh
<<EOF
42 rpm -Va &> /test.output
43 find / -xdev -type f -not -path '/var/*' \
44 -not -path '/usr/lib/modules/*/modules.*' \
45 -not -path '/etc/*-' \
46 -not -path '/etc/.pwd.lock' \
47 -not -path '/run/mount/utab' \
48 -not -path '/test.sh' \
49 -not -path '/test.output' \
50 -not -path '/etc/nsswitch.conf.bak' \
51 -not -path '/etc/iscsi/initiatorname.iscsi' \
52 -not -path '/boot/*0-rescue*' \
53 -not -patch '/usr/share/mime/*' \
54 -not -patch '/etc/crypto-policies/*' \
55 -not -path '/dev/null' \
56 -not -path "/boot/loader/entries/\$(cat /etc/machine-id)-*" \
57 -not -path "/boot/\$(cat /etc/machine-id)/*" \
58 -exec rpm -qf '{}' ';' | \
59 grep -F 'not owned' &> /test.output
63 chmod 0755 "$rootdir/test.sh"
65 chroot
"$rootdir" /test.sh
67 if [[ -s "$rootdir"/test.output
]]; then
70 cat "$rootdir"/test.output
>&2
73 umount
"$rootdir/proc"
77 [[ $failed ]] && return 1
90 .
$testdir/test-functions