diff options
author | Martin Schwenke <martin@meltin.net> | 2019-09-05 16:15:54 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2019-09-17 04:35:26 +0000 |
commit | 284bbca7c730235dd2df9ec2acbfc5fa6de5be42 (patch) | |
tree | 92b4032812c895bdb812d3329a97fb1f090ab1d1 /ctdb | |
parent | 2c6b098c7220a3e6d78f6040c912fc22a02f6e46 (diff) | |
download | samba-284bbca7c730235dd2df9ec2acbfc5fa6de5be42.tar.gz |
ctdb-tests: Move NFS test functions to complex local script
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/tests/complex/scripts/local.bash | 32 | ||||
-rw-r--r-- | ctdb/tests/scripts/integration.bash | 32 |
2 files changed, 32 insertions, 32 deletions
diff --git a/ctdb/tests/complex/scripts/local.bash b/ctdb/tests/complex/scripts/local.bash index 787f597edcc..20b3ba706b5 100644 --- a/ctdb/tests/complex/scripts/local.bash +++ b/ctdb/tests/complex/scripts/local.bash @@ -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" +} diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash index 284449d4503..0aaede98e8a 100644 --- a/ctdb/tests/scripts/integration.bash +++ b/ctdb/tests/scripts/integration.bash @@ -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 () { |