6 Verify that an interface is deleted when all IPs on it are deleted.
10 .
"${TEST_SCRIPTS_DIR}/integration.bash"
19 ctdb_restart_when_done
21 echo "Getting public IPs information..."
22 try_command_on_node
-v any
"$CTDB ip -v -n all -Y | tail -n +2"
25 # Select the first node and find out its interfaces
26 test_node
=$
(awk -F: 'NR == 1 { print $3}' <<<"$ip_info")
27 ifaces
=$
(awk -F: -v tn
=$test_node '$3 == tn { print $6 }' <<<"$ip_info" |
sed 's@, @ @g' |
xargs -n 1 |
sort -u)
28 echo "Selected test node ${test_node} with interfaces: ${ifaces}"
30 # Delete all IPs on each interface... deleting IPs from one interface
31 # can cause other interfaces to disappear, so we need to be careful...
33 try_command_on_node
$test_node "$CTDB ifaces -Y"
34 info
=$
(awk -F: -v iface
="$i" '$2 == iface { print $0 }' <<<"$out")
36 if [ -z "$info" ] ; then
37 echo "Interface ${i} missing... assuming already deleted!"
41 echo "Deleting IPs on interface ${i}, with this information:"
44 try_command_on_node
$test_node "$CTDB ip -v -Y | tail -n +2"
46 '$6 == i { print $2 }' <<<"$out" |
49 try_command_on_node
$test_node "$CTDB delip $ip"
52 try_command_on_node
$test_node "$CTDB ifaces -Y"
53 info
=$
(awk -F: -v iface
="$i" '$2 == iface { print $0 }' <<<"$out")
55 if [ -z "$info" ] ; then
56 echo "GOOD: Interface ${i} has been garbage collected"
58 echo "BAD: Interface ${i} still exists"