]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Move NFS test functions to complex local script
authorMartin Schwenke <martin@meltin.net>
Thu, 5 Sep 2019 06:15:54 +0000 (16:15 +1000)
committerAmitay Isaacs <amitay@samba.org>
Tue, 17 Sep 2019 04:35:26 +0000 (04:35 +0000)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/complex/scripts/local.bash
ctdb/tests/scripts/integration.bash

index 787f597edcc419cc600e771e449879763a3c28e8..20b3ba706b5a6b56e900f2cc4e9bdd8c01c19588 100644 (file)
@@ -270,3 +270,35 @@ ping_wrapper ()
        *)   ping  "$@"   ;;
     esac
 }
+
+#######################################
+
+nfs_test_setup ()
+{
+    select_test_node_and_ips
+
+    nfs_first_export=$(showmount -e $test_ip | sed -n -e '2s/ .*//p')
+
+    echo "Creating test subdirectory..."
+    try_command_on_node $test_node "TMPDIR=$nfs_first_export mktemp -d"
+    nfs_test_dir="$out"
+    try_command_on_node $test_node "chmod 777 $nfs_test_dir"
+
+    nfs_mnt_d=$(mktemp -d)
+    nfs_local_file="${nfs_mnt_d}/${nfs_test_dir##*/}/TEST_FILE"
+    nfs_remote_file="${nfs_test_dir}/TEST_FILE"
+
+    ctdb_test_exit_hook_add nfs_test_cleanup
+
+    echo "Mounting ${test_ip}:${nfs_first_export} on ${nfs_mnt_d} ..."
+    mount -o timeo=1,hard,intr,vers=3 \
+       "[${test_ip}]:${nfs_first_export}" ${nfs_mnt_d}
+}
+
+nfs_test_cleanup ()
+{
+    rm -f "$nfs_local_file"
+    umount -f "$nfs_mnt_d"
+    rmdir "$nfs_mnt_d"
+    onnode -q $test_node rmdir "$nfs_test_dir"
+}
index 284449d4503c11536dda8696137cdec2f84a3f01..0aaede98e8aacf30e4a438cce375000abc878108 100644 (file)
@@ -619,38 +619,6 @@ _ctdb_scriptstatus_changed ()
 
 #######################################
 
-nfs_test_setup ()
-{
-    select_test_node_and_ips
-
-    nfs_first_export=$(showmount -e $test_ip | sed -n -e '2s/ .*//p')
-
-    echo "Creating test subdirectory..."
-    try_command_on_node $test_node "TMPDIR=$nfs_first_export mktemp -d"
-    nfs_test_dir="$out"
-    try_command_on_node $test_node "chmod 777 $nfs_test_dir"
-
-    nfs_mnt_d=$(mktemp -d)
-    nfs_local_file="${nfs_mnt_d}/${nfs_test_dir##*/}/TEST_FILE"
-    nfs_remote_file="${nfs_test_dir}/TEST_FILE"
-
-    ctdb_test_exit_hook_add nfs_test_cleanup
-
-    echo "Mounting ${test_ip}:${nfs_first_export} on ${nfs_mnt_d} ..."
-    mount -o timeo=1,hard,intr,vers=3 \
-       "[${test_ip}]:${nfs_first_export}" ${nfs_mnt_d}
-}
-
-nfs_test_cleanup ()
-{
-    rm -f "$nfs_local_file"
-    umount -f "$nfs_mnt_d"
-    rmdir "$nfs_mnt_d"
-    onnode -q $test_node rmdir "$nfs_test_dir"
-}
-
-#######################################
-
 # If the given IP is hosted then print 2 items: maskbits and iface
 ip_maskbits_iface ()
 {