summaryrefslogtreecommitdiffstats
path: root/test/TEST-40-NBD/test.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:33:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:33:11 +0000
commit203af7302854f453fa4a05ecefd4403b6c8a4f8d (patch)
tree967fdacafe332baabd12b57725505c138d0f3bbf /test/TEST-40-NBD/test.sh
parentAdding upstream version 102. (diff)
downloaddracut-203af7302854f453fa4a05ecefd4403b6c8a4f8d.tar.xz
dracut-203af7302854f453fa4a05ecefd4403b6c8a4f8d.zip
Adding upstream version 103.upstream/103upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/TEST-40-NBD/test.sh')
-rwxr-xr-xtest/TEST-40-NBD/test.sh42
1 files changed, 21 insertions, 21 deletions
diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh
index e935f53..a8efabe 100755
--- a/test/TEST-40-NBD/test.sh
+++ b/test/TEST-40-NBD/test.sh
@@ -37,7 +37,7 @@ run_server() {
-serial "${SERIAL:-"file:$TESTDIR/server.log"}" \
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \
-net socket,listen=127.0.0.1:12340 \
- -append "panic=1 oops=panic softlockup_panic=1 rd.luks=0 systemd.crash_reboot quiet root=/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_serverroot rootfstype=ext4 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \
+ -append "panic=1 oops=panic softlockup_panic=1 rd.luks=0 systemd.crash_reboot quiet root=/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_serverroot rootfstype=ext4 rw console=ttyS0,115200n81 $SERVER_DEBUG" \
-initrd "$TESTDIR"/initramfs.server \
-pidfile "$TESTDIR"/server.pid -daemonize || return 1
chmod 644 "$TESTDIR"/server.pid || return 1
@@ -80,11 +80,11 @@ client_test() {
"${disk_args[@]}" \
-net nic,macaddr="$mac",model=e1000 \
-net socket,connect=127.0.0.1:12340 \
- -append "$cmdline rd.auto ro" \
+ -append "$cmdline rd.auto ro console=ttyS0,115200n81" \
-initrd "$TESTDIR"/initramfs.testing
# shellcheck disable=SC2181
- if [[ $? -ne 0 ]] || ! test_marker_check nbd-OK "$TESTDIR"/marker.img; then
+ if [[ $? -ne 0 ]] || ! test_marker_check nbd-OK; then
echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]"
return 1
fi
@@ -120,7 +120,9 @@ test_run() {
return 1
fi
client_run
+ local res="$?"
kill_server
+ return "$res"
}
client_run() {
@@ -145,23 +147,22 @@ client_run() {
client_test "NBD root=/dev/root netroot=dhcp DHCP root-path nbd:srv:port" 52:54:00:12:34:01 \
"root=/dev/root netroot=dhcp ip=dhcp rd.luks=0" || return 1
- client_test "NBD root=/dev/root netroot=dhcp DHCP root-path nbd:srv:port:fstype" \
- 52:54:00:12:34:02 "root=/dev/root netroot=dhcp ip=dhcp rd.luks=0" ext2 || return 1
+ # BROKEN
+ #client_test "NBD root=/dev/root netroot=dhcp DHCP root-path nbd:srv:port:fstype" \
+ # 52:54:00:12:34:02 "root=/dev/root netroot=dhcp ip=dhcp rd.luks=0" ext2 || return 1
client_test "NBD root=/dev/root netroot=dhcp DHCP root-path nbd:srv:port::fsopts" \
52:54:00:12:34:03 "root=/dev/root netroot=dhcp ip=dhcp rd.luks=0" ext4 errors=panic || return 1
- client_test "NBD root=/dev/root netroot=dhcp DHCP root-path nbd:srv:port:fstype:fsopts" \
- 52:54:00:12:34:04 "root=/dev/root netroot=dhcp ip=dhcp rd.luks=0" ext2 errors=panic || return 1
+ # BROKEN
+ #client_test "NBD root=/dev/root netroot=dhcp DHCP root-path nbd:srv:port:fstype:fsopts" \
+ # 52:54:00:12:34:04 "root=/dev/root netroot=dhcp ip=dhcp rd.luks=0" ext2 errors=panic || return 1
# netroot handling
client_test "NBD netroot=nbd:IP:port" 52:54:00:12:34:00 \
"root=LABEL=dracut netroot=nbd:192.168.50.1:raw ip=dhcp rd.luks=0" || return 1
- client_test "NBD root=/dev/root netroot=dhcp DHCP root-path nbd:srv:port:fstype:fsopts" \
- 52:54:00:12:34:04 "root=/dev/root netroot=dhcp ip=dhcp rd.luks=0" ext2 errors=panic || return 1
-
# Encrypted root handling via LVM/LUKS over NBD
# shellcheck source=$TESTDIR/luks.uuid
@@ -203,7 +204,8 @@ make_encrypted_root() {
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot crypt lvm mdraid" \
+ -a "test-makeroot crypt lvm mdraid" \
+ -I "cryptsetup" \
-i ./create-encrypted-root.sh /lib/dracut/hooks/initqueue/01-create-encrypted-root.sh \
--no-hostonly-cmdline -N \
-f "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1
@@ -217,7 +219,7 @@ make_encrypted_root() {
# Invoke KVM and/or QEMU to actually create the target filesystem.
"$testdir"/run-qemu \
"${disk_args[@]}" \
- -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \
+ -append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81" \
-initrd "$TESTDIR"/initramfs.makeroot || return 1
test_marker_check dracut-root-block-created || return 1
grep -F -a -m 1 ID_FS_UUID "$TESTDIR"/marker.img > "$TESTDIR"/luks.uuid
@@ -240,7 +242,7 @@ make_client_root() {
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot" \
+ -a "test-makeroot" \
-i ./create-client-root.sh /lib/dracut/hooks/initqueue/01-create-client-root.sh \
--nomdadmconf \
--no-hostonly-cmdline -N \
@@ -254,7 +256,7 @@ make_client_root() {
# Invoke KVM and/or QEMU to actually create the target filesystem.
"$testdir"/run-qemu \
"${disk_args[@]}" \
- -append "root=/dev/dracut/root rw rootfstype=ext4 quiet console=ttyS0,115200n81 selinux=0" \
+ -append "root=/dev/dracut/root rw rootfstype=ext4 quiet console=ttyS0,115200n81" \
-initrd "$TESTDIR"/initramfs.makeroot || return 1
test_marker_check dracut-root-block-created || return 1
rm -fr "$TESTDIR"/overlay
@@ -276,14 +278,12 @@ bs = 4096
EOF
"$DRACUT" -l --keep --tmpdir "$TESTDIR" \
- -m "test-root network-legacy" \
- -d "nfsd sunrpc ipv6 lockd af_packet 8021q ipvlan macvlan" \
+ -a "test-root ${USE_NETWORK}" \
-I "ip grep sleep nbd-server chmod modprobe vi pidof" \
-i "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" \
-i "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" \
--install-optional "/etc/netconfig dhcpd /etc/group /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/services /usr/etc/nsswitch.conf /usr/etc/rpc /usr/etc/protocols /usr/etc/services" \
-i /tmp/config /etc/nbd-server/config \
- -i "./hosts" "/etc/hosts" \
-i "./dhcpd.conf" "/etc/dhcpd.conf" \
--no-hostonly --no-hostonly-cmdline --nohardlink \
-f "$TESTDIR"/initramfs.root "$KVERSION" || return 1
@@ -297,7 +297,7 @@ EOF
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -m "test-makeroot" \
+ -a "test-makeroot ${USE_NETWORK}" \
-i ./create-server-root.sh /lib/dracut/hooks/initqueue/01-create-server-root.sh \
--nomdadmconf \
--no-hostonly-cmdline -N \
@@ -306,12 +306,12 @@ EOF
declare -a disk_args=()
declare -i disk_index=0
qemu_add_drive disk_index disk_args "$TESTDIR"/marker.img marker 1
- qemu_add_drive disk_index disk_args "$TESTDIR"/server.img root 240
+ qemu_add_drive disk_index disk_args "$TESTDIR"/server.img root 480
# Invoke KVM and/or QEMU to actually create the target filesystem.
"$testdir"/run-qemu \
"${disk_args[@]}" \
- -append "root=/dev/dracut/root rw rootfstype=ext4 quiet console=ttyS0,115200n81 selinux=0" \
+ -append "root=/dev/dracut/root rw rootfstype=ext4 quiet console=ttyS0,115200n81" \
-initrd "$TESTDIR"/initramfs.makeroot || return 1
test_marker_check dracut-root-block-created || return 1
rm -fr "$TESTDIR"/overlay
@@ -340,7 +340,7 @@ test_setup() {
"$TESTDIR"/initramfs.testing
"$DRACUT" -N -l -i "$TESTDIR"/overlay / \
- -a "test rootfs-block debug kernel-modules network-legacy" \
+ -a "test rootfs-block debug kernel-modules ${USE_NETWORK}" \
-d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod e1000 drbg" \
-i "./server.link" "/etc/systemd/network/01-server.link" \
-i "./wait-if-server.sh" "/lib/dracut/hooks/pre-mount/99-wait-if-server.sh" \