| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | . "${TEST_SCRIPTS_DIR}/unit.sh" |
| 4 | |
| 5 | define_test "3 nodes, all ok, IPs all unassigned, TAKEOVER_IP error" |
| 6 | |
| 7 | setup_ctdbd <<EOF |
| 8 | NODEMAP |
| 9 | 0 192.168.20.41 0x0 CURRENT RECMASTER |
| 10 | 1 192.168.20.42 0x0 |
| 11 | 2 192.168.20.43 0x0 |
| 12 | |
| 13 | IFACES |
| 14 | :Name:LinkStatus:References: |
| 15 | :eth2:1:2: |
| 16 | :eth1:1:4: |
| 17 | |
| 18 | PUBLICIPS |
| 19 | 10.0.0.31 -1 |
| 20 | 10.0.0.32 -1 |
| 21 | 10.0.0.33 -1 |
| 22 | |
| 23 | CONTROLFAILS |
| 24 | 89 1 ERROR CTDB_CONTROL_TAKEOVER_IP fake failure |
| 25 | EOF |
| 26 | |
| 27 | required_result 255 <<EOF |
| 28 | TAKEOVER_IP 10.0.0.32 failed on node 1, ret=-1 |
| 29 | Assigning banning credits to node 1 |
| 30 | takeover run failed, ret=-1 |
| 31 | EOF |
| 32 | test_takeover_helper |
| 33 | |
| 34 | required_result 0 <<EOF |
| 35 | Public IPs on ALL nodes |
| 36 | 10.0.0.31 2 |
| 37 | 10.0.0.32 -1 |
| 38 | 10.0.0.33 0 |
| 39 | EOF |
| 40 | test_ctdb_ip_all |