Browse Source

[2252] add a port number of cmdctl as an option of check_init_statistics()

Naoki Kambe 12 years ago
parent
commit
0eec3b5ce4

+ 8 - 4
tests/lettuce/features/terrain/bind10_control.py

@@ -438,16 +438,20 @@ def check_statistics_items(step, category, has_except_for):
             'Statistics item %s has unexpected value %s (expect %s)' % \
             'Statistics item %s has unexpected value %s (expect %s)' % \
                 (name, found, 0)
                 (name, found, 0)
 
 
-@step('check initial statistics for (\S+)')
-def check_init_statistics(step, name):
+@step('check initial statistics for (\S+)( with cmdctl port \d+)?')
+def check_init_statistics(step, name, cmdctl_port):
     """
     """
     check the initial statistics for the module
     check the initial statistics for the module
     Parameters:
     Parameters:
     name ('module <name>'): The name of the module (case sensitive!)
     name ('module <name>'): The name of the module (case sensitive!)
+    cmdctl_port ('with cmdctl port <portnr>', optional): cmdctl port to send
+                the command to.
     """
     """
-    query_str = 'When I query statistics of bind10 module %s with cmdctl' % name
+    query_str = 'query statistics of bind10 module ' + name
+    if cmdctl_port:
+        query_str = query_str + cmdctl_port
     notcontain_str = 'last bindctl output should not contain "%s"'
     notcontain_str = 'last bindctl output should not contain "%s"'
-    check_str = 'The statistics counters are 0 in category .' + name
+    check_str = 'statistics counters are 0 in category .' + name
     step.given(query_str)
     step.given(query_str)
     step.given(notcontain_str % 'error')
     step.given(notcontain_str % 'error')
     step.given(notcontain_str % 'example.org.')
     step.given(notcontain_str % 'example.org.')

+ 4 - 4
tests/lettuce/features/xfrin_notify_handling.feature

@@ -22,7 +22,7 @@ Feature: Xfrin incoming notify handling
     #
     #
     # Test1 for Xfrout statistics
     # Test1 for Xfrout statistics
     #
     #
-    check initial statistics for Xfrout
+    check initial statistics for Xfrout with cmdctl port 47804
     When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
     When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
     The statistics counters are 0 in category .Xfrout.socket.unixdomain except for the following items
     The statistics counters are 0 in category .Xfrout.socket.unixdomain except for the following items
       | item_name | min_value | max_value |
       | item_name | min_value | max_value |
@@ -118,7 +118,7 @@ Feature: Xfrin incoming notify handling
     #
     #
     # Test1 for Xfrout statistics
     # Test1 for Xfrout statistics
     #
     #
-    check initial statistics for Xfrout
+    check initial statistics for Xfrout with cmdctl port 47804
     When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
     When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
     The statistics counters are 0 in category .Xfrout.socket.unixdomain except for the following items
     The statistics counters are 0 in category .Xfrout.socket.unixdomain except for the following items
       | item_name | min_value | max_value |
       | item_name | min_value | max_value |
@@ -214,7 +214,7 @@ Feature: Xfrin incoming notify handling
     #
     #
     # Test1 for Xfrout statistics
     # Test1 for Xfrout statistics
     #
     #
-    check initial statistics for Xfrout
+    check initial statistics for Xfrout with cmdctl port 47804
     When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
     When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
     The statistics counters are 0 in category .Xfrout.socket.unixdomain except for the following items
     The statistics counters are 0 in category .Xfrout.socket.unixdomain except for the following items
       | item_name | min_value | max_value |
       | item_name | min_value | max_value |
@@ -319,7 +319,7 @@ Feature: Xfrin incoming notify handling
     #
     #
     # Test1 for Xfrout statistics
     # Test1 for Xfrout statistics
     #
     #
-    check initial statistics for Xfrout
+    check initial statistics for Xfrout with cmdctl port 47804
     When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
     When I query statistics socket of bind10 module Xfrout with cmdctl port 47804
     The statistics counters are 0 in category .Xfrout.socket.unixdomain except for the following items
     The statistics counters are 0 in category .Xfrout.socket.unixdomain except for the following items
       | item_name | min_value | max_value |
       | item_name | min_value | max_value |