diff options
author | Harald Hoyer <harald@redhat.com> | 2013-04-30 18:54:33 +0200 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2013-04-30 18:54:33 +0200 |
commit | 021b2fddff2db93c9936b0fd241b806c270b830a (patch) | |
tree | a39f39e6d3b39a6fa911f8e2323b3e01f8fe8af5 /test | |
parent | b6f2e05819d9867b7ca69365091ff480556fcfe9 (diff) | |
download | dracut-021b2fddff2db93c9936b0fd241b806c270b830a.tar.gz dracut-021b2fddff2db93c9936b0fd241b806c270b830a.tar.bz2 dracut-021b2fddff2db93c9936b0fd241b806c270b830a.zip |
test: use grep option "-F" and install /etc/os-release
Diffstat (limited to 'test')
-rwxr-xr-x | test/TEST-01-BASIC/test.sh | 5 | ||||
-rwxr-xr-x | test/TEST-02-SYSTEMD/test.sh | 5 | ||||
-rwxr-xr-x | test/TEST-03-USR-MOUNT/test.sh | 5 | ||||
-rwxr-xr-x | test/TEST-04-FULL-SYSTEMD/test.sh | 4 | ||||
-rwxr-xr-x | test/TEST-10-RAID/test.sh | 7 | ||||
-rwxr-xr-x | test/TEST-11-LVM/test.sh | 5 | ||||
-rwxr-xr-x | test/TEST-12-RAID-DEG/create-root.sh | 2 | ||||
-rwxr-xr-x | test/TEST-12-RAID-DEG/test.sh | 11 | ||||
-rwxr-xr-x | test/TEST-13-ENC-RAID-LVM/create-root.sh | 2 | ||||
-rwxr-xr-x | test/TEST-13-ENC-RAID-LVM/test.sh | 11 | ||||
-rwxr-xr-x | test/TEST-15-BTRFSRAID/create-root.sh | 10 | ||||
-rwxr-xr-x | test/TEST-15-BTRFSRAID/test.sh | 6 | ||||
-rwxr-xr-x | test/TEST-16-DMSQUASH/test.sh | 3 | ||||
-rwxr-xr-x | test/TEST-20-NFS/test.sh | 4 | ||||
-rwxr-xr-x | test/TEST-30-ISCSI/test.sh | 6 | ||||
-rwxr-xr-x | test/TEST-40-NBD/test.sh | 9 | ||||
-rwxr-xr-x | test/TEST-50-MULTINIC/test.sh | 6 | ||||
-rwxr-xr-x | test/TEST-99-RPM/test.sh | 2 | ||||
-rwxr-xr-x | test/old.TEST-14-IMSM/test.sh | 4 |
19 files changed, 62 insertions, 45 deletions
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index 84f4b7d2..d39556c9 100755 --- a/test/TEST-01-BASIC/test.sh +++ b/test/TEST-01-BASIC/test.sh @@ -16,7 +16,7 @@ test_run() { -watchdog i6300esb -watchdog-action poweroff \ -append "root=LABEL=dracut rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing || return 1 - grep -m 1 -q dracut-root-block-success $TESTDIR/result || return 1 + grep -F -m 1 -q dracut-root-block-success $TESTDIR/result || return 1 } test_setup() { @@ -40,6 +40,7 @@ test_setup() { inst "$basedir/modules.d/40network/dhclient-script.sh" "/sbin/dhclient-script" inst "$basedir/modules.d/40network/ifup.sh" "/sbin/ifup" dracut_install grep + inst_simple /etc/os-release inst ./test-init.sh /sbin/init find_binary plymouth >/dev/null && dracut_install plymouth (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp ) @@ -74,7 +75,7 @@ test_setup() { -kernel "/boot/vmlinuz-$kernel" \ -append "root=/dev/dracut/root rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -m 1 -q dracut-root-block-created $TESTDIR/root.ext3 || return 1 + grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext3 || return 1 ( diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh index 459cf030..c141527e 100755 --- a/test/TEST-02-SYSTEMD/test.sh +++ b/test/TEST-02-SYSTEMD/test.sh @@ -12,7 +12,7 @@ test_run() { -net none -kernel /boot/vmlinuz-$KVERSION \ -append "root=LABEL=dracut rw loglevel=77 systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug init=/sbin/init $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing - grep -m 1 -q dracut-root-block-success $TESTDIR/root.ext3 || return 1 + grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext3 || return 1 } test_setup() { @@ -36,6 +36,7 @@ test_setup() { inst "$basedir/modules.d/40network/dhclient-script.sh" "/sbin/dhclient-script" inst "$basedir/modules.d/40network/ifup.sh" "/sbin/ifup" dracut_install grep + inst_simple /etc/os-release inst ./test-init.sh /sbin/init find_binary plymouth >/dev/null && dracut_install plymouth (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp ) @@ -70,7 +71,7 @@ test_setup() { -kernel "/boot/vmlinuz-$kernel" \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -m 1 -q dracut-root-block-created $TESTDIR/root.ext3 || return 1 + grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext3 || return 1 ( diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh index ca7dc120..01a69158 100755 --- a/test/TEST-03-USR-MOUNT/test.sh +++ b/test/TEST-03-USR-MOUNT/test.sh @@ -29,7 +29,7 @@ client_run() { return 1 fi - if ! grep -m 1 -q dracut-root-block-success $TESTDIR/result; then + if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/result; then echo "CLIENT TEST END: $test_name [FAILED]" return 1 fi @@ -68,6 +68,7 @@ test_setup() { inst "$basedir/modules.d/40network/ifup.sh" "/sbin/ifup" dracut_install grep inst_simple ./fstab /etc/fstab + inst_simple /etc/os-release inst ./test-init.sh /sbin/init find_binary plymouth >/dev/null && dracut_install plymouth (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp ) @@ -109,7 +110,7 @@ test_setup() { -kernel "/boot/vmlinuz-$kernel" \ -append "root=/dev/dracut/root rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs || return 1 + grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs || return 1 ( diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh index d3dc7ef1..6c972a32 100755 --- a/test/TEST-04-FULL-SYSTEMD/test.sh +++ b/test/TEST-04-FULL-SYSTEMD/test.sh @@ -30,7 +30,7 @@ client_run() { return 1 fi - if ! grep -m 1 -q dracut-root-block-success $TESTDIR/result; then + if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/result; then echo "CLIENT TEST END: $test_name [FAILED]" return 1 fi @@ -251,7 +251,7 @@ EOF -kernel "/boot/vmlinuz-$kernel" \ -append "root=/dev/fakeroot rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs || return 1 + grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.btrfs || return 1 ( diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh index e11c5185..ffce8fc7 100755 --- a/test/TEST-10-RAID/test.sh +++ b/test/TEST-10-RAID/test.sh @@ -14,7 +14,7 @@ test_run() { -net none -kernel /boot/vmlinuz-$KVERSION \ -append "root=/dev/dracut/root rd.auto rw rd.retry=10 console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing - grep -m 1 -q dracut-root-block-success $DISKIMAGE || return 1 + grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1 } test_setup() { @@ -35,6 +35,7 @@ test_setup() { [ -f ${_terminfodir}/l/linux ] && break done dracut_install -o ${_terminfodir}/l/linux + inst_simple /etc/os-release inst ./test-init.sh /sbin/init inst "$basedir/modules.d/40network/dhclient-script.sh" "/sbin/dhclient-script" inst "$basedir/modules.d/40network/ifup.sh" "/sbin/ifup" @@ -71,8 +72,8 @@ test_setup() { -kernel "/boot/vmlinuz-$kernel" \ -append "root=/dev/cannotreach rw rootfstype=ext2 console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -m 1 -q dracut-root-block-created $DISKIMAGE || return 1 - eval $(grep -a -m 1 ID_FS_UUID $DISKIMAGE) + grep -F -m 1 -q dracut-root-block-created $DISKIMAGE || return 1 + eval $(grep -F -a -m 1 ID_FS_UUID $DISKIMAGE) ( export initdir=$TESTDIR/overlay diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh index d876e551..65cf5885 100755 --- a/test/TEST-11-LVM/test.sh +++ b/test/TEST-11-LVM/test.sh @@ -13,7 +13,7 @@ test_run() { -net none -kernel /boot/vmlinuz-$KVERSION \ -append "root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing - grep -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 + grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 } test_setup() { @@ -34,6 +34,7 @@ test_setup() { inst "$basedir/modules.d/40network/dhclient-script.sh" "/sbin/dhclient-script" inst "$basedir/modules.d/40network/ifup.sh" "/sbin/ifup" dracut_install grep + inst_simple /etc/os-release inst ./test-init.sh /sbin/init find_binary plymouth >/dev/null && dracut_install plymouth (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp ) @@ -65,7 +66,7 @@ test_setup() { -kernel "/boot/vmlinuz-$kernel" \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 + grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 ( export initdir=$TESTDIR/overlay . $basedir/dracut-functions.sh diff --git a/test/TEST-12-RAID-DEG/create-root.sh b/test/TEST-12-RAID-DEG/create-root.sh index 07d0b393..5723b0ba 100755 --- a/test/TEST-12-RAID-DEG/create-root.sh +++ b/test/TEST-12-RAID-DEG/create-root.sh @@ -39,7 +39,7 @@ udevadm settle cryptsetup luksClose /dev/mapper/dracut_crypt_test udevadm settle mdadm -W /dev/md0 || : -mdadm --detail --export /dev/md0 |grep MD_UUID > /tmp/mduuid +mdadm --detail --export /dev/md0 |grep -F MD_UUID > /tmp/mduuid . /tmp/mduuid eval $(udevadm info --query=env --name=/dev/md0|while read line; do [ "$line" != "${line#*ID_FS_UUID*}" ] && echo $line; done;) { echo "dracut-root-block-created"; echo MD_UUID=$MD_UUID; echo "ID_FS_UUID=$ID_FS_UUID";} > /dev/sda1 diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh index 1eae41aa..1b5e7562 100755 --- a/test/TEST-12-RAID-DEG/test.sh +++ b/test/TEST-12-RAID-DEG/test.sh @@ -21,7 +21,7 @@ client_run() { -net none -kernel /boot/vmlinuz-$KVERSION \ -append "$* root=LABEL=root rw rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL " \ -initrd $TESTDIR/initramfs.testing - if ! grep -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then + if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then echo "CLIENT TEST END: $@ [FAIL]" return 1; fi @@ -32,7 +32,7 @@ client_run() { } test_run() { - eval $(grep --binary-files=text -m 1 MD_UUID $TESTDIR/root.ext2) + eval $(grep -F --binary-files=text -m 1 MD_UUID $TESTDIR/root.ext2) echo "MD_UUID=$MD_UUID" read LUKS_UUID < $TESTDIR/luksuuid @@ -75,6 +75,7 @@ test_setup() { inst "$basedir/modules.d/40network/dhclient-script.sh" "/sbin/dhclient-script" inst "$basedir/modules.d/40network/ifup.sh" "/sbin/ifup" dracut_install grep + inst_simple /etc/os-release inst ./test-init.sh /sbin/init find_binary plymouth >/dev/null && dracut_install plymouth (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp ) @@ -111,9 +112,9 @@ test_setup() { -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 - eval $(grep --binary-files=text -m 1 MD_UUID $TESTDIR/root.ext2) - eval $(grep -a -m 1 ID_FS_UUID $TESTDIR/root.ext2) + grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 + eval $(grep -F --binary-files=text -m 1 MD_UUID $TESTDIR/root.ext2) + eval $(grep -F -a -m 1 ID_FS_UUID $TESTDIR/root.ext2) echo $ID_FS_UUID > $TESTDIR/luksuuid ( diff --git a/test/TEST-13-ENC-RAID-LVM/create-root.sh b/test/TEST-13-ENC-RAID-LVM/create-root.sh index c8b67818..c4c7a179 100755 --- a/test/TEST-13-ENC-RAID-LVM/create-root.sh +++ b/test/TEST-13-ENC-RAID-LVM/create-root.sh @@ -48,7 +48,7 @@ cryptsetup luksClose /dev/mapper/dracut_sda4 && \ { echo "dracut-root-block-created" for i in /dev/sda[234]; do - udevadm info --query=env --name=$i|grep 'ID_FS_UUID=' + udevadm info --query=env --name=$i|grep -F 'ID_FS_UUID=' done } >/dev/sda1 poweroff -f diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh index b8fc7ff6..93d48a59 100755 --- a/test/TEST-13-ENC-RAID-LVM/test.sh +++ b/test/TEST-13-ENC-RAID-LVM/test.sh @@ -21,7 +21,7 @@ test_run() { -net none -kernel /boot/vmlinuz-$KVERSION \ -append "root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing - grep -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 + grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 echo "CLIENT TEST END: [OK]" dd if=/dev/zero of=$TESTDIR/check-success.img bs=1M count=1 @@ -34,7 +34,7 @@ test_run() { -net none -kernel /boot/vmlinuz-$KVERSION \ -append "root=/dev/dracut/root rw quiet rd.auto rd.retry=20 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing - grep -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 + grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 echo "CLIENT TEST END: [OK]" dd if=/dev/zero of=$TESTDIR/check-success.img bs=1M count=1 @@ -47,7 +47,7 @@ test_run() { -net none -kernel /boot/vmlinuz-$KVERSION \ -append "root=/dev/dracut/root rw quiet rd.auto rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL rd.luks.uuid=failme" \ -initrd $TESTDIR/initramfs.testing - grep -m 1 -q dracut-root-block-success $TESTDIR/check-success.img && return 1 + grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img && return 1 echo "CLIENT TEST END: [OK]" return 0 @@ -72,6 +72,7 @@ test_setup() { inst "$basedir/modules.d/40network/dhclient-script.sh" "/sbin/dhclient-script" inst "$basedir/modules.d/40network/ifup.sh" "/sbin/ifup" dracut_install grep + inst_simple /etc/os-release inst ./test-init.sh /sbin/init find_binary plymouth >/dev/null && dracut_install plymouth (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp ) @@ -102,8 +103,8 @@ test_setup() { -kernel "/boot/vmlinuz-$kernel" \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 - cryptoUUIDS=$(grep --binary-files=text -m 3 ID_FS_UUID $TESTDIR/root.ext2) + grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 + cryptoUUIDS=$(grep -F --binary-files=text -m 3 ID_FS_UUID $TESTDIR/root.ext2) for uuid in $cryptoUUIDS; do eval $uuid printf ' rd.luks.uuid=luks-%s ' $ID_FS_UUID diff --git a/test/TEST-15-BTRFSRAID/create-root.sh b/test/TEST-15-BTRFSRAID/create-root.sh index cd51935a..69f9280c 100755 --- a/test/TEST-15-BTRFSRAID/create-root.sh +++ b/test/TEST-15-BTRFSRAID/create-root.sh @@ -5,15 +5,15 @@ for x in 64-lvm.rules 70-mdadm.rules 99-mount-rules; do done udevadm control --reload # save a partition at the beginning for future flagging purposes -sfdisk -C 655600 -H 2 -S 32 -L /dev/sda <<EOF +sfdisk -C 327800 -H 2 -S 32 -L /dev/sda <<EOF ,16 ,,E ; ; -,10240 -,10240 -,10240 -,10240 +,5120 +,5120 +,5120 +,5120 EOF mkfs.btrfs -draid10 -mraid10 -L root /dev/sda5 /dev/sda6 /dev/sda7 /dev/sda8 udevadm settle diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh index 8f013d50..6d44fbc4 100755 --- a/test/TEST-15-BTRFSRAID/test.sh +++ b/test/TEST-15-BTRFSRAID/test.sh @@ -13,14 +13,14 @@ test_run() { -net none -kernel /boot/vmlinuz-$KVERSION \ -append "root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing - grep -m 1 -q dracut-root-block-success $DISKIMAGE || return 1 + dd if=$DISKIMAGE bs=512 count=2 | grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1 } test_setup() { # Create the blank file to use as a root filesystem DISKIMAGE=$TESTDIR/TEST-15-BTRFSRAID-root.img rm -f $DISKIMAGE - dd if=/dev/null of=$DISKIMAGE bs=2M seek=1024 + dd if=/dev/null of=$DISKIMAGE bs=1M seek=1024 kernel=$KVERSION # Create what will eventually be our root filesystem onto an overlay @@ -72,7 +72,7 @@ test_setup() { -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -m 1 -q dracut-root-block-created $DISKIMAGE || return 1 + dd if=$DISKIMAGE bs=512 count=2 | grep -F -m 1 -q dracut-root-block-created || return 1 ( export initdir=$TESTDIR/overlay diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh index 1f0854e4..074ec28b 100755 --- a/test/TEST-16-DMSQUASH/test.sh +++ b/test/TEST-16-DMSQUASH/test.sh @@ -23,7 +23,7 @@ test_run() { -net none -kernel /boot/vmlinuz-$KVERSION \ -append "root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing - grep -m 1 -q dracut-root-block-success $TESTDIR/root.img || return 1 + grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.img || return 1 } test_setup() { @@ -62,6 +62,7 @@ test_setup() { for f in /usr/share/syslinux/*; do inst_simple "$f" done + inst_simple /etc/os-release inst ./test-init.sh /sbin/init inst $TESTDIR/initramfs.testing "/boot/initramfs-$KVERSION.img" inst /boot/vmlinuz-$KVERSION diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh index 2b8a2ec9..859fe067 100755 --- a/test/TEST-20-NFS/test.sh +++ b/test/TEST-20-NFS/test.sh @@ -62,7 +62,7 @@ client_test() { -append "$cmdline $DEBUGFAIL rd.debug rd.retry=10 rd.info quiet ro console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.testing - if [[ $? -ne 0 ]] || ! grep -m 1 -q nfs-OK $TESTDIR/client.img; then + if [[ $? -ne 0 ]] || ! grep -F -m 1 -q nfs-OK $TESTDIR/client.img; then echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" return 1 fi @@ -250,6 +250,7 @@ test_setup() { [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd instmods nfsd sunrpc ipv6 lockd af_packet inst ./server-init.sh /sbin/init + inst_simple /etc/os-release inst ./hosts /etc/hosts inst ./exports /etc/exports inst ./dhcpd.conf /etc/dhcpd.conf @@ -296,6 +297,7 @@ test_setup() { done dracut_install -o ${_terminfodir}/l/linux inst ./client-init.sh /sbin/init + inst_simple /etc/os-release ( cd "$initdir" mkdir -p dev sys proc etc run diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index f9502e0d..990f7baf 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -48,7 +48,7 @@ run_client() { -kernel /boot/vmlinuz-$KVERSION \ -append "$* rw quiet rd.auto rd.retry=5 rd.debug rd.info console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing - if ! grep -m 1 -q iscsi-OK $TESTDIR/client.img; then + if ! grep -F -m 1 -q iscsi-OK $TESTDIR/client.img; then echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" return 1 fi @@ -111,6 +111,7 @@ test_setup() { [ -f ${_terminfodir}/l/linux ] && break done dracut_install -o ${_terminfodir}/l/linux + inst_simple /etc/os-release inst ./client-init.sh /sbin/init (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp ) cp -a /etc/ld.so.conf* $initdir/etc @@ -152,7 +153,7 @@ test_setup() { -kernel "/boot/vmlinuz-$kernel" \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -m 1 -q dracut-root-block-created $TESTDIR/client.img || return 1 + grep -F -m 1 -q dracut-root-block-created $TESTDIR/client.img || return 1 rm $TESTDIR/client.img ( export initdir=$TESTDIR/overlay @@ -196,6 +197,7 @@ test_setup() { [ -f /etc/netconfig ] && dracut_install /etc/netconfig type -P dhcpd >/dev/null && dracut_install dhcpd [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd + inst_simple /etc/os-release inst ./server-init.sh /sbin/init inst ./hosts /etc/hosts inst ./dhcpd.conf /etc/dhcpd.conf diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index 208b7849..9ad95b98 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -64,7 +64,7 @@ client_test() { -append "$cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81 selinux=0 " \ -initrd $TESTDIR/initramfs.testing - if [[ $? -ne 0 ]] || ! grep -m 1 -q nbd-OK $TESTDIR/flag.img; then + if [[ $? -ne 0 ]] || ! grep -F -m 1 -q nbd-OK $TESTDIR/flag.img; then echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" return 1 fi @@ -205,6 +205,7 @@ make_encrypted_root() { done dracut_install -o ${_terminfodir}/l/linux inst ./client-init.sh /sbin/init + inst_simple /etc/os-release find_binary plymouth >/dev/null && dracut_install plymouth cp -a /etc/ld.so.conf* $initdir/etc sudo ldconfig -r "$initdir" @@ -239,8 +240,8 @@ make_encrypted_root() { -kernel "/boot/vmlinuz-$kernel" \ -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -m 1 -q dracut-root-block-created $TESTDIR/flag.img || return 1 - grep -a -m 1 ID_FS_UUID $TESTDIR/flag.img > $TESTDIR/luks.uuid + grep -F -m 1 -q dracut-root-block-created $TESTDIR/flag.img || return 1 + grep -F -a -m 1 ID_FS_UUID $TESTDIR/flag.img > $TESTDIR/luks.uuid } make_client_root() { @@ -262,6 +263,7 @@ make_client_root() { done dracut_install -o ${_terminfodir}/l/linux inst ./client-init.sh /sbin/init + inst_simple /etc/os-release inst /etc/nsswitch.conf /etc/nsswitch.conf inst /etc/passwd /etc/passwd inst /etc/group /etc/group @@ -303,6 +305,7 @@ make_server_root() { type -P dhcpd >/dev/null && dracut_install dhcpd [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd inst ./server-init.sh /sbin/init + inst_simple /etc/os-release inst ./hosts /etc/hosts inst ./dhcpd.conf /etc/dhcpd.conf inst /etc/nsswitch.conf /etc/nsswitch.conf diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh index 5cb09716..e2a8ab96 100755 --- a/test/TEST-50-MULTINIC/test.sh +++ b/test/TEST-50-MULTINIC/test.sh @@ -61,7 +61,7 @@ client_test() { -append "$cmdline $DEBUGFAIL rd.retry=5 rd.info ro console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ -initrd $TESTDIR/initramfs.testing - if [[ $? -ne 0 ]] || ! grep -m 1 -q OK $TESTDIR/client.img; then + if [[ $? -ne 0 ]] || ! grep -F -m 1 -q OK $TESTDIR/client.img; then echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" return 1 fi @@ -69,7 +69,7 @@ client_test() { for i in $check ; do echo $i - if ! grep -m 1 -q $i $TESTDIR/client.img; then + if ! grep -F -m 1 -q $i $TESTDIR/client.img; then echo "CLIENT TEST END: $test_name [FAILED - BAD IF]" return 1 fi @@ -170,6 +170,7 @@ test_setup() { type -P dhcpd >/dev/null && dracut_install dhcpd [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd instmods nfsd sunrpc ipv6 lockd af_packet + inst_simple /etc/os-release inst ./server-init.sh /sbin/init inst ./hosts /etc/hosts inst ./exports /etc/exports @@ -208,6 +209,7 @@ test_setup() { [ -f ${_terminfodir}/l/linux ] && break done dracut_install -o ${_terminfodir}/l/linux + inst_simple /etc/os-release inst ./client-init.sh /sbin/init ( cd "$initdir" diff --git a/test/TEST-99-RPM/test.sh b/test/TEST-99-RPM/test.sh index f030cb0a..8ae7f8e2 100755 --- a/test/TEST-99-RPM/test.sh +++ b/test/TEST-99-RPM/test.sh @@ -53,7 +53,7 @@ find / -xdev -type f -not -path '/var/*' \ -not -path '/boot/*0-rescue*' \ -not -path '/dev/null' \ -exec rpm -qf '{}' ';' | \ - fgrep 'not owned' &> /test.output + grep -F 'not owned' &> /test.output exit EOF diff --git a/test/old.TEST-14-IMSM/test.sh b/test/old.TEST-14-IMSM/test.sh index cd2d715c..d69f00d5 100755 --- a/test/old.TEST-14-IMSM/test.sh +++ b/test/old.TEST-14-IMSM/test.sh @@ -17,7 +17,7 @@ client_run() { -net none -kernel /boot/vmlinuz-$KVERSION \ -append "$@ root=LABEL=root rw quiet rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info $DEBUGFAIL" \ -initrd $TESTDIR/initramfs.testing - if ! grep -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then + if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then echo "CLIENT TEST END: $@ [FAIL]" return 1; fi @@ -102,7 +102,7 @@ test_setup() { -kernel "/boot/vmlinuz-$kernel" \ -append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -initrd $TESTDIR/initramfs.makeroot || return 1 - grep -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 + grep -F -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1 ( export initdir=$TESTDIR/overlay . $basedir/dracut-functions.sh |