Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Low: fencing: Regression tests targeting merging of remote fencing op…

…erations
  • Loading branch information...
commit d412bcb5d7bd0f425d6b8a23a3be5f061c0e2d4b 1 parent fe740ad
David Vossel davidvossel authored
Showing with 80 additions and 0 deletions.
  1. +80 −0 fencing/regression.py.in
80 fencing/regression.py.in
View
@@ -185,6 +185,7 @@ class Test:
cur = cur + 1
if line.count(pats[cur]):
del pats[cur]
+ break
if len(pats) > 0 or negative_matches:
if self.verbose:
@@ -351,6 +352,84 @@ class Tests:
# timeout is 2+1+4000 = 4003
test.add_stonith_log_pattern("remote op timeout set to 4003")
+ def build_fence_merge_tests(self):
+
+ ### Simple test that overlapping fencing operations get merged
+ test = self.new_test("cpg_custom_merge_single",
+ "Verify overlapping identical fencing operations are merged, no fencing levels used.", 1)
+ test.add_cmd("stonith_admin", "-R false1 -a fence_false -o \"pcmk_host_list=node3\"")
+ test.add_cmd("stonith_admin", "-R true1 -a fence_true -o \"pcmk_host_list=node3\" ")
+ test.add_cmd("stonith_admin", "-R false2 -a fence_false -o \"pcmk_host_list=node3\"")
+ test.add_cmd_no_wait("stonith_admin", "-F node3 -t 10")
+ test.add_cmd("stonith_admin", "-F node3 -t 10")
+ ### one merger will happen
+ test.add_stonith_log_pattern("Merging stonith action off for node node3 originating from client")
+ ### the pattern below signifies that both the original and duplicate operation completed
+ test.add_stonith_log_pattern("Operation off of node3 by")
+ test.add_stonith_log_pattern("Operation off of node3 by")
+
+ ### Test that multiple mergers occur
+ test = self.new_test("cpg_custom_merge_multiple",
+ "Verify multiple overlapping identical fencing operations are merged", 1)
+ test.add_cmd("stonith_admin", "-R false1 -a fence_false -o \"pcmk_host_list=node3\"")
+ test.add_cmd("stonith_admin", "-R true1 -a fence_true -o \"pcmk_host_list=node3\" ")
+ test.add_cmd("stonith_admin", "-R false2 -a fence_false -o \"pcmk_host_list=node3\"")
+ test.add_cmd_no_wait("stonith_admin", "-F node3 -t 10")
+ test.add_cmd_no_wait("stonith_admin", "-F node3 -t 10")
+ test.add_cmd_no_wait("stonith_admin", "-F node3 -t 10")
+ test.add_cmd_no_wait("stonith_admin", "-F node3 -t 10")
+ test.add_cmd("stonith_admin", "-F node3 -t 10")
+ ### 4 mergers should occur
+ test.add_stonith_log_pattern("Merging stonith action off for node node3 originating from client")
+ test.add_stonith_log_pattern("Merging stonith action off for node node3 originating from client")
+ test.add_stonith_log_pattern("Merging stonith action off for node node3 originating from client")
+ test.add_stonith_log_pattern("Merging stonith action off for node node3 originating from client")
+ ### the pattern below signifies that both the original and duplicate operation completed
+ test.add_stonith_log_pattern("Operation off of node3 by")
+ test.add_stonith_log_pattern("Operation off of node3 by")
+ test.add_stonith_log_pattern("Operation off of node3 by")
+ test.add_stonith_log_pattern("Operation off of node3 by")
+ test.add_stonith_log_pattern("Operation off of node3 by")
+
+ ### Test that multiple mergers occur with topologies used
+ test = self.new_test("cpg_custom_merge_with_topology",
+ "Verify multiple overlapping identical fencing operations are merged with fencing levels.", 1)
+ test.add_cmd("stonith_admin", "-R false1 -a fence_false -o \"pcmk_host_list=node3\"")
+ test.add_cmd("stonith_admin", "-R true1 -a fence_true -o \"pcmk_host_list=node3\" ")
+ test.add_cmd("stonith_admin", "-R false2 -a fence_false -o \"pcmk_host_list=node3\"")
+ test.add_cmd("stonith_admin", "-r node3 -i 1 -v false1")
+ test.add_cmd("stonith_admin", "-r node3 -i 1 -v false2")
+ test.add_cmd("stonith_admin", "-r node3 -i 2 -v true1")
+ test.add_cmd_no_wait("stonith_admin", "-F node3 -t 10")
+ test.add_cmd_no_wait("stonith_admin", "-F node3 -t 10")
+ test.add_cmd_no_wait("stonith_admin", "-F node3 -t 10")
+ test.add_cmd_no_wait("stonith_admin", "-F node3 -t 10")
+ test.add_cmd("stonith_admin", "-F node3 -t 10")
+ ### 4 mergers should occur
+ test.add_stonith_log_pattern("Merging stonith action off for node node3 originating from client")
+ test.add_stonith_log_pattern("Merging stonith action off for node node3 originating from client")
+ test.add_stonith_log_pattern("Merging stonith action off for node node3 originating from client")
+ test.add_stonith_log_pattern("Merging stonith action off for node node3 originating from client")
+ ### the pattern below signifies that both the original and duplicate operation completed
+ test.add_stonith_log_pattern("Operation off of node3 by")
+ test.add_stonith_log_pattern("Operation off of node3 by")
+ test.add_stonith_log_pattern("Operation off of node3 by")
+ test.add_stonith_log_pattern("Operation off of node3 by")
+ test.add_stonith_log_pattern("Operation off of node3 by")
+
+
+ test = self.new_test("cpg_custom_no_merge",
+ "Verify differing fencing operations are not merged", 1)
+ test.add_cmd("stonith_admin", "-R false1 -a fence_false -o \"pcmk_host_list=node3 node2\"")
+ test.add_cmd("stonith_admin", "-R true1 -a fence_true -o \"pcmk_host_list=node3 node2\" ")
+ test.add_cmd("stonith_admin", "-R false2 -a fence_false -o \"pcmk_host_list=node3 node2\"")
+ test.add_cmd("stonith_admin", "-r node3 -i 1 -v false1")
+ test.add_cmd("stonith_admin", "-r node3 -i 1 -v false2")
+ test.add_cmd("stonith_admin", "-r node3 -i 2 -v true1")
+ test.add_cmd_no_wait("stonith_admin", "-F node2 -t 10")
+ test.add_cmd("stonith_admin", "-F node3 -t 10")
+ test.add_stonith_negative_log_pattern("Merging stonith action off for node node3 originating from client")
+
def build_standalone_tests(self):
test_types = [
{
@@ -668,6 +747,7 @@ def main(argv):
tests.build_standalone_tests()
tests.build_custom_timeout_tests()
tests.build_api_sanity_tests()
+ tests.build_fence_merge_tests()
if o.options['list-tests']:
tests.print_list()
Please sign in to comment.
Something went wrong with that request. Please try again.