| 1 |
# IPaddr2 |
| 2 |
|
| 3 |
CONFIG |
| 4 |
Agent IPaddr2 |
| 5 |
AgentRoot /usr/lib/ocf/resource.d/heartbeat |
| 6 |
HangTimeout 20 |
| 7 |
|
| 8 |
SETUP-AGENT |
| 9 |
ip addr add 192.168.144.1/24 dev eth0 brd 192.168.144.255 |
| 10 |
|
| 11 |
CLEANUP-AGENT |
| 12 |
ip addr del 192.168.144.1/24 dev eth0 |
| 13 |
|
| 14 |
CASE-BLOCK required_args |
| 15 |
Env OCF_RESKEY_ip=192.168.144.2 |
| 16 |
|
| 17 |
CASE-BLOCK check_iflabel_assigned |
| 18 |
Bash ip -4 -o addr show eth0 | grep -w 192.168.144.2/24 | grep -w eth0:iflabel >/dev/null # checking iflabel was assigned correctly |
| 19 |
|
| 20 |
CASE-BLOCK check_iflabel_removed |
| 21 |
Bash ! ip -4 -o addr show eth0 | grep -w 192.168.144.2/24 | grep -w eth0:iflabel >/dev/null # checking iflabel was removed correctly |
| 22 |
|
| 23 |
CASE-BLOCK default_status |
| 24 |
AgentRun stop |
| 25 |
|
| 26 |
CASE-BLOCK prepare |
| 27 |
Include required_args |
| 28 |
Include default_status |
| 29 |
|
| 30 |
CASE "check base env" |
| 31 |
Include prepare |
| 32 |
AgentRun start OCF_SUCCESS |
| 33 |
|
| 34 |
CASE "check base env: unset 'OCF_RESKEY_ip'" |
| 35 |
Include prepare |
| 36 |
Unenv OCF_RESKEY_ip |
| 37 |
AgentRun start OCF_ERR_CONFIGURED |
| 38 |
|
| 39 |
CASE "check base env: set invalid 'OCF_RESKEY_ip'" |
| 40 |
Include prepare |
| 41 |
Env OCF_RESKEY_ip=not_ip_address |
| 42 |
AgentRun start OCF_ERR_INSTALLED |
| 43 |
|
| 44 |
CASE "check base env: set 'OCF_RESKEY_cidr_netmask'" |
| 45 |
Include prepare |
| 46 |
Env OCF_RESKEY_cidr_netmask=24 |
| 47 |
AgentRun start OCF_SUCCESS |
| 48 |
|
| 49 |
CASE "check base env: set invalid 'OCF_RESKEY_cidr_netmask'" |
| 50 |
Include prepare |
| 51 |
Env OCF_RESKEY_cidr_netmask=not_netmask |
| 52 |
AgentRun start OCF_ERR_INSTALLED |
| 53 |
|
| 54 |
CASE "check base env: set 'OCF_RESKEY_broadcast'" |
| 55 |
Include prepare |
| 56 |
Env OCF_RESKEY_broadcast=192.168.144.255 |
| 57 |
AgentRun start OCF_SUCCESS |
| 58 |
|
| 59 |
CASE "check base env: set invalid 'OCF_RESKEY_broadcast'" |
| 60 |
Include prepare |
| 61 |
Env OCF_RESKEY_broadcast=not_broadcast |
| 62 |
AgentRun start OCF_ERR_INSTALLED |
| 63 |
|
| 64 |
CASE "check base env: set 'OCF_RESKEY_nic'" |
| 65 |
Include prepare |
| 66 |
Env OCF_RESKEY_nic=eth0 |
| 67 |
AgentRun start OCF_SUCCESS |
| 68 |
|
| 69 |
CASE "check base env: set invalid 'OCF_RESKEY_nic'" |
| 70 |
Include prepare |
| 71 |
Env OCF_RESKEY_nic=not_nic |
| 72 |
AgentRun start OCF_ERR_INSTALLED |
| 73 |
AgentRun validate-all OCF_ERR_CONFIGURED |
| 74 |
|
| 75 |
CASE "normal start" |
| 76 |
Include prepare |
| 77 |
AgentRun start OCF_SUCCESS |
| 78 |
|
| 79 |
CASE "normal stop" |
| 80 |
Include prepare |
| 81 |
AgentRun start |
| 82 |
AgentRun stop OCF_SUCCESS |
| 83 |
|
| 84 |
CASE "double start" |
| 85 |
Include prepare |
| 86 |
AgentRun start |
| 87 |
AgentRun start OCF_SUCCESS |
| 88 |
|
| 89 |
CASE "double stop" |
| 90 |
Include prepare |
| 91 |
AgentRun stop OCF_SUCCESS |
| 92 |
|
| 93 |
CASE "monitor with running" |
| 94 |
Include prepare |
| 95 |
AgentRun start |
| 96 |
AgentRun monitor OCF_SUCCESS |
| 97 |
|
| 98 |
CASE "monitor with not running" |
| 99 |
Include prepare |
| 100 |
AgentRun monitor OCF_NOT_RUNNING |
| 101 |
|
| 102 |
CASE "unimplemented command" |
| 103 |
Include prepare |
| 104 |
AgentRun no_cmd OCF_ERR_UNIMPLEMENTED |
| 105 |
|
| 106 |
CASE "Attachment to loopback interface" |
| 107 |
Env OCF_RESKEY_ip=127.0.0.3 |
| 108 |
AgentRun start OCF_SUCCESS |
| 109 |
AgentRun monitor OCF_SUCCESS |
| 110 |
AgentRun stop OCF_SUCCESS |
| 111 |
|
| 112 |
CASE "check additional env: set 'OCF_RESKEY_iflabel'" |
| 113 |
Include prepare |
| 114 |
Env OCF_RESKEY_nic=eth0 |
| 115 |
Env OCF_RESKEY_iflabel=iflabel |
| 116 |
AgentRun start OCF_SUCCESS |
| 117 |
Include check_iflabel_assigned |
| 118 |
AgentRun stop OCF_SUCCESS |
| 119 |
Include check_iflabel_removed |
| 120 |
|
| 121 |
# This is deprecated but still supported for the compatibility. |
| 122 |
CASE "check additional env: specify iflabel in 'OCF_RESKEY_nic'" |
| 123 |
Include prepare |
| 124 |
Env OCF_RESKEY_nic=eth0:iflabel |
| 125 |
AgentRun start OCF_SUCCESS |
| 126 |
Include check_iflabel_assigned |
| 127 |
AgentRun stop OCF_SUCCESS |
| 128 |
Include check_iflabel_removed |
| 129 |
|
| 130 |
# monitor should return OCF_ERR_GENERIC rather than OCF_ERR_CONFIGURED |
| 131 |
# when the specified OCF_RESKEY_nic is vanished by a failure. |
| 132 |
# This has been changed as of 3.9.6. |
| 133 |
CASE "monitor failure when 'OCF_RESKEY_nic' is vanished" |
| 134 |
Include prepare |
| 135 |
Env OCF_RESKEY_nic=ethVanished |
| 136 |
Env OCF_RESKEY_CRM_meta_interval=10 # not in probe |
| 137 |
AgentRun monitor OCF_ERR_GENERIC |