]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2252] add an exceptional case when checking initial statistics of Xfrout
authorNaoki Kambe <kambe@jprs.co.jp>
Thu, 4 Apr 2013 05:13:15 +0000 (14:13 +0900)
committerNaoki Kambe <kambe@jprs.co.jp>
Thu, 4 Apr 2013 11:33:55 +0000 (20:33 +0900)
Sometime an unixdomain socket could be already opened at the first
time when stats daemon queries xfrout statistics.

tests/lettuce/features/terrain/bind10_control.py
tests/lettuce/features/xfrin_notify_handling.feature

index 5359f0172de4b6639dfe6e43eeb0ad614d438098..b155712b60bb6a6d8bd3cab23287491989e20f33 100644 (file)
@@ -438,22 +438,29 @@ def check_statistics_items(step, category, has_except_for):
             'Statistics item %s has unexpected value %s (expect %s)' % \
                 (name, found, 0)
 
-@step('check initial statistics(?:( not)? containing (\S+))? for (\S+)( with cmdctl port \d+)?')
-def check_init_statistics(step, notv, string, name, cmdctl_port):
+@step('check initial statistics(?:( not)? containing (\S+))? for (\S+)'
+      '( with cmdctl port \d+)?( except for the following items)?')
+def check_init_statistics(step, notv, string, name, cmdctl_port, has_except_for):
     """Checks the initial statistics for the module. Also checks a
-    string is contained or not contained in them.
+    string is contained or not contained in them. Statistics counters
+      other than zero can follow below.
     Parameters:
     notv ('not'): reverse the check (fail if string is found)
     string ('containing <string>') string to look for
     name ('module <name>'): The name of the module (case sensitive!)
     cmdctl_port ('with cmdctl port <portnr>', optional): cmdctl port to send
                 the command to.
+    has_except_for ('except for the following items'): checks values of items
+        with the multiline part.
     """
     query_str = 'query statistics of bind10 module ' + name
     if cmdctl_port:
         query_str = query_str + cmdctl_port
     notcontain_str = 'last bindctl output should%s contain "%s"'
     check_str = 'statistics counters are 0 in category .' + name
+    if has_except_for:
+        check_str = check_str + has_except_for + "\n" \
+            + step.represent_hashes()
     step.given(query_str)
     step.given(notcontain_str % (' not', 'error'))
     if string is not None:
index 9a85926f918386df1f00d92efce0e24910e8508c..c10fc621b57d3933c35d34fb97a5ad9748936f53 100644 (file)
@@ -27,7 +27,11 @@ Feature: Xfrin incoming notify handling
     #
     # Test1 for Xfrout statistics
     #
-    check initial statistics not containing example.org for Xfrout with cmdctl port 47804
+    check initial statistics not containing example.org for Xfrout with cmdctl port 47804 except for the following items
+      | item_name                | min_value | max_value |
+      | socket.unixdomain.open   |         0 |         1 |
+    # Note: Sometime an unixdomain socket could be already opened at
+    # the first time when stats daemon queries xfrout statistics.
 
     #
     # Test2 for Xfrin statistics
@@ -118,7 +122,11 @@ Feature: Xfrin incoming notify handling
     #
     # Test1 for Xfrout statistics
     #
-    check initial statistics not containing example.org for Xfrout with cmdctl port 47804
+    check initial statistics not containing example.org for Xfrout with cmdctl port 47804 except for the following items
+      | item_name                | min_value | max_value |
+      | socket.unixdomain.open   |         0 |         1 |
+    # Note: Sometime an unixdomain socket could be already opened at
+    # the first time when stats daemon queries xfrout statistics.
     #
     # Test2 for Xfrin statistics
     #
@@ -216,7 +224,11 @@ Feature: Xfrin incoming notify handling
     #
     # Test1 for Xfrout statistics
     #
-    check initial statistics not containing example.org for Xfrout with cmdctl port 47804
+    check initial statistics not containing example.org for Xfrout with cmdctl port 47804 except for the following items
+      | item_name                | min_value | max_value |
+      | socket.unixdomain.open   |         0 |         1 |
+    # Note: Sometime an unixdomain socket could be already opened at
+    # the first time when stats daemon queries xfrout statistics.
 
     #
     # Test2 for Xfrin statistics
@@ -322,7 +334,11 @@ Feature: Xfrin incoming notify handling
     #
     # Test1 for Xfrout statistics
     #
-    check initial statistics not containing example.org for Xfrout with cmdctl port 47804
+    check initial statistics not containing example.org for Xfrout with cmdctl port 47804 except for the following items
+      | item_name                | min_value | max_value |
+      | socket.unixdomain.open   |         0 |         1 |
+    # Note: Sometime an unixdomain socket could be already opened at
+    # the first time when stats daemon queries xfrout statistics.
 
     #
     # Test2 for Xfrin statistics