libsmb,s3/smbd: dump SMB3+ session keys if debug parm is set
[Samba.git] / ctdb / tests / simple / 20_delip_iface_gc.sh
blob6cc39580c5eb43edd2703d34744990a7bc90fa35
1 #!/bin/bash
3 test_info()
5 cat <<EOF
6 Verify that an interface is deleted when all IPs on it are deleted.
7 EOF
10 . "${TEST_SCRIPTS_DIR}/integration.bash"
12 ctdb_test_init
14 set -e
16 cluster_is_healthy
18 select_test_node_and_ips
20 # Find interfaces on test node
21 try_command_on_node $test_node "$CTDB ifaces -X"
22 ifaces=$(awk -F'|' 'NR > 1 { print $2 }' <<<"$out")
23 echo "Node ${test_node} has interfaces: ${ifaces}"
25 # Delete all IPs on each interface... deleting IPs from one interface
26 # can cause other interfaces to disappear, so we need to be careful...
27 for i in $ifaces ; do
28 try_command_on_node $test_node "$CTDB ifaces -X"
29 info=$(awk -F'|' -v iface="$i" '$2 == iface { print $0 }' <<<"$out")
31 if [ -z "$info" ] ; then
32 echo "Interface ${i} missing... assuming already deleted!"
33 continue
36 echo "Deleting IPs on interface ${i}, with this information:"
37 echo " $info"
39 try_command_on_node $test_node "$CTDB ip -v -X | tail -n +2"
40 awk -F'|' -v i="$i" \
41 '$6 == i { print $2 }' <<<"$out" |
42 while read ip ; do
43 echo " $ip"
44 try_command_on_node $test_node "$CTDB delip $ip"
45 done
46 try_command_on_node $test_node "$CTDB ipreallocate"
48 try_command_on_node $test_node "$CTDB ifaces -X"
49 info=$(awk -F'|' -v iface="$i" '$2 == iface { print $0 }' <<<"$out")
51 if [ -z "$info" ] ; then
52 echo "GOOD: Interface ${i} has been garbage collected"
53 else
54 echo "BAD: Interface ${i} still exists"
55 echo "$out"
56 exit 1
58 done