6 Verify that a mounted NFS share is still operational after failover.
8 We mount an NFS share from a node, write a file via NFS and then
9 confirm that we can correctly read the file after a failover.
13 * An active CTDB cluster with at least 2 nodes with public addresses.
15 * Test must be run on a real or virtual cluster rather than against
18 * Test must not be run from a cluster node.
22 1. Verify that the cluster is healthy.
23 2. Select a public address and its corresponding node.
24 3. Select the 1st NFS share exported on the node.
25 4. Mount the selected NFS share.
26 5. Create a file in the NFS mount and calculate its checksum.
27 6. Kill CTDB on the selected node.
28 7. Read the file and calculate its checksum.
29 8. Compare the checksums.
33 * When a node is disabled the public address fails over and it is
34 possible to correctly read a file over NFS. The checksums should be
35 the same before and after.
39 .
"${TEST_SCRIPTS_DIR}/integration.bash"
45 ctdb_test_check_real_cluster
50 ctdb_restart_when_done
54 echo "Create file containing random data..."
55 dd if=/dev
/urandom of
=$nfs_local_file bs
=1k count
=1
56 original_sum
=$
(sum $nfs_local_file)
61 echo "Killing node $test_node"
62 try_command_on_node
$test_node $CTDB getpid
64 try_command_on_node
$test_node kill -9 $pid
65 wait_until_node_has_status
$test_node disconnected
67 gratarp_sniff_wait_show
69 new_sum
=$
(sum $nfs_local_file)
72 if [ "$original_md5" = "$new_md5" ] ; then
73 echo "GOOD: file contents unchanged after failover"
75 echo "BAD: file contents are different after failover"