6 Verify that a file created on a node is readable via NFS after a failover.
8 We write a file into an exported directory on a node, mount the NFS
9 share from a node, verify that we can read the file via NFS and that
10 we can still read it after a failover.
14 * An active CTDB cluster with at least 2 nodes with public addresses.
16 * Test must be run on a real or virtual cluster rather than against
19 * Test must not be run from a cluster node.
23 1. Verify that the cluster is healthy.
24 2. Select a public address and its corresponding node.
25 3. Select the 1st NFS share exported on the node.
26 4. Write a file into exported directory on the node and calculate its
28 5. Mount the selected NFS share.
29 6. Read the file via the NFS mount and calculate its checksum.
31 8. Disable the selected node.
32 9. Read the file via NFS and calculate its checksum.
33 10. Compare the checksums.
37 * Checksums for the file on all 3 occasions should be the same.
41 .
"${TEST_SCRIPTS_DIR}/integration.bash"
47 ctdb_test_check_real_cluster
52 ctdb_restart_when_done
56 echo "Create file containing random data..."
58 ctdb_test_exit_hook_add
rm -f "$local_f"
59 dd if=/dev
/urandom of
=$local_f bs
=1k count
=1
60 local_sum
=$
(sum $local_f)
62 scp
-p "$local_f" "[${test_ip}]:${nfs_remote_file}"
63 try_command_on_node
$test_node "chmod 644 $nfs_remote_file"
65 nfs_sum
=$
(sum $nfs_local_file)
67 if [ "$local_sum" = "$nfs_sum" ] ; then
68 echo "GOOD: file contents read correctly via NFS"
70 echo "BAD: file contents are different over NFS"
71 echo " original file: $local_sum"
72 echo " NFS file: $nfs_sum"
78 echo "Disabling node $test_node"
79 try_command_on_node
0 $CTDB disable
-n $test_node
80 wait_until_node_has_status
$test_node disabled
82 gratarp_sniff_wait_show
84 new_sum
=$
(sum $nfs_local_file)
87 if [ "$nfs_sum" = "$new_sum" ] ; then
88 echo "GOOD: file contents unchanged after failover"
90 echo "BAD: file contents are different after failover"
91 echo " original file: $nfs_sum"
92 echo " NFS file: $new_sum"