summaryrefslogtreecommitdiffstats
path: root/test/TEST-20-NFS/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/TEST-20-NFS/test.sh')
-rwxr-xr-xtest/TEST-20-NFS/test.sh43
1 files changed, 22 insertions, 21 deletions
diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh
index b7cca75..1be5a73 100755
--- a/test/TEST-20-NFS/test.sh
+++ b/test/TEST-20-NFS/test.sh
@@ -3,9 +3,13 @@
# shellcheck disable=SC2034
TEST_DESCRIPTION="root filesystem on NFS with $USE_NETWORK"
+test_check() {
+ command -v exportfs &> /dev/null
+}
+
# Uncomment this to debug failures
#DEBUGFAIL="rd.debug loglevel=7 rd.break=initqueue rd.shell"
-SERVER_DEBUG="rd.debug loglevel=7"
+#SERVER_DEBUG="rd.debug loglevel=7"
#SERIAL="unix:/tmp/server.sock"
run_server() {
@@ -14,14 +18,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 0 1
+ qemu_add_drive disk_index disk_args "$TESTDIR"/server.img root 0 1
"$testdir"/run-qemu \
"${disk_args[@]}" \
-net socket,listen=127.0.0.1:12320 \
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \
-serial "${SERIAL:-"file:$TESTDIR/server.log"}" \
- -device i6300esb -watchdog-action poweroff \
-append "panic=1 oops=panic softlockup_panic=1 root=LABEL=dracut rootfstype=ext4 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \
-initrd "$TESTDIR"/initramfs.server \
-pidfile "$TESTDIR"/server.pid -daemonize || return 1
@@ -55,16 +58,15 @@ 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 1
- qemu_add_drive_args disk_index disk_args "$TESTDIR"/marker2.img marker2 1
+ qemu_add_drive disk_index disk_args "$TESTDIR"/marker.img marker 1
+ qemu_add_drive disk_index disk_args "$TESTDIR"/marker2.img marker2 1
cmdline="$cmdline rd.net.timeout.dhcp=30"
"$testdir"/run-qemu \
"${disk_args[@]}" \
-net nic,macaddr="$mac",model=e1000 \
-net socket,connect=127.0.0.1:12320 \
- -device i6300esb -watchdog-action poweroff \
- -append "panic=1 oops=panic softlockup_panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.retry=10 quiet ro console=ttyS0,115200n81 selinux=0" \
+ -append "$cmdline ro" \
-initrd "$TESTDIR"/initramfs.testing
# shellcheck disable=SC2181
@@ -213,8 +215,9 @@ test_run() {
return 1
fi
- test_nfsv3 \
- && test_nfsv4
+ # focus on NFSv4 testing, disable NFSv3 tests
+ #test_nfsv3
+ test_nfsv4
ret=$?
@@ -247,7 +250,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
@@ -307,7 +310,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
@@ -318,7 +321,7 @@ test_setup() {
inst_simple "${PKGLIBDIR}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
inst_simple "${PKGLIBDIR}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"
inst_simple "${PKGLIBDIR}/modules.d/45url-lib/url-lib.sh" "/lib/url-lib.sh"
- inst_simple "${PKGLIBDIR}/modules.d/40network/net-lib.sh" "/lib/net-lib.sh"
+ inst_simple "${PKGLIBDIR}/modules.d/45net-lib/net-lib.sh" "/lib/net-lib.sh"
inst_simple "${PKGLIBDIR}/modules.d/95nfs/nfs-lib.sh" "/lib/nfs-lib.sh"
inst_binary "${PKGLIBDIR}/dracut-util" "/usr/bin/dracut-util"
ln -s dracut-util "${initdir}/usr/bin/dracut-getarg"
@@ -354,7 +357,7 @@ test_setup() {
export initdir=$TESTDIR/server/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
)
@@ -373,8 +376,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 80
+ qemu_add_drive disk_index disk_args "$TESTDIR"/marker.img marker 1
+ qemu_add_drive disk_index disk_args "$TESTDIR"/server.img root 160
# Invoke KVM and/or QEMU to actually create the target filesystem.
"$testdir"/run-qemu \
@@ -398,11 +401,9 @@ test_setup() {
)
# Make client's dracut image
- "$DRACUT" -l -i "$TESTDIR"/overlay / \
- -o "plymouth" \
- -a "dmsquash-live debug watchdog ${USE_NETWORK}" \
- --no-hostonly-cmdline -N \
- -f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1
+ test_dracut \
+ -a "dmsquash-live ${USE_NETWORK}" \
+ "$TESTDIR"/initramfs.testing
(
# shellcheck disable=SC2031
@@ -415,7 +416,7 @@ test_setup() {
)
# Make server's dracut image
"$DRACUT" -l -i "$TESTDIR"/overlay / \
- -m "bash rootfs-block debug kernel-modules watchdog qemu network network-legacy" \
+ -m "bash rootfs-block debug kernel-modules watchdog qemu network-legacy" \
-d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod e1000 i6300esb" \
--no-hostonly-cmdline -N \
-f "$TESTDIR"/initramfs.server "$KVERSION" || return 1