'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:
#
# 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
#
# 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
#
#
# 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
#
# 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