| 1 |
# postfix |
| 2 |
# by [email protected] |
| 3 |
# |
| 4 |
# test cases (to implement): |
| 5 |
# |
| 6 |
# * /usr/sbin/ocf-tester -n post1 /usr/lib/ocf/resource.d/heartbeat/postfix; echo $? -> DONE |
| 7 |
# * /usr/sbin/ocf-tester -n post2 -o binary="/usr/sbin/postfix" \ |
| 8 |
# -o config_dir="" /usr/lib/ocf/resource.d/heartbeat/postfix; echo $? -> DONE |
| 9 |
# * /usr/sbin/ocf-tester -n post3 -o binary="/usr/sbin/postfix" \ |
| 10 |
# -o config_dir="/etc/postfix" /usr/lib/ocf/resource.d/heartbeat/postfix; echo $? -> DONE |
| 11 |
# * /usr/sbin/ocf-tester -n post4 -o binary="/usr/sbin/postfix" \ |
| 12 |
# -o config_dir="/root/postfix/" /usr/lib/ocf/resource.d/heartbeat/postfix; echo $? |
| 13 |
|
| 14 |
CONFIG |
| 15 |
Agent postfix |
| 16 |
AgentRoot /usr/lib/ocf/resource.d/heartbeat |
| 17 |
InstallPackage postfix |
| 18 |
HangTimeout 20 |
| 19 |
|
| 20 |
SETUP-AGENT |
| 21 |
# nothing |
| 22 |
|
| 23 |
CASE-BLOCK crm_setting |
| 24 |
Env OCF_RESKEY_CRM_meta_timeout=15000 |
| 25 |
Env OCF_RESKEY_CRM_meta_interval=10000 |
| 26 |
|
| 27 |
CASE-BLOCK default_status |
| 28 |
AgentRun stop |
| 29 |
|
| 30 |
CASE-BLOCK prepare |
| 31 |
Include crm_setting |
| 32 |
Include default_status |
| 33 |
|
| 34 |
CASE "check base env" |
| 35 |
Include prepare |
| 36 |
AgentRun start OCF_SUCCESS |
| 37 |
|
| 38 |
CASE "check base env: invalid 'OCF_RESKEY_binary'" |
| 39 |
Include prepare |
| 40 |
Env OCF_RESKEY_binary=no_such |
| 41 |
AgentRun start OCF_ERR_INSTALLED |
| 42 |
|
| 43 |
CASE "check base env: invalid 'OCF_RESKEY_config_dir'" |
| 44 |
Include prepare |
| 45 |
Env OCF_RESKEY_config_dir=no_such |
| 46 |
AgentRun start OCF_ERR_INSTALLED |
| 47 |
|
| 48 |
CASE "check base env: 'OCF_RESKEY_binary'" |
| 49 |
Include prepare |
| 50 |
Env OCF_RESKEY_binary=/usr/sbin/postfix |
| 51 |
AgentRun start |
| 52 |
AgentRun monitor OCF_SUCCESS |
| 53 |
|
| 54 |
CASE "check base env: 'OCF_RESKEY_config_dir' without trailing slash" |
| 55 |
Include prepare |
| 56 |
Env OCF_RESKEY_config_dir="/etc/postfix" |
| 57 |
AgentRun start |
| 58 |
AgentRun monitor OCF_SUCCESS |
| 59 |
|
| 60 |
CASE "check base env: 'OCF_RESKEY_config_dir' with trailing slash" |
| 61 |
Include prepare |
| 62 |
Env OCF_RESKEY_config_dir="/etc/postfix/" |
| 63 |
AgentRun start |
| 64 |
AgentRun monitor OCF_SUCCESS |
| 65 |
|
| 66 |
CASE "normal start" |
| 67 |
Include prepare |
| 68 |
AgentRun start OCF_SUCCESS |
| 69 |
|
| 70 |
CASE "normal stop" |
| 71 |
Include prepare |
| 72 |
AgentRun start |
| 73 |
AgentRun stop OCF_SUCCESS |
| 74 |
|
| 75 |
CASE "double start" |
| 76 |
Include prepare |
| 77 |
AgentRun start |
| 78 |
AgentRun start OCF_SUCCESS |
| 79 |
|
| 80 |
CASE "double stop" |
| 81 |
Include prepare |
| 82 |
AgentRun stop OCF_SUCCESS |
| 83 |
|
| 84 |
CASE "monitor a running resource" |
| 85 |
Include prepare |
| 86 |
AgentRun start |
| 87 |
AgentRun monitor OCF_SUCCESS |
| 88 |
|
| 89 |
CASE "(initial) probe a stopped resource" |
| 90 |
Include prepare |
| 91 |
Env OCF_RESKEY_CRM_meta_interval=0 |
| 92 |
AgentRun monitor OCF_NOT_RUNNING |
| 93 |
|
| 94 |
CASE "(re-)probe a running resource" |
| 95 |
Include prepare |
| 96 |
Env OCF_RESKEY_CRM_meta_interval=0 |
| 97 |
AgentRun start |
| 98 |
AgentRun monitor OCF_SUCCESS |
| 99 |
|
| 100 |
CASE "unimplemented command" |
| 101 |
Include prepare |
| 102 |
AgentRun no_cmd OCF_ERR_UNIMPLEMENTED |