<p>Kevin Harwell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/9284">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">apps/statsd: Update tests to use new condition based matching<br><br>The apps/statsd tests were written in a way that did not allow for flexible<br>message matching. A previous patch added condition based message handling and<br>matching routines that allow greater flexibility in matching messages.<br><br>This patch updates the apps/statsd tests to take advantage of that.<br><br>Change-Id: I36de44a6dd508ba11b8f70a146592b0cbe814638<br>---<br>M tests/apps/statsd/nominal/test-config.yaml<br>M tests/apps/statsd/off-nominal/empty_params/test-config.yaml<br>M tests/apps/statsd/off-nominal/invalid_metric/test-config.yaml<br>M tests/apps/statsd/off-nominal/invalid_sample_rate/test-config.yaml<br>M tests/apps/statsd/off-nominal/invalid_value/test-config.yaml<br>M tests/apps/statsd/off-nominal/invalid_variable/test-config.yaml<br>M tests/apps/statsd/off-nominal/no_metric/test-config.yaml<br>M tests/apps/statsd/off-nominal/no_value/test-config.yaml<br>M tests/apps/statsd/off-nominal/no_variable/test-config.yaml<br>9 files changed, 86 insertions(+), 61 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/84/9284/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/apps/statsd/nominal/test-config.yaml b/tests/apps/statsd/nominal/test-config.yaml<br>index 81d7b04..14f2969 100644<br>--- a/tests/apps/statsd/nominal/test-config.yaml<br>+++ b/tests/apps/statsd/nominal/test-config.yaml<br>@@ -12,8 +12,8 @@<br> typename: 'test_case.TestCaseModule'<br> modules:<br> -<br>- typename: 'mockd.MockDServer'<br>- config-section: 'statsd-config'<br>+ config-section: event-action-config<br>+ typename: 'pluggable_modules.EventActionModule'<br> -<br> typename: 'pluggable_modules.Originator'<br> config-section: 'originator-config'<br>@@ -23,17 +23,18 @@<br> connect-ami: True<br> reactor-timeout: 15<br> <br>-statsd-config:<br>- prefix: nominal<br>- packets:<br>- -<br>- 'nominal.foo:1|g'<br>- -<br>- 'nominal.bar:2|s'<br>- -<br>- 'nominal.baz:3|ms'<br>- -<br>- 'nominal.last:4|c'<br>+event-action-config:<br>+ event:<br>+ type: 'matcher_listener.Udp'<br>+ conditions:<br>+ -<br>+ 'nominal.foo:1|g'<br>+ -<br>+ 'nominal.bar:2|s'<br>+ -<br>+ 'nominal.baz:3|ms'<br>+ -<br>+ 'nominal.last:4|c'<br> <br> originator-config:<br> channel: 'Local/start@default'<br>diff --git a/tests/apps/statsd/off-nominal/empty_params/test-config.yaml b/tests/apps/statsd/off-nominal/empty_params/test-config.yaml<br>index 2934e56..2411a11 100644<br>--- a/tests/apps/statsd/off-nominal/empty_params/test-config.yaml<br>+++ b/tests/apps/statsd/off-nominal/empty_params/test-config.yaml<br>@@ -11,8 +11,8 @@<br> typename: 'test_case.TestCaseModule'<br> modules:<br> -<br>- typename: 'mockd.MockDServer'<br>- config-section: 'statsd-config'<br>+ config-section: event-action-config<br>+ typename: 'pluggable_modules.EventActionModule'<br> -<br> typename: 'pluggable_modules.Originator'<br> config-section: 'originator-config'<br>@@ -22,10 +22,13 @@<br> connect-ami: True<br> reactor-timeout: 15<br> <br>-statsd-config:<br>- packets:<br>- -<br>- 'ReceiveNothing'<br>+event-action-config:<br>+ event:<br>+ type: 'matcher_listener.Udp'<br>+ conditions:<br>+ -<br>+ match: '.*'<br>+ count: 0<br> <br> originator-config:<br> channel: 'Local/start@default'<br>diff --git a/tests/apps/statsd/off-nominal/invalid_metric/test-config.yaml b/tests/apps/statsd/off-nominal/invalid_metric/test-config.yaml<br>index 822fd78..136a050 100644<br>--- a/tests/apps/statsd/off-nominal/invalid_metric/test-config.yaml<br>+++ b/tests/apps/statsd/off-nominal/invalid_metric/test-config.yaml<br>@@ -11,8 +11,8 @@<br> typename: 'test_case.TestCaseModule'<br> modules:<br> -<br>- typename: 'mockd.MockDServer'<br>- config-section: 'statsd-config'<br>+ config-section: event-action-config<br>+ typename: 'pluggable_modules.EventActionModule'<br> -<br> typename: 'pluggable_modules.Originator'<br> config-section: 'originator-config'<br>@@ -22,10 +22,13 @@<br> connect-ami: True<br> reactor-timeout: 15<br> <br>-statsd-config:<br>- packets:<br>- -<br>- 'ReceiveNothing'<br>+event-action-config:<br>+ event:<br>+ type: 'matcher_listener.Udp'<br>+ conditions:<br>+ -<br>+ match: '.*'<br>+ count: 0<br> <br> originator-config:<br> channel: 'Local/start@default'<br>diff --git a/tests/apps/statsd/off-nominal/invalid_sample_rate/test-config.yaml b/tests/apps/statsd/off-nominal/invalid_sample_rate/test-config.yaml<br>index 1978a4c..8a984c1 100644<br>--- a/tests/apps/statsd/off-nominal/invalid_sample_rate/test-config.yaml<br>+++ b/tests/apps/statsd/off-nominal/invalid_sample_rate/test-config.yaml<br>@@ -11,8 +11,8 @@<br> typename: 'test_case.TestCaseModule'<br> modules:<br> -<br>- typename: 'mockd.MockDServer'<br>- config-section: 'statsd-config'<br>+ config-section: event-action-config<br>+ typename: 'pluggable_modules.EventActionModule'<br> -<br> typename: 'pluggable_modules.Originator'<br> config-section: 'originator-config'<br>@@ -22,10 +22,13 @@<br> connect-ami: True<br> reactor-timeout: 15<br> <br>-statsd-config:<br>- packets:<br>- -<br>- 'ReceiveNothing'<br>+event-action-config:<br>+ event:<br>+ type: 'matcher_listener.Udp'<br>+ conditions:<br>+ -<br>+ match: '.*'<br>+ count: 0<br> <br> originator-config:<br> channel: 'Local/start@default'<br>diff --git a/tests/apps/statsd/off-nominal/invalid_value/test-config.yaml b/tests/apps/statsd/off-nominal/invalid_value/test-config.yaml<br>index 6124f37..665d6c5 100644<br>--- a/tests/apps/statsd/off-nominal/invalid_value/test-config.yaml<br>+++ b/tests/apps/statsd/off-nominal/invalid_value/test-config.yaml<br>@@ -11,8 +11,8 @@<br> typename: 'test_case.TestCaseModule'<br> modules:<br> -<br>- typename: 'mockd.MockDServer'<br>- config-section: 'statsd-config'<br>+ config-section: event-action-config<br>+ typename: 'pluggable_modules.EventActionModule'<br> -<br> typename: 'pluggable_modules.Originator'<br> config-section: 'originator-config'<br>@@ -22,10 +22,13 @@<br> connect-ami: True<br> reactor-timeout: 15<br> <br>-statsd-config:<br>- packets:<br>- -<br>- 'ReceiveNothing'<br>+event-action-config:<br>+ event:<br>+ type: 'matcher_listener.Udp'<br>+ conditions:<br>+ -<br>+ match: '.*'<br>+ count: 0<br> <br> originator-config:<br> channel: 'Local/start@default'<br>diff --git a/tests/apps/statsd/off-nominal/invalid_variable/test-config.yaml b/tests/apps/statsd/off-nominal/invalid_variable/test-config.yaml<br>index 16da613..ef8bc27 100644<br>--- a/tests/apps/statsd/off-nominal/invalid_variable/test-config.yaml<br>+++ b/tests/apps/statsd/off-nominal/invalid_variable/test-config.yaml<br>@@ -11,8 +11,8 @@<br> typename: 'test_case.TestCaseModule'<br> modules:<br> -<br>- typename: 'mockd.MockDServer'<br>- config-section: 'statsd-config'<br>+ config-section: event-action-config<br>+ typename: 'pluggable_modules.EventActionModule'<br> -<br> typename: 'pluggable_modules.Originator'<br> config-section: 'originator-config'<br>@@ -22,10 +22,13 @@<br> connect-ami: True<br> reactor-timeout: 15<br> <br>-statsd-config:<br>- packets:<br>- -<br>- 'ReceiveNothing'<br>+event-action-config:<br>+ event:<br>+ type: 'matcher_listener.Udp'<br>+ conditions:<br>+ -<br>+ match: '.*'<br>+ count: 0<br> <br> originator-config:<br> channel: 'Local/start@default'<br>diff --git a/tests/apps/statsd/off-nominal/no_metric/test-config.yaml b/tests/apps/statsd/off-nominal/no_metric/test-config.yaml<br>index 8b5692e..acc3109 100644<br>--- a/tests/apps/statsd/off-nominal/no_metric/test-config.yaml<br>+++ b/tests/apps/statsd/off-nominal/no_metric/test-config.yaml<br>@@ -11,8 +11,8 @@<br> typename: 'test_case.TestCaseModule'<br> modules:<br> -<br>- typename: 'mockd.MockDServer'<br>- config-section: 'statsd-config'<br>+ config-section: event-action-config<br>+ typename: 'pluggable_modules.EventActionModule'<br> -<br> typename: 'pluggable_modules.Originator'<br> config-section: 'originator-config'<br>@@ -22,10 +22,13 @@<br> connect-ami: True<br> reactor-timeout: 15<br> <br>-statsd-config:<br>- packets:<br>- -<br>- 'ReceiveNothing'<br>+event-action-config:<br>+ event:<br>+ type: 'matcher_listener.Udp'<br>+ conditions:<br>+ -<br>+ match: '.*'<br>+ count: 0<br> <br> originator-config:<br> channel: 'Local/start@default'<br>diff --git a/tests/apps/statsd/off-nominal/no_value/test-config.yaml b/tests/apps/statsd/off-nominal/no_value/test-config.yaml<br>index ad8f1e2..cf848d5 100644<br>--- a/tests/apps/statsd/off-nominal/no_value/test-config.yaml<br>+++ b/tests/apps/statsd/off-nominal/no_value/test-config.yaml<br>@@ -11,8 +11,8 @@<br> typename: 'test_case.TestCaseModule'<br> modules:<br> -<br>- typename: 'mockd.MockDServer'<br>- config-section: 'statsd-config'<br>+ config-section: event-action-config<br>+ typename: 'pluggable_modules.EventActionModule'<br> -<br> typename: 'pluggable_modules.Originator'<br> config-section: 'originator-config'<br>@@ -22,10 +22,13 @@<br> connect-ami: True<br> reactor-timeout: 15<br> <br>-statsd-config:<br>- packets:<br>- -<br>- 'ReceiveNothing'<br>+event-action-config:<br>+ event:<br>+ type: 'matcher_listener.Udp'<br>+ conditions:<br>+ -<br>+ match: '.*'<br>+ count: 0<br> <br> originator-config:<br> channel: 'Local/start@default'<br>diff --git a/tests/apps/statsd/off-nominal/no_variable/test-config.yaml b/tests/apps/statsd/off-nominal/no_variable/test-config.yaml<br>index 9b6053e..9d4f5fc 100644<br>--- a/tests/apps/statsd/off-nominal/no_variable/test-config.yaml<br>+++ b/tests/apps/statsd/off-nominal/no_variable/test-config.yaml<br>@@ -13,8 +13,8 @@<br> typename: 'test_case.TestCaseModule'<br> modules:<br> -<br>- typename: 'mockd.MockDServer'<br>- config-section: 'statsd-config'<br>+ config-section: event-action-config<br>+ typename: 'pluggable_modules.EventActionModule'<br> -<br> typename: 'pluggable_modules.Originator'<br> config-section: 'originator-config'<br>@@ -24,10 +24,13 @@<br> connect-ami: True<br> reactor-timeout: 15<br> <br>-statsd-config:<br>- packets:<br>- -<br>- 'ReceiveNothing'<br>+event-action-config:<br>+ event:<br>+ type: 'matcher_listener.Udp'<br>+ conditions:<br>+ -<br>+ match: '.*'<br>+ count: 0<br> <br> originator-config:<br> channel: 'Local/start@default'<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9284">change 9284</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/9284"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I36de44a6dd508ba11b8f70a146592b0cbe814638 </div>
<div style="display:none"> Gerrit-Change-Number: 9284 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>