#!/bin/bash test_info() { cat </dev/null 2>&1 || true echo "Pinging ${test_ip}..." ping_wrapper -q -n -c 1 $test_ip echo "Getting MAC address associated with ${test_ip}..." original_mac=$(ip neigh show $test_prefix | awk '$4 == "lladdr" {print $5}') [ -n "$original_mac" ] || die "Couldn't get MAC address for ${test_prefix}" echo "MAC address is: ${original_mac}" gratarp_sniff_start echo "Disabling node $test_node" try_command_on_node 1 $CTDB disable -n $test_node wait_until_node_has_status $test_node disabled gratarp_sniff_wait_show echo "Getting MAC address associated with ${test_ip} again..." new_mac=$(ip neigh show $test_prefix | awk '$4 == "lladdr" {print $5}') [ -n "$new_mac" ] || die "Couldn't get MAC address for ${test_prefix}" echo "MAC address is: ${new_mac}" if [ "$original_mac" != "$new_mac" ] ; then echo "GOOD: MAC address changed" else echo "BAD: MAC address did not change" testfailures=1 fi