Skip to content

Commit

Permalink
Dev: behave: Add functional test based on previous changes
Browse files Browse the repository at this point in the history
  • Loading branch information
liangxin1300 committed Sep 27, 2022
1 parent 9c0acad commit 37d4b63
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/features/bootstrap_sbd_delay.feature
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,38 @@ Feature: configure sbd delay start correctly
Then Service "corosync-qdevice" is "stopped" on "hanode1"
And Service "corosync-qdevice" is "stopped" on "hanode2"
And Parameter "pcmk_delay_max" configured in "stonith-sbd"

@clean
Scenario: Test priority-fence-delay and priority
Given Cluster service is "stopped" on "hanode1"
Given Cluster service is "stopped" on "hanode2"
When Run "crm cluster init -y" on "hanode1"
Then Cluster service is "started" on "hanode1"
When Run "crm cluster join -c hanode1 -y" on "hanode2"
Then Cluster service is "started" on "hanode2"
And Property "priority" in "rsc_defaults" is "1"
When Run "crm cluster remove hanode2 -y" on "hanode1"
Then Cluster service is "stopped" on "hanode2"
And Property "priority" in "rsc_defaults" is "0"
When Run "crm cluster join -c hanode1 -y" on "hanode2"
Then Cluster service is "started" on "hanode2"
And Property "priority" in "rsc_defaults" is "1"
When Run "crm cluster init qdevice --qnetd-hostname=qnetd-node -y" on "hanode1"
Then Service "corosync-qdevice" is "started" on "hanode1"
And Service "corosync-qdevice" is "started" on "hanode2"
And Property "priority" in "rsc_defaults" is "0"
When Run "crm cluster remove --qdevice -y" on "hanode1"
Then Service "corosync-qdevice" is "stopped" on "hanode1"
And Service "corosync-qdevice" is "stopped" on "hanode2"
And Property "priority" in "rsc_defaults" is "1"
When Run "crm cluster init sbd -s /dev/sda1 -y" on "hanode1"
Then Service "sbd" is "started" on "hanode1"
And Service "sbd" is "started" on "hanode2"
And Parameter "pcmk_delay_max" configured in "stonith-sbd"
And Cluster property "stonith-timeout" is "83"
And Cluster property "priority-fencing-delay" is "60"
When Run "crm cluster remove hanode2 -y" on "hanode1"
Then Cluster service is "stopped" on "hanode2"
And Property "priority" in "rsc_defaults" is "0"
And Cluster property "priority-fencing-delay" is "0"
And Parameter "pcmk_delay_max" not configured in "stonith-sbd"
6 changes: 6 additions & 0 deletions test/features/steps/step_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,12 @@ def step_impl(context, key, value):
assert res is not None and str(res) == value


@then('Property "{key}" in "{type}" is "{value}"')
def step_impl(context, key, type, value):
res = crmutils.get_property(key, type)
assert res is not None and str(res) == value


@then('Parameter "{param_name}" not configured in "{res_id}"')
def step_impl(context, param_name, res_id):
_, out = run_command(context, "crm configure show {}".format(res_id))
Expand Down

0 comments on commit 37d4b63

Please sign in to comment.