3 # Check that the CTDB version consistency checking operates correctly
5 . "${TEST_SCRIPTS_DIR}/integration.bash"
9 ctdb_test_skip_on_cluster
15 try_command_on_node -v "$test_node" ctdb version
18 major="${version%%.*}"
22 echo "Node ${test_node} has version ${major}.${minor}"
24 # Unchanged version - this should work
25 export CTDB_TEST_SAMBA_VERSION=$(( (major << 16) | minor ))
26 printf '\nRestarting node %d with CTDB_TEST_SAMBA_VERSION=0x%08x\n' \
28 "$CTDB_TEST_SAMBA_VERSION"
29 ctdb_nodes_restart "$test_node"
31 echo "GOOD: ctdbd restarted successfully on node ${test_node}"
33 d="$CTDB_SCRIPTS_HELPER_BINDIR"
34 try_command_on_node "$test_node" "${d}/ctdb-path" "pidfile" "ctdbd"
37 # Changed major version - this should fail
38 export CTDB_TEST_SAMBA_VERSION=$(( ((major + 1) << 16) | minor ))
39 printf '\nRestarting node %d with CTDB_TEST_SAMBA_VERSION=0x%08x\n' \
41 "$CTDB_TEST_SAMBA_VERSION"
42 ctdb_nodes_restart "$test_node"
43 echo "Will use PID file ${pidfile} to check for ctdbd exit"
44 wait_until 30 ! test -f "$pidfile"
45 echo "GOOD: ctdbd exited early on node ${test_node}"
47 # Changed minor version - this should fail
48 export CTDB_TEST_SAMBA_VERSION=$(( (major << 16) | (minor + 1) ))
49 printf '\nRestarting node %d with CTDB_TEST_SAMBA_VERSION=0x%08x\n' \
51 "$CTDB_TEST_SAMBA_VERSION"
52 ctdb_nodes_start "$test_node"
53 echo "Will use PID file ${pidfile} to check for ctdbd exit"
54 wait_until 30 ! test -f "$pidfile"
55 echo "GOOD: ctdbd exited early on node ${test_node}"