Harald Hoyer ff2fda
From d63a4e285ea7f4c2249dd3b53f4ed2fdd1f0e374 Mon Sep 17 00:00:00 2001
Harald Hoyer ff2fda
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer ff2fda
Date: Thu, 12 Jul 2018 15:18:48 +0200
Harald Hoyer ff2fda
Subject: [PATCH] TEST-40-NBD: disable for now
Harald Hoyer ff2fda
Harald Hoyer ff2fda
nbd is always broken
Harald Hoyer ff2fda
---
Harald Hoyer ff2fda
 test/TEST-40-NBD/test.sh | 115 +++++++++++++++++++++++++----------------------
Harald Hoyer ff2fda
 1 file changed, 62 insertions(+), 53 deletions(-)
Harald Hoyer ff2fda
Harald Hoyer ff2fda
diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh
Harald Hoyer ff2fda
index 4931bb73..12736a15 100755
Harald Hoyer ff2fda
--- a/test/TEST-40-NBD/test.sh
Harald Hoyer ff2fda
+++ b/test/TEST-40-NBD/test.sh
Harald Hoyer ff2fda
@@ -8,6 +8,11 @@ KVERSION=${KVERSION-$(uname -r)}
Harald Hoyer ff2fda
 #DEBUGFAIL="rd.shell rd.break rd.debug systemd.log_target=console loglevel=7 systemd.log_level=debug"
Harald Hoyer ff2fda
 #SERIAL="tcp:127.0.0.1:9999"
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
+test_check() {
Harald Hoyer ff2fda
+    echo "nbd is constantly broken. skipping"
Harald Hoyer ff2fda
+    return 1
Harald Hoyer ff2fda
+}
Harald Hoyer ff2fda
+
Harald Hoyer ff2fda
 run_server() {
Harald Hoyer ff2fda
     # Start server first
Harald Hoyer ff2fda
     echo "NBD TEST SETUP: Starting DHCP/NBD server"
Harald Hoyer ff2fda
@@ -107,76 +112,76 @@ client_run() {
Harald Hoyer ff2fda
     # The default is ext3,errors=continue so use that to determine
Harald Hoyer ff2fda
     # if our options were parsed and used
Harald Hoyer ff2fda
     client_test "NBD root=nbd:IP:port" 52:54:00:12:34:00 \
Harald Hoyer ff2fda
-        "root=nbd:192.168.50.1:raw rd.luks=0" || return 1
Harald Hoyer ff2fda
+                "root=nbd:192.168.50.1:raw rd.luks=0" || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD root=nbd:IP:port::fsopts" 52:54:00:12:34:00 \
Harald Hoyer ff2fda
-        "root=nbd:192.168.50.1:raw::errors=panic rd.luks=0" \
Harald Hoyer ff2fda
-        ext3 errors=panic || return 1
Harald Hoyer ff2fda
+                "root=nbd:192.168.50.1:raw::errors=panic rd.luks=0" \
Harald Hoyer ff2fda
+                ext3 errors=panic || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD root=nbd:IP:port:fstype" 52:54:00:12:34:00 \
Harald Hoyer ff2fda
-        "root=nbd:192.168.50.1:raw:ext2 rd.luks=0" ext2 || return 1
Harald Hoyer ff2fda
+                "root=nbd:192.168.50.1:raw:ext2 rd.luks=0" ext2 || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD root=nbd:IP:port:fstype:fsopts" 52:54:00:12:34:00 \
Harald Hoyer ff2fda
-        "root=nbd:192.168.50.1:raw:ext2:errors=panic rd.luks=0" \
Harald Hoyer ff2fda
-        ext2 errors=panic || return 1
Harald Hoyer ff2fda
+                "root=nbd:192.168.50.1:raw:ext2:errors=panic rd.luks=0" \
Harald Hoyer ff2fda
+                ext2 errors=panic || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD Bridge root=nbd:IP:port:fstype:fsopts" 52:54:00:12:34:00 \
Harald Hoyer ff2fda
-        "root=nbd:192.168.50.1:raw:ext2:errors=panic bridge rd.luks=0" \
Harald Hoyer ff2fda
-        ext2 errors=panic || return 1
Harald Hoyer ff2fda
+                "root=nbd:192.168.50.1:raw:ext2:errors=panic bridge rd.luks=0" \
Harald Hoyer ff2fda
+                ext2 errors=panic || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
-     # There doesn't seem to be a good way to validate the NBD options, so
Harald Hoyer ff2fda
-     # just check that we don't screw up the other options
Harald Hoyer ff2fda
+    # There doesn't seem to be a good way to validate the NBD options, so
Harald Hoyer ff2fda
+    # just check that we don't screw up the other options
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD root=nbd:IP:port:::NBD opts" 52:54:00:12:34:00 \
Harald Hoyer ff2fda
-        "root=nbd:192.168.50.1:raw:::bs=2048 rd.luks=0" || return 1
Harald Hoyer ff2fda
+                "root=nbd:192.168.50.1:raw:::bs=2048 rd.luks=0" || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD root=nbd:IP:port:fstype::NBD opts" 52:54:00:12:34:00 \
Harald Hoyer ff2fda
-        "root=nbd:192.168.50.1:raw:ext2::bs=2048 rd.luks=0" ext2 || return 1
Harald Hoyer ff2fda
+                "root=nbd:192.168.50.1:raw:ext2::bs=2048 rd.luks=0" ext2 || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD root=nbd:IP:port:fstype:fsopts:NBD opts" \
Harald Hoyer ff2fda
-        52:54:00:12:34:00 \
Harald Hoyer ff2fda
-        "root=nbd:192.168.50.1:raw:ext2:errors=panic:bs=2048 rd.luks=0" \
Harald Hoyer ff2fda
-        ext2 errors=panic || return 1
Harald Hoyer ff2fda
+                52:54:00:12:34:00 \
Harald Hoyer ff2fda
+                "root=nbd:192.168.50.1:raw:ext2:errors=panic:bs=2048 rd.luks=0" \
Harald Hoyer ff2fda
+                ext2 errors=panic || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     # DHCP root-path parsing
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD root=dhcp DHCP root-path nbd:srv:port" 52:54:00:12:34:01 \
Harald Hoyer ff2fda
-        "root=dhcp rd.luks=0" || return 1
Harald Hoyer ff2fda
+                "root=dhcp rd.luks=0" || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD Bridge root=dhcp DHCP root-path nbd:srv:port" 52:54:00:12:34:01 \
Harald Hoyer ff2fda
-        "root=dhcp bridge rd.luks=0" || return 1
Harald Hoyer ff2fda
+                "root=dhcp bridge rd.luks=0" || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD root=dhcp DHCP root-path nbd:srv:port:fstype" \
Harald Hoyer ff2fda
-        52:54:00:12:34:02 "root=dhcp rd.luks=0" ext2 || return 1
Harald Hoyer ff2fda
+                52:54:00:12:34:02 "root=dhcp rd.luks=0" ext2 || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD root=dhcp DHCP root-path nbd:srv:port::fsopts" \
Harald Hoyer ff2fda
-        52:54:00:12:34:03 "root=dhcp rd.luks=0" ext3 errors=panic || return 1
Harald Hoyer ff2fda
+                52:54:00:12:34:03 "root=dhcp rd.luks=0" ext3 errors=panic || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD root=dhcp DHCP root-path nbd:srv:port:fstype:fsopts" \
Harald Hoyer ff2fda
-        52:54:00:12:34:04 "root=dhcp rd.luks=0" ext2 errors=panic || return 1
Harald Hoyer ff2fda
+                52:54:00:12:34:04 "root=dhcp rd.luks=0" ext2 errors=panic || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     # netroot handling
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD netroot=nbd:IP:port" 52:54:00:12:34:00 \
Harald Hoyer ff2fda
-        "netroot=nbd:192.168.50.1:raw rd.luks=0" || return 1
Harald Hoyer ff2fda
+                "netroot=nbd:192.168.50.1:raw rd.luks=0" || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD netroot=dhcp DHCP root-path nbd:srv:port:fstype:fsopts" \
Harald Hoyer ff2fda
-        52:54:00:12:34:04 "netroot=dhcp rd.luks=0" ext2 errors=panic || return 1
Harald Hoyer ff2fda
+                52:54:00:12:34:04 "netroot=dhcp rd.luks=0" ext2 errors=panic || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     # Encrypted root handling via LVM/LUKS over NBD
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     . $TESTDIR/luks.uuid
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     client_test "NBD root=LABEL=dracut netroot=nbd:IP:port" \
Harald Hoyer ff2fda
-        52:54:00:12:34:00 \
Harald Hoyer ff2fda
-        "root=LABEL=dracut rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=nbd:192.168.50.1:encrypted" || return 1
Harald Hoyer ff2fda
+                52:54:00:12:34:00 \
Harald Hoyer ff2fda
+                "root=LABEL=dracut rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=nbd:192.168.50.1:encrypted" || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     # XXX This should be ext2,errors=panic but that doesn't currently
Harald Hoyer ff2fda
     # XXX work when you have a real root= line in addition to netroot=
Harald Hoyer ff2fda
     # XXX How we should work here needs clarification
Harald Hoyer ff2fda
     client_test "NBD root=LABEL=dracut netroot=dhcp (w/ fstype and opts)" \
Harald Hoyer ff2fda
-        52:54:00:12:34:05 \
Harald Hoyer ff2fda
-        "root=LABEL=dracut rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=dhcp" || return 1
Harald Hoyer ff2fda
+                52:54:00:12:34:05 \
Harald Hoyer ff2fda
+                "root=LABEL=dracut rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=dhcp" || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     if [[ -s server.pid ]]; then
Harald Hoyer ff2fda
         sudo kill -TERM $(cat $TESTDIR/server.pid)
Harald Hoyer ff2fda
@@ -197,14 +202,15 @@ make_encrypted_root() {
Harald Hoyer ff2fda
         . $basedir/dracut-init.sh
Harald Hoyer ff2fda
         mkdir -p "$initdir"
Harald Hoyer ff2fda
         (
Harald Hoyer ff2fda
-            cd "$initdir"; mkdir -p dev sys proc etc var/run tmp
Harald Hoyer ff2fda
-            mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
Harald Hoyer ff2fda
+            cd "$initdir"
Harald Hoyer ff2fda
+	    mkdir -p dev sys proc etc var tmp run root usr/bin usr/lib usr/lib64 usr/sbin
Harald Hoyer ff2fda
             for i in bin sbin lib lib64; do
Harald Hoyer ff2fda
                 ln -sfnr usr/$i $i
Harald Hoyer ff2fda
             done
Harald Hoyer ff2fda
+	    ln -s ../run var/run
Harald Hoyer ff2fda
         )
Harald Hoyer ff2fda
         inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
Harald Hoyer ff2fda
-            mount dmesg mkdir cp ping
Harald Hoyer ff2fda
+                      mount dmesg mkdir cp ping
Harald Hoyer ff2fda
         for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
Harald Hoyer ff2fda
             [ -f ${_terminfodir}/l/linux ] && break
Harald Hoyer ff2fda
         done
Harald Hoyer ff2fda
@@ -221,11 +227,12 @@ make_encrypted_root() {
Harald Hoyer ff2fda
         export initdir=$TESTDIR/overlay
Harald Hoyer ff2fda
         . $basedir/dracut-init.sh
Harald Hoyer ff2fda
         (
Harald Hoyer ff2fda
-            cd "$initdir"; mkdir -p dev sys proc etc var/run tmp
Harald Hoyer ff2fda
-            mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
Harald Hoyer ff2fda
+            cd "$initdir"
Harald Hoyer ff2fda
+	    mkdir -p dev sys proc etc tmp var run root usr/bin usr/lib usr/lib64 usr/sbin
Harald Hoyer ff2fda
             for i in bin sbin lib lib64; do
Harald Hoyer ff2fda
                 ln -sfnr usr/$i $i
Harald Hoyer ff2fda
             done
Harald Hoyer ff2fda
+	    ln -s ../run var/run
Harald Hoyer ff2fda
         )
Harald Hoyer ff2fda
         inst_multiple mke2fs poweroff cp umount tune2fs
Harald Hoyer ff2fda
         inst_hook shutdown-emergency 000 ./hard-off.sh
Harald Hoyer ff2fda
@@ -239,10 +246,10 @@ make_encrypted_root() {
Harald Hoyer ff2fda
     # We do it this way so that we do not risk trashing the host mdraid
Harald Hoyer ff2fda
     # devices, volume groups, encrypted partitions, etc.
Harald Hoyer ff2fda
     $basedir/dracut.sh -l -i $TESTDIR/overlay / \
Harald Hoyer ff2fda
-        -m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules" \
Harald Hoyer ff2fda
-        -d "piix ide-gd_mod ata_piix ext2 ext3 sd_mod" \
Harald Hoyer ff2fda
-        --no-hostonly-cmdline -N \
Harald Hoyer ff2fda
-        -f $TESTDIR/initramfs.makeroot $KVERSION || return 1
Harald Hoyer ff2fda
+                       -m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules" \
Harald Hoyer ff2fda
+                       -d "piix ide-gd_mod ata_piix ext2 ext3 sd_mod" \
Harald Hoyer ff2fda
+                       --no-hostonly-cmdline -N \
Harald Hoyer ff2fda
+                       -f $TESTDIR/initramfs.makeroot $KVERSION || return 1
Harald Hoyer ff2fda
     rm -rf -- $TESTDIR/overlay
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     # Invoke KVM and/or QEMU to actually create the target filesystem.
Harald Hoyer ff2fda
@@ -269,14 +276,15 @@ make_client_root() {
Harald Hoyer ff2fda
         . $basedir/dracut-init.sh
Harald Hoyer ff2fda
         mkdir -p "$initdir"
Harald Hoyer ff2fda
         (
Harald Hoyer ff2fda
-            cd "$initdir"; mkdir -p dev sys proc etc var/run tmp
Harald Hoyer ff2fda
-            mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
Harald Hoyer ff2fda
+            cd "$initdir"
Harald Hoyer ff2fda
+	    mkdir -p dev sys proc etc var tmp run root usr/bin usr/lib usr/lib64 usr/sbin
Harald Hoyer ff2fda
             for i in bin sbin lib lib64; do
Harald Hoyer ff2fda
                 ln -sfnr usr/$i $i
Harald Hoyer ff2fda
             done
Harald Hoyer ff2fda
+	    ln -s ../run var/run
Harald Hoyer ff2fda
         )
Harald Hoyer ff2fda
         inst_multiple sh ls shutdown poweroff stty cat ps ln ip \
Harald Hoyer ff2fda
-            dmesg mkdir cp ping
Harald Hoyer ff2fda
+                      dmesg mkdir cp ping
Harald Hoyer ff2fda
         for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
Harald Hoyer ff2fda
             [ -f ${_terminfodir}/l/linux ] && break
Harald Hoyer ff2fda
         done
Harald Hoyer ff2fda
@@ -311,7 +319,8 @@ make_server_root() {
Harald Hoyer ff2fda
         mkdir -p "$initdir"
Harald Hoyer ff2fda
         (
Harald Hoyer ff2fda
             cd "$initdir";
Harald Hoyer ff2fda
-            mkdir -p dev sys proc etc var/run var/lib/dhcpd tmp etc/nbd-server
Harald Hoyer ff2fda
+            mkdir -p run dev sys proc etc var var/lib/dhcpd tmp etc/nbd-server
Harald Hoyer ff2fda
+	    ln -s ../run var/run
Harald Hoyer ff2fda
         )
Harald Hoyer ff2fda
         cat > "$initdir/etc/nbd-server/config" <
Harald Hoyer ff2fda
 [generic]
Harald Hoyer ff2fda
@@ -323,8 +332,8 @@ exportname = /dev/sdc
Harald Hoyer ff2fda
 port = 2001
Harald Hoyer ff2fda
 EOF
Harald Hoyer ff2fda
         inst_multiple sh ls shutdown poweroff stty cat ps ln ip \
Harald Hoyer ff2fda
-            dmesg mkdir cp ping grep \
Harald Hoyer ff2fda
-            sleep nbd-server chmod modprobe vi
Harald Hoyer ff2fda
+                      dmesg mkdir cp ping grep \
Harald Hoyer ff2fda
+                      sleep nbd-server chmod modprobe vi
Harald Hoyer ff2fda
         for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
Harald Hoyer ff2fda
             [ -f ${_terminfodir}/l/linux ] && break
Harald Hoyer ff2fda
         done
Harald Hoyer ff2fda
@@ -369,9 +378,9 @@ test_setup() {
Harald Hoyer ff2fda
         inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
Harald Hoyer ff2fda
         inst ./cryptroot-ask.sh /sbin/cryptroot-ask
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
-#        inst ./debug-shell.service /lib/systemd/system/debug-shell.service
Harald Hoyer ff2fda
-#        mkdir -p "${initdir}/lib/systemd/system/sysinit.target.wants"
Harald Hoyer ff2fda
-#        ln -fs ../debug-shell.service "${initdir}/lib/systemd/system/sysinit.target.wants/debug-shell.service"
Harald Hoyer ff2fda
+        #        inst ./debug-shell.service /lib/systemd/system/debug-shell.service
Harald Hoyer ff2fda
+        #        mkdir -p "${initdir}/lib/systemd/system/sysinit.target.wants"
Harald Hoyer ff2fda
+        #        ln -fs ../debug-shell.service "${initdir}/lib/systemd/system/sysinit.target.wants/debug-shell.service"
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
         . $TESTDIR/luks.uuid
Harald Hoyer ff2fda
         mkdir -p $initdir/etc
Harald Hoyer ff2fda
@@ -380,17 +389,17 @@ test_setup() {
Harald Hoyer ff2fda
     )
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
Harald Hoyer ff2fda
-        -m "dash udev-rules rootfs-block fs-lib base debug kernel-modules" \
Harald Hoyer ff2fda
-        -d "af_packet piix ide-gd_mod ata_piix ext2 ext3 sd_mod e1000" \
Harald Hoyer ff2fda
-        --no-hostonly-cmdline -N \
Harald Hoyer ff2fda
-        -f $TESTDIR/initramfs.server $KVERSION || return 1
Harald Hoyer ff2fda
+         -m "dash udev-rules rootfs-block fs-lib base debug kernel-modules" \
Harald Hoyer ff2fda
+         -d "af_packet piix ide-gd_mod ata_piix ext2 ext3 sd_mod e1000" \
Harald Hoyer ff2fda
+         --no-hostonly-cmdline -N \
Harald Hoyer ff2fda
+         -f $TESTDIR/initramfs.server $KVERSION || return 1
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
     sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
Harald Hoyer ff2fda
-        -o "plymouth" \
Harald Hoyer ff2fda
-        -a "debug watchdog" \
Harald Hoyer ff2fda
-        -d "af_packet piix ide-gd_mod ata_piix ext2 ext3 sd_mod e1000 i6300esb ib700wdt" \
Harald Hoyer ff2fda
-        --no-hostonly-cmdline -N \
Harald Hoyer ff2fda
-        -f $TESTDIR/initramfs.testing $KVERSION || return 1
Harald Hoyer ff2fda
+         -o "plymouth" \
Harald Hoyer ff2fda
+         -a "debug watchdog" \
Harald Hoyer ff2fda
+         -d "af_packet piix ide-gd_mod ata_piix ext2 ext3 sd_mod e1000 i6300esb ib700wdt" \
Harald Hoyer ff2fda
+         --no-hostonly-cmdline -N \
Harald Hoyer ff2fda
+         -f $TESTDIR/initramfs.testing $KVERSION || return 1
Harald Hoyer ff2fda
 }
Harald Hoyer ff2fda
 
Harald Hoyer ff2fda
 kill_server() {
Harald Hoyer ff2fda