From: Naoki Kambe Date: Tue, 12 Mar 2013 11:00:04 +0000 (+0900) Subject: [2252] unify multiple similar checks of initial statistics into a step method X-Git-Tag: bind10-1.2.0beta1-release~474^2~4^2~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d69fb646ed39dafe4277334a28b52d948e6348ae;p=thirdparty%2Fkea.git [2252] unify multiple similar checks of initial statistics into a step method --- diff --git a/tests/lettuce/features/terrain/bind10_control.py b/tests/lettuce/features/terrain/bind10_control.py index aada41ec96..596a4069fb 100644 --- a/tests/lettuce/features/terrain/bind10_control.py +++ b/tests/lettuce/features/terrain/bind10_control.py @@ -432,3 +432,25 @@ def check_statistics_items(step, category, has_except_for): assert int(found) == 0, \ 'Statistics item %s has unexpected value %s (expect %s)' % \ (name, found, 0) + +@step('check initial statistics for (Xfrin|Xfrout)') +def check_init_statistics(step, module): + """ + check the initial statistics for Xfrin or Xfrout. + Parameters: + module : Xfrin or Xfrout + """ + query_str = 'When I query statistics %%s of bind10 module %s with cmdctl' % module + notcontain_str = 'last bindctl output should not contain "%s"' + check_str = 'The statistics counters are 0 in category .%s%%s' % module + if module == 'Xfrout': + query_str = query_str + ' port 47804' + step.given(query_str % 'zones') + step.given(notcontain_str % 'error') + step.given(notcontain_str % 'example.org.') + step.given(check_str % '.zones._SERVER_') + if module == 'Xfrout': + step.given(query_str % 'ixfr_running') + step.given(check_str) + step.given(query_str % 'axfr_running') + step.given(check_str) diff --git a/tests/lettuce/features/xfrin_notify_handling.feature b/tests/lettuce/features/xfrin_notify_handling.feature index 445ef5267a..4f565701b7 100644 --- a/tests/lettuce/features/xfrin_notify_handling.feature +++ b/tests/lettuce/features/xfrin_notify_handling.feature @@ -22,19 +22,7 @@ Feature: Xfrin incoming notify handling # # Test1 for Xfrout statistics # - # check initial statistics - # - When I query statistics zones of bind10 module Xfrout with cmdctl port 47804 - last bindctl output should not contain "error" - last bindctl output should not contain "example.org." - The statistics counters are 0 in category .Xfrout.zones._SERVER_ - - When I query statistics ixfr_running of bind10 module Xfrout with cmdctl port 47804 - The statistics counters are 0 in category .Xfrout - - When I query statistics axfr_running of bind10 module Xfrout with cmdctl port 47804 - The statistics counters are 0 in category .Xfrout - + check initial statistics for Xfrout 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 | item_name | min_value | max_value | @@ -43,12 +31,7 @@ Feature: Xfrin incoming notify handling # # Test2 for Xfrin statistics # - # check initial statistics - # - When I query statistics zones of bind10 module Xfrin with cmdctl - last bindctl output should not contain "error" - The statistics counters are 0 in category .Xfrin.zones._SERVER_ - + check initial statistics for Xfrin When I send bind10 with cmdctl port 47804 the command Xfrout notify example.org IN Then wait for new master stderr message XFROUT_NOTIFY_COMMAND Then wait for new bind10 stderr message AUTH_RECEIVED_NOTIFY @@ -135,19 +118,7 @@ Feature: Xfrin incoming notify handling # # Test5 for Xfrout statistics # - # check initial statistics - # - When I query statistics zones of bind10 module Xfrout with cmdctl port 47804 - last bindctl output should not contain "error" - last bindctl output should not contain "example.org." - The statistics counters are 0 in category .Xfrout.zones._SERVER_ - - When I query statistics ixfr_running of bind10 module Xfrout with cmdctl port 47804 - The statistics counters are 0 in category .Xfrout - - When I query statistics axfr_running of bind10 module Xfrout with cmdctl port 47804 - The statistics counters are 0 in category .Xfrout - + check initial statistics for Xfrout 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 | item_name | min_value | max_value | @@ -156,12 +127,7 @@ Feature: Xfrin incoming notify handling # # Test6 for Xfrin statistics # - # check initial statistics - # - When I query statistics zones of bind10 module Xfrin with cmdctl - last bindctl output should not contain "error" - The statistics counters are 0 in category .Xfrin.zones._SERVER_ - + check initial statistics for Xfrin # # set transfer_acl rejection # Local xfr requests from Xfrin module would be rejected here.