From: Naoki Kambe Date: Thu, 4 Apr 2013 05:13:15 +0000 (+0900) Subject: [2252] add an exceptional case when checking initial statistics of Xfrout X-Git-Tag: bind10-1.2.0beta1-release~474^2~4^2~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7885ecddb52be49de729021a70b42e60aca2cea;p=thirdparty%2Fkea.git [2252] add an exceptional case when checking initial statistics of Xfrout Sometime an unixdomain socket could be already opened at the first time when stats daemon queries xfrout statistics. --- diff --git a/tests/lettuce/features/terrain/bind10_control.py b/tests/lettuce/features/terrain/bind10_control.py index 5359f0172d..b155712b60 100644 --- a/tests/lettuce/features/terrain/bind10_control.py +++ b/tests/lettuce/features/terrain/bind10_control.py @@ -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 to look for name ('module '): The name of the module (case sensitive!) cmdctl_port ('with cmdctl port ', 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: diff --git a/tests/lettuce/features/xfrin_notify_handling.feature b/tests/lettuce/features/xfrin_notify_handling.feature index 9a85926f91..c10fc621b5 100644 --- a/tests/lettuce/features/xfrin_notify_handling.feature +++ b/tests/lettuce/features/xfrin_notify_handling.feature @@ -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