diff --git a/unit-tests/bin/checkcrmv1 b/unit-tests/bin/checkcrmv1 new file mode 100755 index 0000000..94396cf --- /dev/null +++ b/unit-tests/bin/checkcrmv1 @@ -0,0 +1,39 @@ +#!/bin/sh + +add_crmv1_group() { + crmv1 group testgrp rsc1 Dummy rsc2 Dummy fake=test +} + +rm_crmv1_group() { + crmv1 group delete testgrp +} + +check_resources() { + export OCF_ROOT=/usr/lib/ocf + export OCF_RESOURCE_INSTANCE=rsc1 + . /usr/lib/ocf/lib/heartbeat/ocf-shellfuncs + /usr/lib/ocf/resource.d/heartbeat/Dummy monitor || return 1 + OCF_RESOURCE_INSTANCE=rsc2 + export OCF_RESKEY_fake=test + /usr/lib/ocf/resource.d/heartbeat/Dummy monitor || return 1 + return 0 +} + +# crmv1 start a group +setup_crmv1_group_start_ok() { + add_crmv1_group +} +test_crmv1_group_start_ok() { + wait_exp + wait_timeout +} +check_crmv1_group_start_ok() { + check_resources +} +recover_crmv1_group_start_ok() { + stop_site `get_site 1` + stop_site `get_site 2` + rm_crmv1_group +} + +check_crmv1_group_start_ok