<p>Friendly Automation <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/11323">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Friendly Automation: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">testsuite: Fix event checking for poll_sub_unsub test.<br><br>Initially, this test checked the ContactStatus event to trigger the rest<br>of the events for the test. This was fine for 13, but the values in the<br>event are different in 16 and master, causing the test to fail on those<br>versions. This changes the test to check for the<br>AOR_CONTACT_ADDED/REMOVED TestEvents, and verify the contact field on<br>that event instead.<br><br>Change-Id: Ia8f851874a9517ad7466f67937e1b83c1c11e577<br>---<br>M tests/apps/voicemail/polling/poll_sub_unsub/run-test<br>1 file changed, 10 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/apps/voicemail/polling/poll_sub_unsub/run-test b/tests/apps/voicemail/polling/poll_sub_unsub/run-test</span><br><span>index c77827e..30dd98e 100755</span><br><span>--- a/tests/apps/voicemail/polling/poll_sub_unsub/run-test</span><br><span>+++ b/tests/apps/voicemail/polling/poll_sub_unsub/run-test</span><br><span>@@ -72,24 +72,27 @@</span><br><span>         if "Local/playback@default" in event.get("channel"):</span><br><span>             self.stop_test(True)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    def handle_contact_status(self, ami, event):</span><br><span style="color: hsl(120, 100%, 40%);">+    def handle_test_event(self, ami, event):</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        if event.get("aor") != "1234":</span><br><span style="color: hsl(120, 100%, 40%);">+        state = event.get("state")</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        if state != "AOR_CONTACT_ADDED" and state != "AOR_CONTACT_REMOVED":</span><br><span>             return</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        status = event.get("contactstatus")</span><br><span style="color: hsl(120, 100%, 40%);">+        if event.get("contact") != "sip:1234@127.0.0.2:5061":</span><br><span style="color: hsl(120, 100%, 40%);">+            return</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        if status == "Created":</span><br><span style="color: hsl(120, 100%, 40%);">+        if state == "AOR_CONTACT_ADDED":</span><br><span>             self.voicemailManager = VoiceMailMailboxManagement(self.ast[0])</span><br><span>             self.voicemailManager.create_mailbox("default", "1234", True)</span><br><span>             formats = ["ulaw"]</span><br><span>             if not self.voicemailManager.create_dummy_voicemail("default", "1234", VoiceMailMailboxManagement.inbox_folder_name, 1, formats):</span><br><span>                 LOGGER.error("Failed to create voicemail")</span><br><span>                 self.stop_test()</span><br><span style="color: hsl(0, 100%, 40%);">-        elif status == "Removed":</span><br><span style="color: hsl(120, 100%, 40%);">+        elif state == "AOR_CONTACT_REMOVED":</span><br><span>             # Remove the voicemail from the mailbox</span><br><span>             self.voicemailManager.remove_mailbox("default", "1234")</span><br><span style="color: hsl(0, 100%, 40%);">-            </span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>             # Originate a channel that will end the test on hangup</span><br><span>             variable = {}</span><br><span>             ami.originate(channel="Local/playback@default",</span><br><span>@@ -101,7 +104,7 @@</span><br><span> </span><br><span>     def ami_connect(self, ami):</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        ami.registerEvent("ContactStatus", self.handle_contact_status)</span><br><span style="color: hsl(120, 100%, 40%);">+        ami.registerEvent("TestEvent", self.handle_test_event)</span><br><span>         ami.registerEvent("MessageWaiting", self.handle_message_waiting)</span><br><span>         ami.registerEvent("Hangup", self.handle_hangup)</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/11323">change 11323</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/+/11323"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: Ia8f851874a9517ad7466f67937e1b83c1c11e577 </div>
<div style="display:none"> Gerrit-Change-Number: 11323 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>