From bb4fdf6edb5711b3b4b293aeb11e61eb43c54470 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Wed, 18 May 2022 09:28:22 -0500 Subject: [PATCH] EX-5260 pumount: test pumount with MDT0000 unmounted Add tests (40a-40c, 41a) to verify that pumount can unmount a client mount point with MDT0000 and OST0000 unmounted. Add a test (34a) that pumount does not kill processes who are minding their own business on other Lustre client mount points. Test-Parameters: testlist=sanity-pumount,sanity-pumount,sanity-pumount clientextra_install_params="--packages pumount" Signed-off-by: John L. Hammond Change-Id: I02b603d1c6de9f10605d3e315d5149de72698e73 Reviewed-on: https://review.whamcloud.com/47389 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Andreas Dilger --- lustre/tests/sanity-pumount.sh | 74 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/lustre/tests/sanity-pumount.sh b/lustre/tests/sanity-pumount.sh index 54b98dd..e3680bc 100755 --- a/lustre/tests/sanity-pumount.sh +++ b/lustre/tests/sanity-pumount.sh @@ -165,7 +165,7 @@ function kill_wait_signaled() { local sig_to_expect=$3 local status - # Send sig_to_send to PID but chekc that it already terminated by sig_to_expect. + # Send sig_to_send to PID but check that it already terminated by sig_to_expect. kill "-${sig_to_send}" "${pid}" # May fail. wait "$pid" status=$? @@ -464,6 +464,78 @@ test_33a() { } run_test 33a "pumount works on CWDs" +test_34a() { + local file=$DIR2/$tfile + local pid + + init_pumount_env + + /usr/bin/sleep $SLEEP_TIME > "$file" & + pid=$! + wait_for_exec "$pid" /usr/bin/sleep + + pumount "$MOUNT1" || error "pumount failed" + # pumount would send SIGKILL, we send and expect SIGUSR2. + kill_wait_signaled $pid $SIGUSR2 $SIGUSR2 + check_unmount_complete "$MOUNT1" +} +run_test 34a "pumount does not kill processes on other mount points" + +test_40a() { + init_pumount_env + + stop mds1 || error "cannot stop mds1" + pumount "$MOUNT1" || error "pumount failed" + check_unmount_complete "$MOUNT1" + start mds1 $(mdsdevname 1) || error "cannot start mds1" +} +run_test 40a "pumount works wih MDT0000 unmounted" + +test_40b() { + init_pumount_env + ls -al "$MOUNT1" "$MOUNT1" "$MOUNT1" + + stop mds1 || error "cannot stop mds1" + pumount "$MOUNT1" || error "pumount failed" + check_unmount_complete "$MOUNT1" + start mds1 $(mdsdevname 1) || error "cannot start mds1" +} +run_test 40b "pumount works wih MDT0000 unmounted (2)" + +test_40c() { + local file=$DIR/$tfile + local instance + local pid + + init_pumount_env + + instance=$($LFS getname --instance "$MOUNT1") + lctl set_param "*.*-${instance}.allow_intr=1" + + /usr/bin/sleep $SLEEP_TIME > "$file" & + pid=$! + wait_for_exec "$pid" /usr/bin/sleep + + stop mds1 || error "cannot stop mds1" + pumount "$MOUNT1" || error "pumount failed" + check_unmount_complete "$MOUNT1" + wait $pid + start mds1 $(mdsdevname 1) || error "cannot start mds1" +} +run_test 40c "pumount works wih MDT0000 unmounted (3)" + +test_41a() { + local pid + + init_pumount_env + + stop ost1 || error "cannot stop ost1" + pumount "$MOUNT1" || error "pumount failed" + check_unmount_complete "$MOUNT1" + start ost1 $(ostdevname 1) || error "cannot start ost1" +} +run_test 41a "pumount works wih OST0000 unmounted" + # TODO run_test XX "pumount works with a chroot" test_50a() { -- 1.8.3.1