<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/19437">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span></span><br></pre><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">cdr: Add tests for ignore options.<br><br>Adds tests for the ignorestatechanges<br>and ignoredialchanges options in cdr.conf.<br><br>ASTERISK-30091<br><br>Change-Id: Idbb65c8427284d13c8a8a08739d2eb5f3f8d36b6<br>---<br>A tests/cdr/cdr_manipulation/cdr_ignore_dial_changes/configs/ast1/cdr.conf<br>A tests/cdr/cdr_manipulation/cdr_ignore_dial_changes/configs/ast1/extensions.conf<br>A tests/cdr/cdr_manipulation/cdr_ignore_dial_changes/test-config.yaml<br>A tests/cdr/cdr_manipulation/cdr_ignore_state_changes/configs/ast1/cdr.conf<br>A tests/cdr/cdr_manipulation/cdr_ignore_state_changes/configs/ast1/extensions.conf<br>A tests/cdr/cdr_manipulation/cdr_ignore_state_changes/test-config.yaml<br>M tests/cdr/cdr_manipulation/tests.yaml<br>7 files changed, 161 insertions(+), 0 deletions(-)<br><br></pre>
<pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/cdr/cdr_manipulation/cdr_ignore_dial_changes/configs/ast1/cdr.conf b/tests/cdr/cdr_manipulation/cdr_ignore_dial_changes/configs/ast1/cdr.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..28fba7c</span><br><span>--- /dev/null</span><br><span>+++ b/tests/cdr/cdr_manipulation/cdr_ignore_dial_changes/configs/ast1/cdr.conf</span><br><span>@@ -0,0 +1,10 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+enable=yes</span><br><span style="color: hsl(120, 100%, 40%);">+debug=yes</span><br><span style="color: hsl(120, 100%, 40%);">+ignorestatechanges=yes</span><br><span style="color: hsl(120, 100%, 40%);">+ignoredialchanges=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[csv]</span><br><span style="color: hsl(120, 100%, 40%);">+usegmtime=yes ; log date/time in GMT. Default is "no"</span><br><span style="color: hsl(120, 100%, 40%);">+loguniqueid=yes ; log uniqueid. Default is "no"</span><br><span style="color: hsl(120, 100%, 40%);">+loguserfield=yes ; log user field. Default is "no"</span><br><span>diff --git a/tests/cdr/cdr_manipulation/cdr_ignore_dial_changes/configs/ast1/extensions.conf b/tests/cdr/cdr_manipulation/cdr_ignore_dial_changes/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..9e97338</span><br><span>--- /dev/null</span><br><span>+++ b/tests/cdr/cdr_manipulation/cdr_ignore_dial_changes/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,21 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Set(CDR_PROP(disable)=1)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Echo()</span><br><span style="color: hsl(120, 100%, 40%);">+exten => nodialchanges,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Set(CDR_PROP(disable)=0)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Dial(Local/target@default/n,,g)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Dial(Local/valid@default/n,,g)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Dial(Local/valid@default/n,,g)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Hangup()</span><br><span style="color: hsl(120, 100%, 40%);">+exten => target,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Set(CDR_PROP(disable)=1)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Wait(0.1)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Hangup()</span><br><span style="color: hsl(120, 100%, 40%);">+exten => valid,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Set(CDR_PROP(disable)=1)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Wait(0.1)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Hangup()</span><br><span>diff --git a/tests/cdr/cdr_manipulation/cdr_ignore_dial_changes/test-config.yaml b/tests/cdr/cdr_manipulation/cdr_ignore_dial_changes/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..29abee0</span><br><span>--- /dev/null</span><br><span>+++ b/tests/cdr/cdr_manipulation/cdr_ignore_dial_changes/test-config.yaml</span><br><span>@@ -0,0 +1,46 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test ignoredialchanges'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'This test makes sure that dial state changes</span><br><span style="color: hsl(120, 100%, 40%);">+ do not affect the CDR when the ignoredialchanges</span><br><span style="color: hsl(120, 100%, 40%);">+ option is set to yes.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: 'test-object-config'</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'test_case.SimpleTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: 'cdr-config'</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'cdr.CDRModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ spawn-after-hangup: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ channel: 'Local/nodialchanges@default'</span><br><span style="color: hsl(120, 100%, 40%);">+ context: 'default'</span><br><span style="color: hsl(120, 100%, 40%);">+ exten: 'echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ priority: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+cdr-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ file: 'Master'</span><br><span style="color: hsl(120, 100%, 40%);">+ lines:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ destination: 'nodialchanges'</span><br><span style="color: hsl(120, 100%, 40%);">+ dcontext: 'default'</span><br><span style="color: hsl(120, 100%, 40%);">+ channel: 'Local/nodialchanges@default-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ disposition: 'ANSWERED'</span><br><span style="color: hsl(120, 100%, 40%);">+ amaflags: 'DOCUMENTATION'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - python: 'twisted'</span><br><span style="color: hsl(120, 100%, 40%);">+ - python: 'starpy'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'app_echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'func_cdr'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - CDR</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/cdr/cdr_manipulation/cdr_ignore_state_changes/configs/ast1/cdr.conf b/tests/cdr/cdr_manipulation/cdr_ignore_state_changes/configs/ast1/cdr.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..fdd1b80</span><br><span>--- /dev/null</span><br><span>+++ b/tests/cdr/cdr_manipulation/cdr_ignore_state_changes/configs/ast1/cdr.conf</span><br><span>@@ -0,0 +1,9 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[general]</span><br><span style="color: hsl(120, 100%, 40%);">+enable=yes</span><br><span style="color: hsl(120, 100%, 40%);">+debug=yes</span><br><span style="color: hsl(120, 100%, 40%);">+ignorestatechanges=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[csv]</span><br><span style="color: hsl(120, 100%, 40%);">+usegmtime=yes ; log date/time in GMT. Default is "no"</span><br><span style="color: hsl(120, 100%, 40%);">+loguniqueid=yes ; log uniqueid. Default is "no"</span><br><span style="color: hsl(120, 100%, 40%);">+loguserfield=yes ; log user field. Default is "no"</span><br><span>diff --git a/tests/cdr/cdr_manipulation/cdr_ignore_state_changes/configs/ast1/extensions.conf b/tests/cdr/cdr_manipulation/cdr_ignore_state_changes/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..9369947</span><br><span>--- /dev/null</span><br><span>+++ b/tests/cdr/cdr_manipulation/cdr_ignore_state_changes/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,13 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Set(CDR_PROP(disable)=1)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Echo()</span><br><span style="color: hsl(120, 100%, 40%);">+exten => nostatechanges,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Set(CDR_PROP(disable)=0)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Set(CONFBRIDGE(user,quiet)=yes) ; suppress prompts to speed up the test</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Set(CONFBRIDGE(user,timeout)=1)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,ConfBridge(test)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,ConfBridge(test)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,ConfBridge(test)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Hangup()</span><br><span>diff --git a/tests/cdr/cdr_manipulation/cdr_ignore_state_changes/test-config.yaml b/tests/cdr/cdr_manipulation/cdr_ignore_state_changes/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..fcd0752</span><br><span>--- /dev/null</span><br><span>+++ b/tests/cdr/cdr_manipulation/cdr_ignore_state_changes/test-config.yaml</span><br><span>@@ -0,0 +1,46 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test ignorestatechanges'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'This test makes sure that bridging changes, such</span><br><span style="color: hsl(120, 100%, 40%);">+ as entering and leaving bridges like ConfBridge, do not affect the</span><br><span style="color: hsl(120, 100%, 40%);">+ CDR when the ignorestatechanges option is set to yes.'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: 'test-object-config'</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'test_case.SimpleTestCase'</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: 'cdr-config'</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'cdr.CDRModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ spawn-after-hangup: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ channel: 'Local/nostatechanges@default'</span><br><span style="color: hsl(120, 100%, 40%);">+ context: 'default'</span><br><span style="color: hsl(120, 100%, 40%);">+ exten: 'echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ priority: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+cdr-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ file: 'Master'</span><br><span style="color: hsl(120, 100%, 40%);">+ lines:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ destination: 'nostatechanges'</span><br><span style="color: hsl(120, 100%, 40%);">+ dcontext: 'default'</span><br><span style="color: hsl(120, 100%, 40%);">+ channel: 'Local/nostatechanges@default-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ disposition: 'ANSWERED'</span><br><span style="color: hsl(120, 100%, 40%);">+ amaflags: 'DOCUMENTATION'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - python: 'twisted'</span><br><span style="color: hsl(120, 100%, 40%);">+ - python: 'starpy'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'app_echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'func_cdr'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - CDR</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/cdr/cdr_manipulation/tests.yaml b/tests/cdr/cdr_manipulation/tests.yaml</span><br><span>index 46a74bd..5e5bb0d 100644</span><br><span>--- a/tests/cdr/cdr_manipulation/tests.yaml</span><br><span>+++ b/tests/cdr/cdr_manipulation/tests.yaml</span><br><span>@@ -6,3 +6,5 @@</span><br><span> - test: 'nocdr'</span><br><span> - test: 'cdr_prop_disable'</span><br><span> - test: 'func_cdr'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'cdr_ignore_state_changes'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'cdr_ignore_dial_changes'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/19437">change 19437</a>. To unsubscribe, or for help writing mail filters, 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/c/testsuite/+/19437"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 20 </div>
<div style="display:none"> Gerrit-Change-Id: Idbb65c8427284d13c8a8a08739d2eb5f3f8d36b6 </div>
<div style="display:none"> Gerrit-Change-Number: 19437 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>