Browse Source

fixup test suite

- qemu wants to have "format=raw"
- "-kernel" is obsolete, because run-qemu picks the right path
master
Harald Hoyer 10 years ago
parent
commit
4358ace43c
  1. 9
      test/TEST-01-BASIC/test.sh
  2. 7
      test/TEST-02-SYSTEMD/test.sh
  3. 13
      test/TEST-03-USR-MOUNT/test.sh
  4. 10
      test/TEST-04-FULL-SYSTEMD/test.sh
  5. 7
      test/TEST-10-RAID/test.sh
  6. 7
      test/TEST-11-LVM/test.sh
  7. 17
      test/TEST-12-RAID-DEG/test.sh
  8. 21
      test/TEST-13-ENC-RAID-LVM/test.sh
  9. 15
      test/TEST-14-IMSM/test.sh
  10. 7
      test/TEST-15-BTRFSRAID/test.sh
  11. 4
      test/TEST-16-DMSQUASH/test.sh
  12. 7
      test/TEST-17-LVM-THIN/test.sh
  13. 6
      test/TEST-20-NFS/test.sh
  14. 21
      test/TEST-30-ISCSI/test.sh
  15. 15
      test/TEST-40-NBD/test.sh
  16. 6
      test/TEST-50-MULTINIC/test.sh

9
test/TEST-01-BASIC/test.sh

@ -9,10 +9,10 @@ KVERSION=${KVERSION-$(uname -r)}
test_run() { test_run() {
dd if=/dev/zero of=$TESTDIR/result bs=1M count=1 dd if=/dev/zero of=$TESTDIR/result bs=1M count=1
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.ext3 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \
-hdb $TESTDIR/result \ -drive format=raw,index=1,media=disk,file=$TESTDIR/result \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \ -net none \
-watchdog i6300esb -watchdog-action poweroff \ -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" \ -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 -initrd $TESTDIR/initramfs.testing || return 1
@ -78,9 +78,8 @@ test_setup() {
# Invoke KVM and/or QEMU to actually create the target filesystem. # Invoke KVM and/or QEMU to actually create the target filesystem.


$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.ext3 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \
-m 256M -smp 2 -nographic -net none \ -m 256M -smp 2 -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/dracut/root rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/dracut/root rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.makeroot || return 1 -initrd $TESTDIR/initramfs.makeroot || return 1
grep -F -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

7
test/TEST-02-SYSTEMD/test.sh

@ -7,9 +7,9 @@ KVERSION="${KVERSION-$(uname -r)}"
#DEBUGFAIL="rd.shell" #DEBUGFAIL="rd.shell"
test_run() { test_run() {
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.ext3 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \ -net none \
-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" \ -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 -initrd $TESTDIR/initramfs.testing
grep -F -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
@ -75,9 +75,8 @@ test_setup() {
# Invoke KVM and/or QEMU to actually create the target filesystem. # Invoke KVM and/or QEMU to actually create the target filesystem.


$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.ext3 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \
-m 256M -smp 2 -nographic -net none \ -m 256M -smp 2 -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.makeroot || return 1 -initrd $TESTDIR/initramfs.makeroot || return 1
grep -F -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

13
test/TEST-03-USR-MOUNT/test.sh

@ -15,11 +15,11 @@ client_run() {


dd if=/dev/zero of=$TESTDIR/result bs=1M count=1 dd if=/dev/zero of=$TESTDIR/result bs=1M count=1
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.btrfs \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \
-hdb $TESTDIR/usr.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \
-hdc $TESTDIR/result \ -drive format=raw,index=2,media=disk,file=$TESTDIR/result \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \ -net none \
-watchdog i6300esb -watchdog-action poweroff \ -watchdog i6300esb -watchdog-action poweroff \
-append "root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ -append "root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \
-initrd $TESTDIR/initramfs.testing -initrd $TESTDIR/initramfs.testing
@ -112,10 +112,9 @@ test_setup() {
rm -rf -- $TESTDIR/overlay rm -rf -- $TESTDIR/overlay


$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.btrfs \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \
-hdb $TESTDIR/usr.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \
-m 256M -smp 2 -nographic -net none \ -m 256M -smp 2 -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/dracut/root rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/dracut/root rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.makeroot || return 1 -initrd $TESTDIR/initramfs.makeroot || return 1
grep -F -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

10
test/TEST-04-FULL-SYSTEMD/test.sh

@ -17,9 +17,9 @@ client_run() {


dd if=/dev/zero of=$TESTDIR/result bs=1M count=1 dd if=/dev/zero of=$TESTDIR/result bs=1M count=1
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.btrfs \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \
-hdb $TESTDIR/usr.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \
-hdc $TESTDIR/result \ -drive format=raw,index=2,media=disk,file=$TESTDIR/result \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 -nographic \
-net none \ -net none \
-append "root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT $DEBUGFAIL" \ -append "root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT $DEBUGFAIL" \
@ -244,8 +244,8 @@ EOF
rm -rf -- $TESTDIR/overlay rm -rf -- $TESTDIR/overlay


$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.btrfs \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.btrfs \
-hdb $TESTDIR/usr.btrfs \ -drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \
-m 256M -smp 2 -nographic -net none \ -m 256M -smp 2 -nographic -net none \
-append "root=/dev/fakeroot rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/fakeroot rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.makeroot || return 1 -initrd $TESTDIR/initramfs.makeroot || return 1

7
test/TEST-10-RAID/test.sh

@ -9,9 +9,9 @@ KVERSION=${KVERSION-$(uname -r)}
test_run() { test_run() {
DISKIMAGE=$TESTDIR/TEST-10-RAID-root.img DISKIMAGE=$TESTDIR/TEST-10-RAID-root.img
$testdir/run-qemu \ $testdir/run-qemu \
-hda $DISKIMAGE \ -drive format=raw,index=0,media=disk,file=$DISKIMAGE \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \ -net none \
-append "root=/dev/dracut/root rd.auto rw rd.retry=10 console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \ -append "root=/dev/dracut/root rd.auto rw rd.retry=10 console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \
-initrd $TESTDIR/initramfs.testing -initrd $TESTDIR/initramfs.testing
grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1 grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1
@ -75,9 +75,8 @@ test_setup() {
rm -rf -- $TESTDIR/overlay rm -rf -- $TESTDIR/overlay
# Invoke KVM and/or QEMU to actually create the target filesystem. # Invoke KVM and/or QEMU to actually create the target filesystem.
$testdir/run-qemu \ $testdir/run-qemu \
-hda $DISKIMAGE \ -drive format=raw,index=0,media=disk,file=$DISKIMAGE \
-m 256M -smp 2 -nographic -net none \ -m 256M -smp 2 -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/cannotreach rw rootfstype=ext2 console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/cannotreach rw rootfstype=ext2 console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.makeroot || return 1 -initrd $TESTDIR/initramfs.makeroot || return 1
grep -F -m 1 -q dracut-root-block-created $DISKIMAGE || return 1 grep -F -m 1 -q dracut-root-block-created $DISKIMAGE || return 1

7
test/TEST-11-LVM/test.sh

@ -8,9 +8,9 @@ KVERSION=${KVERSION-$(uname -r)}


test_run() { test_run() {
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.ext2 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \ -net none \
-append "root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ -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 -initrd $TESTDIR/initramfs.testing
grep -F -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
@ -71,8 +71,7 @@ test_setup() {
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1 -f $TESTDIR/initramfs.makeroot $KVERSION || return 1
rm -rf -- $TESTDIR/overlay rm -rf -- $TESTDIR/overlay
# Invoke KVM and/or QEMU to actually create the target filesystem. # Invoke KVM and/or QEMU to actually create the target filesystem.
$testdir/run-qemu -hda $TESTDIR/root.ext2 -m 256M -smp 2 -nographic -net none \ $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 256M -smp 2 -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.makeroot || return 1 -initrd $TESTDIR/initramfs.makeroot || return 1
grep -F -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

17
test/TEST-12-RAID-DEG/test.sh

@ -15,10 +15,10 @@ client_run() {
cp --sparse=always --reflink=auto $TESTDIR/disk3.img $TESTDIR/disk3.img.new cp --sparse=always --reflink=auto $TESTDIR/disk3.img $TESTDIR/disk3.img.new


$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.ext2 -m 256M -nographic -smp 2 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 256M -nographic -smp 2 \
-hdc $TESTDIR/disk2.img.new \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2.img.new \
-hdd $TESTDIR/disk3.img.new \ -drive format=raw,index=3,media=disk,file=$TESTDIR/disk3.img.new \
-net none -kernel /boot/vmlinuz-$KVERSION \ -net none \
-append "$* root=LABEL=root rw rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL " \ -append "$* root=LABEL=root rw rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL " \
-initrd $TESTDIR/initramfs.testing -initrd $TESTDIR/initramfs.testing
if ! grep -F -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
@ -112,12 +112,11 @@ test_setup() {
rm -rf -- $TESTDIR/overlay rm -rf -- $TESTDIR/overlay
# Invoke KVM and/or QEMU to actually create the target filesystem. # Invoke KVM and/or QEMU to actually create the target filesystem.
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.ext2 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \
-hdb $TESTDIR/disk1.img \ -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1.img \
-hdc $TESTDIR/disk2.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2.img \
-hdd $TESTDIR/disk3.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/disk3.img \
-m 256M -smp 2 -nographic -net none \ -m 256M -smp 2 -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.makeroot || return 1 -initrd $TESTDIR/initramfs.makeroot || return 1



21
test/TEST-13-ENC-RAID-LVM/test.sh

@ -15,10 +15,10 @@ test_run() {


echo "CLIENT TEST START: $LUKSARGS" echo "CLIENT TEST START: $LUKSARGS"
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.ext2 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \
-hdb $TESTDIR/check-success.img \ -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \ -net none \
-append "root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS $DEBUGFAIL" \ -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 -initrd $TESTDIR/initramfs.testing
grep -F -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
@ -28,10 +28,10 @@ test_run() {


echo "CLIENT TEST START: Any LUKS" echo "CLIENT TEST START: Any LUKS"
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.ext2 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \
-hdb $TESTDIR/check-success.img \ -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \ -net none \
-append "root=/dev/dracut/root rw quiet rd.auto rd.retry=20 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ -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 -initrd $TESTDIR/initramfs.testing
grep -F -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
@ -41,10 +41,10 @@ test_run() {


echo "CLIENT TEST START: Wrong LUKS UUID" echo "CLIENT TEST START: Wrong LUKS UUID"
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.ext2 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \
-hdb $TESTDIR/check-success.img \ -drive format=raw,index=1,media=disk,file=$TESTDIR/check-success.img \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \ -net none \
-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" \ -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 -initrd $TESTDIR/initramfs.testing
grep -F -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
@ -108,8 +108,7 @@ test_setup() {
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1 -f $TESTDIR/initramfs.makeroot $KVERSION || return 1
rm -rf -- $TESTDIR/overlay rm -rf -- $TESTDIR/overlay
# Invoke KVM and/or QEMU to actually create the target filesystem. # Invoke KVM and/or QEMU to actually create the target filesystem.
$testdir/run-qemu -hda $TESTDIR/root.ext2 -m 256M -smp 2 -nographic -net none \ $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 256M -smp 2 -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.makeroot || return 1 -initrd $TESTDIR/initramfs.makeroot || return 1
grep -F -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

15
test/TEST-14-IMSM/test.sh

@ -10,11 +10,11 @@ KVERSION=${KVERSION-$(uname -r)}
client_run() { client_run() {
echo "CLIENT TEST START: $@" echo "CLIENT TEST START: $@"
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.ext2 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \
-hdb $TESTDIR/disk1 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1 \
-hdc $TESTDIR/disk2 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2 \
-m 256M -nographic \ -m 256M -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \ -net none \
-append "$* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info $DEBUGFAIL" \ -append "$* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info $DEBUGFAIL" \
-initrd $TESTDIR/initramfs.testing -initrd $TESTDIR/initramfs.testing
if ! grep -F -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
@ -100,11 +100,10 @@ test_setup() {
rm -rf -- $TESTDIR/overlay rm -rf -- $TESTDIR/overlay
# Invoke KVM and/or QEMU to actually create the target filesystem. # Invoke KVM and/or QEMU to actually create the target filesystem.
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.ext2 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \
-hdb $TESTDIR/disk1 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/disk1 \
-hdc $TESTDIR/disk2 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/disk2 \
-m 256M -nographic -net none \ -m 256M -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.makeroot || return 1 -initrd $TESTDIR/initramfs.makeroot || return 1
grep -F -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

7
test/TEST-15-BTRFSRAID/test.sh

@ -8,9 +8,9 @@ KVERSION=${KVERSION-$(uname -r)}
test_run() { test_run() {
DISKIMAGE=$TESTDIR/TEST-15-BTRFSRAID-root.img DISKIMAGE=$TESTDIR/TEST-15-BTRFSRAID-root.img
$testdir/run-qemu \ $testdir/run-qemu \
-hda $DISKIMAGE \ -drive format=raw,index=0,media=disk,file=$DISKIMAGE \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \ -net none \
-append "root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \ -append "root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \
-initrd $TESTDIR/initramfs.testing -initrd $TESTDIR/initramfs.testing
dd if=$DISKIMAGE bs=512 count=4 skip=2048 | grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1 dd if=$DISKIMAGE bs=512 count=4 skip=2048 | grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1
@ -76,9 +76,8 @@ test_setup() {


# Invoke KVM and/or QEMU to actually create the target filesystem. # Invoke KVM and/or QEMU to actually create the target filesystem.
$testdir/run-qemu \ $testdir/run-qemu \
-hda $DISKIMAGE \ -drive format=raw,index=0,media=disk,file=$DISKIMAGE \
-m 256M -smp 2 -nographic -net none \ -m 256M -smp 2 -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.makeroot || return 1 -initrd $TESTDIR/initramfs.makeroot || return 1



4
test/TEST-16-DMSQUASH/test.sh

@ -18,9 +18,9 @@ test_run() {
"$testdir"/run-qemu \ "$testdir"/run-qemu \
-boot order=d \ -boot order=d \
-cdrom "$TESTDIR"/livecd.iso \ -cdrom "$TESTDIR"/livecd.iso \
-hda "$TESTDIR"/root.img \ -drive format=raw,index=0,media=disk,file="$TESTDIR"/root.img \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 -nographic \
-net none -kernel /boot/vmlinuz-"$KVERSION" \ -net none \
-append "root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ -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 -initrd "$TESTDIR"/initramfs.testing
grep -F -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

7
test/TEST-17-LVM-THIN/test.sh

@ -8,9 +8,9 @@ KVERSION=${KVERSION-$(uname -r)}


test_run() { test_run() {
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.ext2 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \ -net none \
-append "root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ -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 -initrd $TESTDIR/initramfs.testing
grep -F -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
@ -71,8 +71,7 @@ test_setup() {
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1 -f $TESTDIR/initramfs.makeroot $KVERSION || return 1
rm -rf -- $TESTDIR/overlay rm -rf -- $TESTDIR/overlay
# Invoke KVM and/or QEMU to actually create the target filesystem. # Invoke KVM and/or QEMU to actually create the target filesystem.
$testdir/run-qemu -hda $TESTDIR/root.ext2 -m 256M -smp 2 -nographic -net none \ $testdir/run-qemu -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext2 -m 256M -smp 2 -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/fakeroot rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.makeroot || return 1 -initrd $TESTDIR/initramfs.makeroot || return 1
grep -F -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

6
test/TEST-20-NFS/test.sh

@ -13,14 +13,13 @@ run_server() {


fsck -a $TESTDIR/server.ext3 || return 1 fsck -a $TESTDIR/server.ext3 || return 1
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/server.ext3 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/server.ext3 \
-m 256M -smp 2 \ -m 256M -smp 2 \
-display none \ -display none \
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \
-net socket,listen=127.0.0.1:12320 \ -net socket,listen=127.0.0.1:12320 \
-serial ${SERIAL:-null} \ -serial ${SERIAL:-null} \
-watchdog i6300esb -watchdog-action poweroff \ -watchdog i6300esb -watchdog-action poweroff \
-kernel /boot/vmlinuz-$KVERSION \
-append "rd.debug loglevel=77 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ -append "rd.debug loglevel=77 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.server \ -initrd $TESTDIR/initramfs.server \
-pidfile $TESTDIR/server.pid -daemonize || return 1 -pidfile $TESTDIR/server.pid -daemonize || return 1
@ -50,11 +49,10 @@ client_test() {
fi fi


$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/client.img \ -drive format=raw,index=0,media=disk,file=$TESTDIR/client.img \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 -nographic \
-net nic,macaddr=$mac,model=e1000 \ -net nic,macaddr=$mac,model=e1000 \
-net socket,connect=127.0.0.1:12320 \ -net socket,connect=127.0.0.1:12320 \
-kernel /boot/vmlinuz-$KVERSION \
-watchdog i6300esb -watchdog-action poweroff \ -watchdog i6300esb -watchdog-action poweroff \
-append "$cmdline $DEBUGFAIL rd.debug rd.retry=10 rd.info quiet ro console=ttyS0,115200n81 selinux=0" \ -append "$cmdline $DEBUGFAIL rd.debug rd.retry=10 rd.info quiet ro console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.testing -initrd $TESTDIR/initramfs.testing

21
test/TEST-30-ISCSI/test.sh

@ -12,16 +12,15 @@ run_server() {
echo "iSCSI TEST SETUP: Starting DHCP/iSCSI server" echo "iSCSI TEST SETUP: Starting DHCP/iSCSI server"


$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/server.ext3 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/server.ext3 \
-hdb $TESTDIR/root.ext3 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/root.ext3 \
-hdc $TESTDIR/iscsidisk2.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \
-hdd $TESTDIR/iscsidisk3.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \
-m 256M -smp 2 \ -m 256M -smp 2 \
-display none \ -display none \
-serial $SERIAL \ -serial $SERIAL \
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \
-net socket,listen=127.0.0.1:12330 \ -net socket,listen=127.0.0.1:12330 \
-kernel /boot/vmlinuz-$KVERSION \
-append "root=/dev/sda rootfstype=ext3 rw rd.debug loglevel=77 console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/sda rootfstype=ext3 rw rd.debug loglevel=77 console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.server \ -initrd $TESTDIR/initramfs.server \
-pidfile $TESTDIR/server.pid -daemonize || return 1 -pidfile $TESTDIR/server.pid -daemonize || return 1
@ -41,11 +40,10 @@ run_client() {
dd if=/dev/zero of=$TESTDIR/client.img bs=1M count=1 dd if=/dev/zero of=$TESTDIR/client.img bs=1M count=1


$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/client.img \ -drive format=raw,index=0,media=disk,file=$TESTDIR/client.img \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 -nographic \
-net nic,macaddr=52:54:00:12:34:00,model=e1000 \ -net nic,macaddr=52:54:00:12:34:00,model=e1000 \
-net socket,connect=127.0.0.1:12330 \ -net socket,connect=127.0.0.1:12330 \
-kernel /boot/vmlinuz-$KVERSION \
-append "$* rw quiet rd.auto rd.retry=5 rd.debug rd.info console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \ -append "$* rw quiet rd.auto rd.retry=5 rd.debug rd.info console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \
-initrd $TESTDIR/initramfs.testing -initrd $TESTDIR/initramfs.testing
if ! grep -F -m 1 -q iscsi-OK $TESTDIR/client.img; then if ! grep -F -m 1 -q iscsi-OK $TESTDIR/client.img; then
@ -155,12 +153,11 @@ test_setup() {
fi fi
# Invoke KVM and/or QEMU to actually create the target filesystem. # Invoke KVM and/or QEMU to actually create the target filesystem.
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/root.ext3 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/root.ext3 \
-hdb $TESTDIR/client.img \ -drive format=raw,index=1,media=disk,file=$TESTDIR/client.img \
-hdc $TESTDIR/iscsidisk2.img \ -drive format=raw,index=2,media=disk,file=$TESTDIR/iscsidisk2.img \
-hdd $TESTDIR/iscsidisk3.img \ -drive format=raw,index=3,media=disk,file=$TESTDIR/iscsidisk3.img \
-smp 2 -m 256M -nographic -net none \ -smp 2 -m 256M -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/fakeroot rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.makeroot || return 1 -initrd $TESTDIR/initramfs.makeroot || return 1
grep -F -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

15
test/TEST-40-NBD/test.sh

@ -14,15 +14,14 @@ run_server() {
echo "NBD TEST SETUP: Starting DHCP/NBD server" echo "NBD TEST SETUP: Starting DHCP/NBD server"


$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/server.ext2 \ -drive format=raw,index=0,media=disk,file=$TESTDIR/server.ext2 \
-hdb $TESTDIR/nbd.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/nbd.ext2 \
-hdc $TESTDIR/encrypted.ext2 \ -drive format=raw,index=2,media=disk,file=$TESTDIR/encrypted.ext2 \
-m 256M -smp 2 \ -m 256M -smp 2 \
-display none \ -display none \
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \
-net socket,listen=127.0.0.1:12340 \ -net socket,listen=127.0.0.1:12340 \
-serial $SERIAL \ -serial $SERIAL \
-kernel /boot/vmlinuz-$KVERSION \
-append "root=/dev/sda rootfstype=ext2 rw quiet console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/sda rootfstype=ext2 rw quiet console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1 -initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1
sudo chmod 644 $TESTDIR/server.pid || return 1 sudo chmod 644 $TESTDIR/server.pid || return 1
@ -54,12 +53,11 @@ client_test() {
fi fi


$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/flag.img \ -drive format=raw,index=0,media=disk,file=$TESTDIR/flag.img \
-m 512M -smp 2 \ -m 512M -smp 2 \
-nographic \ -nographic \
-net nic,macaddr=$mac,model=e1000 \ -net nic,macaddr=$mac,model=e1000 \
-net socket,connect=127.0.0.1:12340 \ -net socket,connect=127.0.0.1:12340 \
-kernel /boot/vmlinuz-$KVERSION \
-append "$cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81 selinux=0 " \ -append "$cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81 selinux=0 " \
-initrd $TESTDIR/initramfs.testing -initrd $TESTDIR/initramfs.testing


@ -246,11 +244,10 @@ make_encrypted_root() {


# Invoke KVM and/or QEMU to actually create the target filesystem. # Invoke KVM and/or QEMU to actually create the target filesystem.
$testdir/run-qemu \ $testdir/run-qemu \
-hda $TESTDIR/flag.img \ -drive format=raw,index=0,media=disk,file=$TESTDIR/flag.img \
-hdb $TESTDIR/encrypted.ext2 \ -drive format=raw,index=1,media=disk,file=$TESTDIR/encrypted.ext2 \
-m 256M -smp 2\ -m 256M -smp 2\
-nographic -net none \ -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \ -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.makeroot || return 1 -initrd $TESTDIR/initramfs.makeroot || return 1
grep -F -m 1 -q dracut-root-block-created $TESTDIR/flag.img || return 1 grep -F -m 1 -q dracut-root-block-created $TESTDIR/flag.img || return 1

6
test/TEST-50-MULTINIC/test.sh

@ -13,14 +13,13 @@ run_server() {


fsck -a "$TESTDIR"/server.ext3 || return 1 fsck -a "$TESTDIR"/server.ext3 || return 1
$testdir/run-qemu \ $testdir/run-qemu \
-hda "$TESTDIR"/server.ext3 \ -drive format=raw,index=0,media=disk,file="$TESTDIR"/server.ext3 \
-m 512M -smp 2 \ -m 512M -smp 2 \
-display none \ -display none \
-net socket,listen=127.0.0.1:12350 \ -net socket,listen=127.0.0.1:12350 \
-net nic,macaddr=52:54:01:12:34:56,model=e1000 \ -net nic,macaddr=52:54:01:12:34:56,model=e1000 \
${SERIAL:+-serial "$SERIAL"} \ ${SERIAL:+-serial "$SERIAL"} \
-watchdog i6300esb -watchdog-action poweroff \ -watchdog i6300esb -watchdog-action poweroff \
-kernel /boot/vmlinuz-"$KVERSION" \
-append "loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ -append "loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \
-initrd "$TESTDIR"/initramfs.server \ -initrd "$TESTDIR"/initramfs.server \
-pidfile "$TESTDIR"/server.pid -daemonize || return 1 -pidfile "$TESTDIR"/server.pid -daemonize || return 1
@ -49,13 +48,12 @@ client_test() {
return 1 return 1
fi fi


$testdir/run-qemu -hda "$TESTDIR"/client.img -m 512M -smp 2 -nographic \ $testdir/run-qemu -drive format=raw,index=0,media=disk,file="$TESTDIR"/client.img -m 512M -smp 2 -nographic \
-net socket,connect=127.0.0.1:12350 \ -net socket,connect=127.0.0.1:12350 \
-net nic,macaddr=52:54:00:12:34:$mac1,model=e1000 \ -net nic,macaddr=52:54:00:12:34:$mac1,model=e1000 \
-net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \ -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \
-net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \ -net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \
-watchdog i6300esb -watchdog-action poweroff \ -watchdog i6300esb -watchdog-action poweroff \
-kernel /boot/vmlinuz-"$KVERSION" \
-append "$cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \ -append "$cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \
-initrd "$TESTDIR"/initramfs.testing -initrd "$TESTDIR"/initramfs.testing



Loading…
Cancel
Save