diff --git a/tools/ocft/mysql-proxy b/tools/ocft/mysql-proxy new file mode 100644 index 000000000..54affb2a8 --- /dev/null +++ b/tools/ocft/mysql-proxy @@ -0,0 +1,76 @@ +# mysql-proxy +# by r.bhatia@ipax.at +# +# test cases (to implement): +# +# */usr/sbin/ocf-tester -n mp /usr/lib/ocf/resource.d/heartbeat/mysql-proxy +# */usr/sbin/ocf-tester -n ms -o binary="/usr/sbin/mysql-proxy" -o defaults_file="" -o parameters="--proxy-skip-profiling" \ +# -o admin_address="127.0.0.1:4041" -o proxy_backend_addresses="192.168.100.200:42006" \ +# -o proxy_address="/var/run/mysqld/mysqld.sock" /usr/lib/ocf/resource.d/heartbeat/mysql-proxy + +CONFIG + #AgentRoot /usr/lib/ocf/resource.d/heartbeat + InstallPackage mysql-proxy + HangTimeout 20 + +SETUP-AGENT + # nothing + +CASE-BLOCK crm_setting + Var OCF_RESKEY_CRM_meta_timeout=15000 + Var OCF_RESKEY_admin_username=root + Var OCF_RESKEY_admin_password=test123 + Var OCF_RESKEY_admin_lua_script=/usr/lib/mysql-proxy/lua/admin.lua + +CASE-BLOCK default_status + AgentRun stop + +CASE-BLOCK prepare + Include crm_setting + Include default_status + +CASE "check base env" + Include prepare + AgentRun start OCF_SUCCESS + +CASE "check base env: invalid 'OCF_RESKEY_binary'" + Include prepare + Var OCF_RESKEY_binary=no_such + AgentRun start OCF_ERR_INSTALLED + +CASE "check base env: 'OCF_RESKEY_binary'" + Include prepare + Var OCF_RESKEY_binary=/usr/sbin/mysql-proxy + AgentRun start + AgentRun monitor OCF_SUCCESS + +CASE "normal start" + Include prepare + AgentRun start OCF_SUCCESS + +CASE "normal stop" + Include prepare + AgentRun start + AgentRun stop OCF_SUCCESS + +CASE "double start" + Include prepare + AgentRun start + AgentRun start OCF_SUCCESS + +CASE "double stop" + Include prepare + AgentRun stop OCF_SUCCESS + +CASE "running monitor" + Include prepare + AgentRun start + AgentRun monitor OCF_SUCCESS + +CASE "not running monitor" + Include prepare + AgentRun monitor OCF_NOT_RUNNING + +CASE "unimplemented command" + Include prepare + AgentRun no_cmd OCF_ERR_UNIMPLEMENTED