diff options
Diffstat (limited to 'test/TEST-50-MULTINIC')
-rwxr-xr-x | test/TEST-50-MULTINIC/client-init.sh | 2 | ||||
-rwxr-xr-x | test/TEST-50-MULTINIC/create-root.sh | 6 | ||||
-rwxr-xr-x | test/TEST-50-MULTINIC/test.sh | 35 |
3 files changed, 22 insertions, 21 deletions
diff --git a/test/TEST-50-MULTINIC/client-init.sh b/test/TEST-50-MULTINIC/client-init.sh index 4c51e27..8495913 100755 --- a/test/TEST-50-MULTINIC/client-init.sh +++ b/test/TEST-50-MULTINIC/client-init.sh @@ -32,7 +32,7 @@ done { echo "OK" echo "$IFACES" -} | dd oflag=direct,dsync of=/dev/disk/by-id/ata-disk_marker +} | dd oflag=direct,dsync of=/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_marker status=none getargbool 0 rd.shell && sh -i diff --git a/test/TEST-50-MULTINIC/create-root.sh b/test/TEST-50-MULTINIC/create-root.sh index 8060b00..0518937 100755 --- a/test/TEST-50-MULTINIC/create-root.sh +++ b/test/TEST-50-MULTINIC/create-root.sh @@ -12,12 +12,12 @@ udevadm settle set -ex -mkfs.ext4 -L dracut /dev/disk/by-id/ata-disk_root +mkfs.ext4 -q -L dracut /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root mkdir -p /root -mount -t ext4 /dev/disk/by-id/ata-disk_root /root +mount -t ext4 /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root /root cp -a -t /root /source/* mkdir -p /root/run umount /root -echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/disk/by-id/ata-disk_marker +echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_marker status=none sync poweroff -f diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh index 4f81235..e2aa5a3 100755 --- a/test/TEST-50-MULTINIC/test.sh +++ b/test/TEST-50-MULTINIC/test.sh @@ -7,6 +7,11 @@ TEST_DESCRIPTION="root filesystem on NFS with multiple nics with $USE_NETWORK" #DEBUGFAIL="loglevel=7 rd.shell rd.break" #SERIAL="tcp:127.0.0.1:9999" +# skip the test if ifcfg dracut module can not be installed +test_check() { + test -d /etc/sysconfig/network-scripts +} + run_server() { # Start server first echo "MULTINIC TEST SETUP: Starting DHCP/NFS server" @@ -14,14 +19,13 @@ run_server() { declare -a disk_args=() # shellcheck disable=SC2034 declare -i disk_index=0 - qemu_add_drive_args disk_index disk_args "$TESTDIR"/server.img root + qemu_add_drive disk_index disk_args "$TESTDIR"/server.img root "$testdir"/run-qemu \ "${disk_args[@]}" \ -net socket,listen=127.0.0.1:12350 \ -net nic,macaddr=52:54:01:12:34:56,model=e1000 \ -serial "${SERIAL:-"file:$TESTDIR/server.log"}" \ - -device i6300esb -watchdog-action poweroff \ -append "panic=1 oops=panic softlockup_panic=1 systemd.crash_reboot root=LABEL=dracut rootfstype=ext4 rw console=ttyS0,115200n81 selinux=0" \ -initrd "$TESTDIR"/initramfs.server \ -pidfile "$TESTDIR"/server.pid -daemonize || return 1 @@ -57,7 +61,7 @@ client_test() { declare -a disk_args=() # shellcheck disable=SC2034 declare -i disk_index=0 - qemu_add_drive_args disk_index disk_args "$TESTDIR"/marker.img marker + qemu_add_drive disk_index disk_args "$TESTDIR"/marker.img marker cmdline="$cmdline rd.net.timeout.dhcp=30" # Invoke KVM and/or QEMU to actually create the target filesystem. @@ -72,8 +76,7 @@ client_test() { -netdev hubport,id=n2,hubid=2 \ -device e1000,netdev=n1,mac=52:54:00:12:34:98 \ -device e1000,netdev=n2,mac=52:54:00:12:34:99 \ - -device i6300esb -watchdog-action poweroff \ - -append "quiet panic=1 oops=panic softlockup_panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console" \ + -append "$cmdline rd.retry=5 ro init=/sbin/init systemd.log_target=console" \ -initrd "$TESTDIR"/initramfs.testing || return 1 { @@ -189,7 +192,7 @@ test_setup() { ) inst_multiple sh ls shutdown poweroff stty cat ps ln ip \ - dmesg mkdir cp ping exportfs \ + dmesg mkdir cp exportfs \ modprobe rpc.nfsd rpc.mountd showmount tcpdump \ sleep mount chmod rm for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do @@ -247,7 +250,7 @@ test_setup() { ) inst_multiple sh shutdown poweroff stty cat ps ln ip dd \ - mount dmesg mkdir cp ping grep setsid ls vi less cat sync + mount dmesg mkdir cp grep setsid ls vi less cat sync for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do if [ -f "${_terminfodir}"/l/linux ]; then inst_multiple -o "${_terminfodir}"/l/linux @@ -291,7 +294,7 @@ test_setup() { export initdir=$TESTDIR/overlay # shellcheck disable=SC1090 . "$PKGLIBDIR"/dracut-init.sh - inst_multiple sfdisk mkfs.ext4 poweroff cp umount sync dd + inst_multiple mkfs.ext4 poweroff cp umount sync dd inst_hook initqueue 01 ./create-root.sh inst_hook initqueue/finished 01 ./finished-false.sh ) @@ -310,8 +313,8 @@ test_setup() { declare -a disk_args=() # shellcheck disable=SC2034 declare -i disk_index=0 - qemu_add_drive_args disk_index disk_args "$TESTDIR"/marker.img marker 1 - qemu_add_drive_args disk_index disk_args "$TESTDIR"/server.img root 120 + qemu_add_drive disk_index disk_args "$TESTDIR"/marker.img marker 1 + qemu_add_drive disk_index disk_args "$TESTDIR"/server.img root 120 # Invoke KVM and/or QEMU to actually create the target filesystem. "$testdir"/run-qemu \ @@ -337,11 +340,9 @@ test_setup() { inst_hook pre-pivot 85 "$PKGLIBDIR/modules.d/45ifcfg/write-ifcfg.sh" ) # Make client's dracut image - "$DRACUT" -l -i "$TESTDIR"/overlay / \ - -o "ifcfg plymouth" \ - -a "debug watchdog ${USE_NETWORK}" \ - --no-hostonly-cmdline -N \ - -f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1 + test_dracut \ + -a "${USE_NETWORK}" \ + "$TESTDIR"/initramfs.testing ( # shellcheck disable=SC2031 @@ -354,8 +355,8 @@ test_setup() { ) # Make server's dracut image "$DRACUT" -l -i "$TESTDIR"/overlay / \ - -m "bash rootfs-block debug kernel-modules watchdog qemu network network-legacy" \ - -d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files nfsd e1000 i6300esb ib700wdt" \ + -m "bash rootfs-block debug kernel-modules watchdog qemu network-legacy" \ + -d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files nfsd e1000 i6300esb" \ --no-hostonly-cmdline -N \ -f "$TESTDIR"/initramfs.server "$KVERSION" || return 1 |