Skip to content

Commit

Permalink
add the script for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dmuhamedagic committed Oct 23, 2023
1 parent 7bf1855 commit 72ece97
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions unit-tests/bin/checkcrmv1
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 72ece97

Please sign in to comment.