Skip to content

Commit

Permalink
Test: fencer: add cpg_topology_delay test to verify enforced fencing …
Browse files Browse the repository at this point in the history
…delay with fencing topology
  • Loading branch information
gao-yan committed Mar 20, 2020
1 parent 3dec930 commit 6b34194
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions cts/cts-fencing.in
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,35 @@ class Tests(object):
test.add_stonith_neg_log_pattern("does not advertise support for 'reboot', performing 'off'")
test.add_stonith_log_pattern("with device 'true1' returned: 0 (OK)")

# make sure enforced fencing delay is applied only for the first device in the first level
for test_type in test_types:
if test_type["use_cpg"] == 0:
continue

test = self.new_test("%s_topology_delay" % test_type["prefix"],
"Verify enforced fencing delay is applied only for the first device in the first level.",
test_type["use_cpg"])
test.add_cmd("stonith_admin",
"--output-as=xml -R true1 -a fence_dummy -o \"mode=pass\" -o \"pcmk_host_list=node1 node2 node3\"")
test.add_cmd("stonith_admin",
"--output-as=xml -R false1 -a fence_dummy -o \"mode=fail\" -o \"pcmk_host_list=node1 node2 node3\"")
test.add_cmd("stonith_admin",
"--output-as=xml -R true2 -a fence_dummy -o \"mode=pass\" -o \"pcmk_host_list=node1 node2 node3\"")
test.add_cmd("stonith_admin",
"--output-as=xml -R true3 -a fence_dummy -o \"mode=pass\" -o \"pcmk_host_list=node1 node2 node3\"")

test.add_cmd("stonith_admin", "--output-as=xml -r node3 -i 1 -v true1")
test.add_cmd("stonith_admin", "--output-as=xml -r node3 -i 1 -v false1")
test.add_cmd("stonith_admin", "--output-as=xml -r node3 -i 2 -v true2")
test.add_cmd("stonith_admin", "--output-as=xml -r node3 -i 2 -v true3")

test.add_cmd("stonith_admin", "--output-as=xml -F node3 --delay 1")

test.add_stonith_log_pattern("Delaying 'off' action targeting node3 on true1 for enforced 1s")
test.add_stonith_neg_log_pattern("Delaying 'off' action targeting node3 on false1")
test.add_stonith_neg_log_pattern("Delaying 'off' action targeting node3 on true2")
test.add_stonith_neg_log_pattern("Delaying 'off' action targeting node3 on true3")

def build_nodeid_tests(self):
""" Register tests that use a corosync node id """

Expand Down

0 comments on commit 6b34194

Please sign in to comment.