2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
4 TEST_DESCRIPTION
="rpm integrity after dracut and kernel install"
9 export rootdir
=$TESTDIR/root
13 mkdir
-p "$rootdir/proc"
14 mkdir
-p "$rootdir/sys"
15 mkdir
-p "$rootdir/dev"
17 trap 'ret=$?; [[ -d $rootdir ]] && { umount "$rootdir/proc"; umount "$rootdir/sys"; umount "$rootdir/dev"; rm -rf -- "$rootdir"; }; exit $ret;' EXIT
18 trap '[[ -d $rootdir ]] && { umount "$rootdir/proc"; umount "$rootdir/sys"; umount "$rootdir/dev"; rm -rf -- "$rootdir"; }; exit 1;' SIGINT
20 mount
--bind /proc
"$rootdir/proc"
21 mount
--bind /sys
"$rootdir/sys"
22 mount
-t devtmpfs devtmpfs
"$rootdir/dev"
24 yum
--nogpgcheck --releasever=/ --installroot "$rootdir"/ install -y \
31 device-mapper-multipath \
35 iscsi-initiator-utils \
36 $basedir/dracut-
[0-9]*.$
(arch
).rpm \
37 $basedir/dracut-network-
[0-9]*.$
(arch
).rpm
39 cat >"$rootdir"/test.sh
<<EOF
43 rpm -Va &> /test.output
44 find / -xdev -type f -not -path '/var/*' \
45 -not -path '/usr/lib/modules/*/modules.*' \
46 -not -path '/etc/*-' \
47 -not -path '/etc/.pwd.lock' \
48 -not -path '/run/mount/utab' \
49 -not -path '/test.sh' \
50 -not -path '/test.output' \
51 -not -path '/etc/nsswitch.conf.bak' \
52 -not -path '/etc/iscsi/initiatorname.iscsi' \
53 -not -path '/boot/*0-rescue*' \
54 -not -path '/dev/null' \
55 -not -path "/boot/loader/entries/\$(cat /etc/machine-id)-*" \
56 -not -path "/boot/\$(cat /etc/machine-id)/*" \
57 -exec rpm -qf '{}' ';' | \
58 grep -F 'not owned' &> /test.output
62 chmod 0755 "$rootdir/test.sh"
64 chroot
"$rootdir" /test.sh
66 if [[ -s "$rootdir"/test.output
]]; then
69 cat "$rootdir"/test.output
>&2
72 umount
"$rootdir/proc"
76 [[ $failed ]] && return 1
89 .
$testdir/test-functions