[Asterisk-code-review] Testsuite: batched rls subscription failure (testsuite[master])

Ashley Sanders asteriskteam at digium.com
Wed Oct 14 10:14:34 CDT 2015


Ashley Sanders has uploaded a new change for review.

  https://gerrit.asterisk.org/1438

Change subject: Testsuite: batched rls subscription failure
......................................................................

Testsuite: batched rls subscription failure

While this does not actually correct the issue with the test failure (which
incidentally turns out is not localized to this test), this patch modifies the
the test harness by renaming the test to a consistent name with respect to
its module. The issue was in that there were two classes in two modules, one
was the harness, the other was the validator, but the names were subverted and
it was getting difficult to keep them straight when debugging.
Also, this patch includes missing or more thorough docstrings such that the
intent of the class and its methods is more obvious.

This is part two (2) of an n-patch series of refactorings to help determine the
root cause of the test failure and correct pylint issues.

ASTERISK-25430
Reported By: Ashley Sanders

Change-Id: Ie3af00440aa011786afd3241bae27d39c3518079
---
M tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/basic/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/multiple_resources_single_change/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/resubscription_interruption/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/single_resource_multiple_changes/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/termination_interruption/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/full_state/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/initial_notify/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/partial_state/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/resubscribe_full_state/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/termination_full_state/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/basic/driver.py
M tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/basic/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/multiple_resources_single_change/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/resubscription_interruption/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/single_resource_multiple_changes/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/termination_interruption/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/full_state/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/initial_notify/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/partial_state/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/resubscribe_full_state/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/termination_full_state/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/off_nominal/mwi/resource_duplication/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/off_nominal/mwi/some_list_resources_exist/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/off_nominal/presence/resource_duplication/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists/off_nominal/presence/some_list_resources_exist/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/batched/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/full_state_alice/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/full_state_carol/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/initial_notify/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/partial_state_alice/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/partial_state_carol/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/resubscribe_full_state/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/termination_full_state/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/batched/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/full_state_alice/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/full_state_carol/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/initial_notify/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/listception_initial_notify/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/partial_state_alice/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/partial_state_carol/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/resubscribe_full_state/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/termination_full_state/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/mwi/resource_duplication/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/mwi/shared_name_w_list_support/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/presence/resource_duplication/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/presence/shared_name_w_list_support/test-config.yaml
M tests/channels/pjsip/subscriptions/rls/rls_test.py
47 files changed, 330 insertions(+), 122 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/38/1438/1

diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/basic/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/basic/test-config.yaml
index 2deddcb..5376496 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/basic/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/basic/test-config.yaml
@@ -42,7 +42,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
         -
             typename: 'driver.TestDriver'
 
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/multiple_resources_single_change/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/multiple_resources_single_change/test-config.yaml
index 83bf82f..0fe179f 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/multiple_resources_single_change/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/multiple_resources_single_change/test-config.yaml
@@ -36,7 +36,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
         -
             typename: 'driver.TestDriver'
 
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/resubscription_interruption/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/resubscription_interruption/test-config.yaml
index dfb7949..8739cd3 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/resubscription_interruption/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/resubscription_interruption/test-config.yaml
@@ -38,7 +38,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
         -
             typename: 'driver.TestDriver'
 
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/single_resource_multiple_changes/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/single_resource_multiple_changes/test-config.yaml
index 1a7bed0..6739142 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/single_resource_multiple_changes/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/single_resource_multiple_changes/test-config.yaml
@@ -36,7 +36,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
         -
             typename: 'driver.TestDriver'
 
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/termination_interruption/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/termination_interruption/test-config.yaml
index b0cc651..331213b 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/termination_interruption/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/termination_interruption/test-config.yaml
@@ -38,7 +38,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
         -
             typename: 'driver.TestDriver'
 
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/full_state/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/full_state/test-config.yaml
index c066da5..27b0a10 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/full_state/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/full_state/test-config.yaml
@@ -35,7 +35,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/initial_notify/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/initial_notify/test-config.yaml
index 694ad41..0db7841 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/initial_notify/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/initial_notify/test-config.yaml
@@ -48,7 +48,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/partial_state/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/partial_state/test-config.yaml
index 3ba717d..9afb9b0 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/partial_state/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/partial_state/test-config.yaml
@@ -35,7 +35,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/resubscribe_full_state/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/resubscribe_full_state/test-config.yaml
index 49bfadd..0640d21 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/resubscribe_full_state/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/resubscribe_full_state/test-config.yaml
@@ -35,7 +35,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/termination_full_state/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/termination_full_state/test-config.yaml
index 90a533f..55fff97 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/termination_full_state/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/mwi/termination_full_state/test-config.yaml
@@ -36,7 +36,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/basic/driver.py b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/basic/driver.py
index b961a85..9b46149 100755
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/basic/driver.py
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/basic/driver.py
@@ -1,4 +1,11 @@
 #!/usr/bin/env python
+"""
+Copyright (C) 2015, Digium, Inc.
+Mark Michelson <mmichelson at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+"""
 
 import time
 import logging
@@ -24,30 +31,218 @@
 # This state is entered after Bob's device state NOTIFY has been received.
 BOB_STATE = 5
 
-# This state is entered after SUBSCRIBE-NOTIFY exchange to terminate
-# subscription has occurred.
-TERMINATED = 6
+def named_constant_to_text(state):
+    """Converts a named state constant to textual representation.
+
+    Keyword Arguments:
+    state                      -- The named state constant.
+
+    Returns:
+    A string representing the named constant.
+    """
+
+    if state == UNESTABLISHED:
+        return 'UNESTABLISHED'
+    elif state == ESTABLISHED:
+        return 'ESTABLISHED'
+    elif state == ALICE_STATE:
+        return 'ALICE_STATE'
+    elif state == REFRESHED:
+        return 'REFRESHED'
+    elif state == BOB_STATE:
+        return 'BOB_STATE'
+    return 'UNKNOWN'
+
+def build_users_list():
+    """Builds the list of users.
+
+    Returns:
+    A list of TestUser objects.
+    """
+
+    users = list()
+
+    for info in [('Alice', ESTABLISHED), ('Bob', REFRESHED)]:
+        name = info[0]
+        user = TestUser(name,
+                        info[1],
+                        globals()[name.upper() + '_STATE'])
+        users.append(user)
+    return users
+
+
+class TestUser(object):
+    """A test user.
+
+    This class is responsbile for keeping track of the start/end states,
+    transition time interval, and current state for a SipPScenario actor.
+    """
+
+    def __init__(self, name, start_state, end_state):
+        """Constructor.
+
+        Keyword Arguments:
+        name                   -- The name for this TestUser instance
+        start_state            -- The state to use when this user is activated.
+        end_state              -- The state to use when this user is
+                                  deactivated.
+        """
+
+        self.name = name
+        self.state = UNESTABLISHED
+        self.__start_state = start_state
+        self.__end_state = end_state
+        self.__start_time = 0.0
+        self.__end_time = 0.0
+
+    def activate(self, ami):
+        """Activates this TestUser.
+
+        This will update the state of the user to the start_state and send an
+        AMI message which triggers the SipPScenario to transition its state."""
+
+        message = "Activating user: {0}."
+        LOGGER.debug(message.format(self.name))
+
+        self.state = self.__start_state
+        self.__start_time = time.time()
+
+        ami_message = {
+            'Action': 'SetVar',
+            'Variable': 'DEVICE_STATE(Custom:{0})'.format(self.name.lower()),
+            'Value': 'InUse'
+        }
+        ami.sendMessage(ami_message)
+
+    def deactivate(self):
+        """Deactivates this TestUser."""
+
+        message = "Deactivating user: {0}."
+        LOGGER.debug(message.format(self.name))
+
+        self.state = self.__end_state
+        self.__end_time = time.time()
+
+    def check_elapsed_time(self):
+        """Checks the elapsed between acitvation and deactivation."""
+
+        message = "Checking time interval for {0}."
+        LOGGER.debug(message.format(self.name))
+
+        message = "Time interval for {0}: {1}. Check {2}."
+        interval = self.__end_time - self.__start_time
+        if interval < 5.0:
+            LOGGER.error(message.format(self.name, interval, "failed"))
+            return False
+
+        LOGGER.debug(message.format(self.name, interval, "passed"))
+        return True
 
 
 class TestDriver(object):
+    """The driver for the test.
+
+    This class is responsbile for initiating the state changes for the
+    SipPScenario actors.
+    """
+
     def __init__(self, module_config, test_object):
+        """Constructor.
+
+        Keyword Arguments:
+        module_config          -- The YAML configuration for this test.
+        test_object            -- The TestCaseModule instance for this test.
+        """
+
         self.ami = None
-        self.state = UNESTABLISHED
         self.test_object = test_object
-        self.alice_time = 0.0
-        self.bob_time = 0.0
-        test_object.register_ami_observer(self.ami_connect)
+
+        self.__current_user = None
+        self.__users = build_users_list()
+        self.__iterator = iter(self.__users)
+
+        test_object.register_ami_observer(self.on_ami_connect)
+
+    def check_state(self, valid_states):
+        """Checks the state of the test.
+
+        Keyword Arguments:
+        valid_states           -- A list of states that are valid.
+
+        Returns:
+        True if the test state matches at least one of the valid states.
+        Otherwise, returns False.
+        """
+
+        current_state = self.get_state()
+        message = "Checking that the test state: {0} is valid."
+        LOGGER.debug(message.format(current_state))
+
+        for state in valid_states:
+            if state == current_state:
+                LOGGER.debug("Test state is valid.")
+                return True
+
+        states = \
+            ', or '.join([named_constant_to_text(x) for x in valid_states])
+        LOGGER.error("Unexpected test state. Expected: {0}.".format(states))
+        return False
 
     def fail_test(self):
+        """Fails the test."""
+
+        LOGGER.error("Failing the test.")
         self.test_object.set_passed(False)
         self.test_object.stop_reactor()
 
-    def ami_connect(self, ami):
-        self.ami = ami
-        self.ami.registerEvent('TestEvent', self.on_test_event)
+    def get_state(self):
+        """Gets the test state.
 
-    def on_test_event(self, ami, event):
+        Returns:
+        If the current user is None, this will return UNESTABLISHED. Otherwise,
+        the state of the current user is returned.
+        """
+
+        if self.__current_user is None:
+            return UNESTABLISHED
+
+        return self.__current_user.state
+
+    def log_state(self, caller):
+        """Logs the state of the test for a given caller.
+
+        Keyword Arguments:
+        caller                 -- The caller requesting the state to be logged.
+        """
+
+        message = "In {0}. self.state={1}."
+        LOGGER.debug(message.format(caller.__name__,
+                                    named_constant_to_text(self.get_state())))
+
+    def on_ami_connect(self, ami):
+        """Handles the AMI connect event.
+
+        Keyword Arguments:
+        ami                    -- The AMI instance that raised this event.
+        """
+
+        self.ami = ami
+        self.ami.registerEvent('TestEvent', self.on_ami_test_event)
+
+    def on_ami_test_event(self, ami, event):
+        """Handles an AMI TestEvent.
+
+        Routes the test data according to the state of the AMI event.
+
+        Keyword Arguments:
+        sender                 -- The ami instance that raised the event.
+        event                  -- The event payload.
+        """
+
         state = event['state']
+        message = "In self.on_test_event. event[state]={0}."
+        LOGGER.debug(message.format(state))
+
         if state == 'SUBSCRIPTION_ESTABLISHED':
             self.on_subscription_established()
         elif state == 'SUBSCRIPTION_REFRESHED':
@@ -55,70 +250,74 @@
         elif state == 'SUBSCRIPTION_TERMINATED':
             self.on_subscription_terminated()
         elif state == 'SUBSCRIPTION_STATE_CHANGED':
-            self.on_subscription_state_change()
+            self.on_subscription_state_changed()
 
     def on_subscription_established(self):
-        if self.state != UNESTABLISHED:
-            LOGGER.error("Unexpected state change from {0}. Expected state "
-                         "{1}".format(self.state, UNESTABLISHED))
+        """Handles an AMI 'SUBSCRIPTION_ESTABLISHED' TestEvent.
+
+        Verifies the current state matches the expected state and transitions
+        the TestUser.
+        """
+
+        self.log_state(self.on_subscription_established)
+        if not self.check_state([UNESTABLISHED]):
             self.fail_test()
-
-        LOGGER.debug("State change to {0}".format(ESTABLISHED))
-        self.state = ESTABLISHED
-        self.alice_time = time.time()
-        message = {
-            'Action': 'SetVar',
-            'Variable': 'DEVICE_STATE(Custom:alice)',
-            'Value': 'InUse'
-        }
-        self.ami.sendMessage(message)
-
-    def on_subscription_state_change(self):
-        if self.state != ESTABLISHED and self.state != REFRESHED:
-            LOGGER.error("Unexpected state change from {0}. Expected state "
-                         "{1} or {2}".format(self.state, ESTABLISHED,
-                                             REFRESHED))
-            self.fail_test()
-
-        if self.state == ESTABLISHED:
-            interval = time.time() - self.alice_time
-            if interval < 5.0:
-                LOGGER.error("Interval {0} too brief".format(interval))
-                self.fail_test()
-            LOGGER.debug("State change to {0}".format(ALICE_STATE))
-            self.state = ALICE_STATE
-        if self.state == REFRESHED:
-            interval = time.time() - self.bob_time
-            if time.time() - self.bob_time < 5.0:
-                LOGGER.error("Interval {0} too brief".format(interval))
-                self.fail_test()
-            LOGGER.debug("State change to {0}".format(BOB_STATE))
-            self.state = BOB_STATE
+        self.transition_user()
 
     def on_subscription_refreshed(self):
-        if self.state != ALICE_STATE:
-            LOGGER.error("Unexpected state change from {0}. Expected state "
-                         "{1}".format(self.state, ALICE_STATE))
+        """Handles an AMI 'SUBSCRIPTION_REFRESHED' TestEvent.
+
+        Verifies the current state matches the expected state and transitions
+        the TestUser.
+        """
+
+        self.log_state(self.on_subscription_refreshed)
+        if not self.check_state([ALICE_STATE]):
+            self.fail_test()
+        self.transition_user()
+
+    def on_subscription_state_changed(self):
+        """Handles an AMI 'SUBSCRIPTION_STATE_CHANGED' TestEvent.
+
+        Deactivates the current user and verifies that its time inteval
+        is greater than the tolerance level (5 seconds).
+        """
+
+        self.log_state(self.on_subscription_state_changed)
+        if not self.check_state([ESTABLISHED, REFRESHED]):
             self.fail_test()
 
-        LOGGER.debug("State change to {0}".format(REFRESHED))
-        self.state = REFRESHED
-        self.bob_time = time.time()
-        message = {
-            'Action': 'SetVar',
-            'Variable': 'DEVICE_STATE(Custom:bob)',
-            'Value': 'InUse'
-        }
-        self.ami.sendMessage(message)
+        self.__current_user.deactivate()
+        if not self.__current_user.check_elapsed_time():
+            self.fail_test()
 
     def on_subscription_terminated(self):
-        if self.state != BOB_STATE:
-            LOGGER.error("Unexpected state change from {0}. Expected state "
-                         "{1}".format(self.state, BOB_STATE))
+        """Handles an AMI SUBSCRIPTION_TERMINATED TestEvent.
+
+        Verifies that the final state matches the expected state (BOB_STATE)
+        and marks the test as passed or failed."""
+
+        self.log_state(self.on_subscription_terminated)
+        if not self.check_state([BOB_STATE]):
             self.fail_test()
 
-        LOGGER.debug("State change to {0}".format(TERMINATED))
-        self.state = TERMINATED
         # If we've made it here, then the test has passed!
         self.test_object.set_passed(True)
         self.test_object.stop_reactor()
+
+    def transition_user(self):
+        """ Transitions the current user to the next user in the list.
+
+        This will set the value of current_user to the next available user in
+        the list, or None, if we are at the end of the list. If we are at the
+        end of the list, nothing else is done. Otherwise, the current_user is
+        activated.
+        """
+
+        try:
+            self.__current_user = self.__iterator.next()
+        except StopIteration:
+            self.__current_user = None
+            return
+
+        self.__current_user.activate(self.ami)
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/basic/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/basic/test-config.yaml
index e10c845..c2a2f08 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/basic/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/basic/test-config.yaml
@@ -32,13 +32,15 @@
     add-to-search-path:
         -
             'tests/channels/pjsip/subscriptions/rls'
+    reactor-timeout: 25
+    fail-on-any: 'True'
     test-object:
         config-section: 'test-case-config'
         typename: 'sipp.SIPpTestCase'
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
         -
             typename: 'driver.TestDriver'
 
@@ -49,6 +51,7 @@
                 - { 'key-args': {'scenario': 'subscribe.xml', '-i': '127.0.0.1', '-p': '5061', '-s': 'pres_list'} }
 
 test-config:
+    stop_test_notifys: False
     list_name: 'pres_list'
     resources:
         -
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/multiple_resources_single_change/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/multiple_resources_single_change/test-config.yaml
index 58d275d..3bfad9c 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/multiple_resources_single_change/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/multiple_resources_single_change/test-config.yaml
@@ -32,7 +32,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
         -
             typename: 'driver.TestDriver'
 
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/resubscription_interruption/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/resubscription_interruption/test-config.yaml
index 30d9b48..cb7fe3c 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/resubscription_interruption/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/resubscription_interruption/test-config.yaml
@@ -34,7 +34,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
         -
             typename: 'driver.TestDriver'
 
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/single_resource_multiple_changes/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/single_resource_multiple_changes/test-config.yaml
index 642b378..7a20ff8 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/single_resource_multiple_changes/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/single_resource_multiple_changes/test-config.yaml
@@ -32,7 +32,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
         -
             typename: 'driver.TestDriver'
 
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/termination_interruption/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/termination_interruption/test-config.yaml
index a4220d6..a8d1886 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/termination_interruption/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/batched/termination_interruption/test-config.yaml
@@ -34,7 +34,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
         -
             typename: 'driver.TestDriver'
 
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/full_state/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/full_state/test-config.yaml
index 9d32a89..752653b 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/full_state/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/full_state/test-config.yaml
@@ -32,7 +32,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/initial_notify/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/initial_notify/test-config.yaml
index a4df4c9..b876ed0 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/initial_notify/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/initial_notify/test-config.yaml
@@ -45,7 +45,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/partial_state/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/partial_state/test-config.yaml
index 0b09c6b..ce225fc 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/partial_state/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/partial_state/test-config.yaml
@@ -33,7 +33,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/resubscribe_full_state/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/resubscribe_full_state/test-config.yaml
index cd942c8..940030f 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/resubscribe_full_state/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/resubscribe_full_state/test-config.yaml
@@ -33,7 +33,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/termination_full_state/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/termination_full_state/test-config.yaml
index 6ebcba8..208fc8a 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/termination_full_state/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/nominal/presence/termination_full_state/test-config.yaml
@@ -34,7 +34,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/mwi/resource_duplication/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/mwi/resource_duplication/test-config.yaml
index 967e065..8733e76 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/mwi/resource_duplication/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/mwi/resource_duplication/test-config.yaml
@@ -30,7 +30,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/mwi/some_list_resources_exist/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/mwi/some_list_resources_exist/test-config.yaml
index 2f14b57..ebe8d28 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/mwi/some_list_resources_exist/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/mwi/some_list_resources_exist/test-config.yaml
@@ -31,7 +31,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/presence/resource_duplication/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/presence/resource_duplication/test-config.yaml
index 024e3ce..8e7503c 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/presence/resource_duplication/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/presence/resource_duplication/test-config.yaml
@@ -28,7 +28,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/presence/some_list_resources_exist/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/presence/some_list_resources_exist/test-config.yaml
index 80b3294..54dca2b 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/presence/some_list_resources_exist/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists/off_nominal/presence/some_list_resources_exist/test-config.yaml
@@ -29,7 +29,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/batched/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/batched/test-config.yaml
index 83b4d7e..9e0d9ed 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/batched/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/batched/test-config.yaml
@@ -37,7 +37,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
         -
             typename: 'driver.TestDriver'
 
@@ -55,7 +55,7 @@
                 'mail_list_b': {
                     'type': 'Multipart', 'state': 'active', 'sublist': {
                         'alice': {'type': 'MWI', 'state': 'active', 'voice_message': '0/0 (0/0)', 'messages_waiting': 'no'},
-                        'bob': {'type': 'MWI', 'state': 'active', 'voice_message': '0/0 (0/0)', 'messages_waiting': 'no'} 
+                        'bob': {'type': 'MWI', 'state': 'active', 'voice_message': '0/0 (0/0)', 'messages_waiting': 'no'}
                     }
                 }
             }
@@ -71,7 +71,7 @@
             {
                 'mail_list_b': {
                     'type': 'Multipart', 'state': 'active', 'sublist': {
-                        'bob': {'type': 'MWI', 'state': 'active', 'voice_message': '1/0 (0/0)', 'messages_waiting': 'yes'} 
+                        'bob': {'type': 'MWI', 'state': 'active', 'voice_message': '1/0 (0/0)', 'messages_waiting': 'yes'}
                     }
                 }
             }
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/full_state_alice/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/full_state_alice/test-config.yaml
index 65a031e..da0f7cf 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/full_state_alice/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/full_state_alice/test-config.yaml
@@ -35,7 +35,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/full_state_carol/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/full_state_carol/test-config.yaml
index 6d73d45..b17bbfb 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/full_state_carol/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/full_state_carol/test-config.yaml
@@ -35,7 +35,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/initial_notify/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/initial_notify/test-config.yaml
index ecb178a..695aea2 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/initial_notify/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/initial_notify/test-config.yaml
@@ -49,7 +49,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/partial_state_alice/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/partial_state_alice/test-config.yaml
index 22bc0c2..d005d54 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/partial_state_alice/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/partial_state_alice/test-config.yaml
@@ -35,7 +35,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/partial_state_carol/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/partial_state_carol/test-config.yaml
index 85ec420..32ac6bc 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/partial_state_carol/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/partial_state_carol/test-config.yaml
@@ -35,7 +35,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/resubscribe_full_state/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/resubscribe_full_state/test-config.yaml
index db704b4..34980b1 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/resubscribe_full_state/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/resubscribe_full_state/test-config.yaml
@@ -35,7 +35,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/termination_full_state/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/termination_full_state/test-config.yaml
index 2a54f24..06df276 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/termination_full_state/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/termination_full_state/test-config.yaml
@@ -37,7 +37,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/batched/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/batched/test-config.yaml
index c5884dc..e5e497e 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/batched/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/batched/test-config.yaml
@@ -34,7 +34,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
         -
             typename: 'driver.TestDriver'
 
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/full_state_alice/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/full_state_alice/test-config.yaml
index 424e9ee..9cd18fe 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/full_state_alice/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/full_state_alice/test-config.yaml
@@ -32,7 +32,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/full_state_carol/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/full_state_carol/test-config.yaml
index 89594b9..b290d40 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/full_state_carol/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/full_state_carol/test-config.yaml
@@ -32,7 +32,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/initial_notify/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/initial_notify/test-config.yaml
index ae1730c..765eff8 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/initial_notify/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/initial_notify/test-config.yaml
@@ -46,7 +46,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/listception_initial_notify/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/listception_initial_notify/test-config.yaml
index a188564..85762e4 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/listception_initial_notify/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/listception_initial_notify/test-config.yaml
@@ -27,7 +27,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/partial_state_alice/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/partial_state_alice/test-config.yaml
index 9772f8e..a49f46f 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/partial_state_alice/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/partial_state_alice/test-config.yaml
@@ -33,7 +33,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/partial_state_carol/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/partial_state_carol/test-config.yaml
index f3a4c40..eb43555 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/partial_state_carol/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/partial_state_carol/test-config.yaml
@@ -33,7 +33,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/resubscribe_full_state/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/resubscribe_full_state/test-config.yaml
index 47cb6ca..bf76826 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/resubscribe_full_state/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/resubscribe_full_state/test-config.yaml
@@ -33,7 +33,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/termination_full_state/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/termination_full_state/test-config.yaml
index 8754c7d..da0e653 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/termination_full_state/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/nominal/presence/termination_full_state/test-config.yaml
@@ -34,7 +34,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/mwi/resource_duplication/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/mwi/resource_duplication/test-config.yaml
index ad46a48..ac8cc65 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/mwi/resource_duplication/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/mwi/resource_duplication/test-config.yaml
@@ -52,7 +52,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/mwi/shared_name_w_list_support/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/mwi/shared_name_w_list_support/test-config.yaml
index 40c6b41..21e5584 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/mwi/shared_name_w_list_support/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/mwi/shared_name_w_list_support/test-config.yaml
@@ -51,7 +51,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/presence/resource_duplication/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/presence/resource_duplication/test-config.yaml
index 81cf5b7..207b50b 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/presence/resource_duplication/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/presence/resource_duplication/test-config.yaml
@@ -50,7 +50,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/presence/shared_name_w_list_support/test-config.yaml b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/presence/shared_name_w_list_support/test-config.yaml
index d1a65b1..cc55095 100644
--- a/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/presence/shared_name_w_list_support/test-config.yaml
+++ b/tests/channels/pjsip/subscriptions/rls/lists_of_lists/off_nominal/presence/shared_name_w_list_support/test-config.yaml
@@ -46,7 +46,7 @@
     modules:
         -
             config-section: 'test-config'
-            typename: 'rls_test.IntegrityCheck'
+            typename: 'rls_test.RLSTest'
 
 test-case-config:
     test-iterations:
diff --git a/tests/channels/pjsip/subscriptions/rls/rls_test.py b/tests/channels/pjsip/subscriptions/rls/rls_test.py
index b06c3da..b4ea080 100755
--- a/tests/channels/pjsip/subscriptions/rls/rls_test.py
+++ b/tests/channels/pjsip/subscriptions/rls/rls_test.py
@@ -20,20 +20,22 @@
 LOGGER = logging.getLogger(__name__)
 
 
-class IntegrityCheck(VOIPListener):
-    """Verifies that SIP notifies contain expected updates
+class RLSTest(VOIPListener):
+    """Verifies that SIP notifies contain expected updates.
 
        A test module that observes incoming SIP notifies and compares them
        to a set of expected results. Tests may optionally specify for an
        arbitrary number of AMI actions to be executed in order at 2 second
        intervals from the start of the test.
     """
-    def __init__(self, module_config, test_object):
-        """Constructor
 
-        Arguments:
-        module_config Dictionary containing test configuration
-        test_object used to manipulate reactor and set/remove failure tokens
+    def __init__(self, module_config, test_object):
+        """Constructor.
+
+        Keyword Arguments:
+        module_config          -- Dictionary containing test configuration.
+        test_object            -- Used to manipulate reactor and set/remove
+                                  failure tokens.
         """
         self.set_pcap_defaults(module_config)
         VOIPListener.__init__(self, module_config, test_object)
@@ -76,8 +78,8 @@
         the packet that will verify that the contents of the NOTIFY match the
         expectations set for NOTIFY in the test configuration.
 
-        Arguments:
-        packet Incoming SIP Packet
+        Keyword Arguments:
+        packet                 -- Incoming SIP Packet
         """
 
         LOGGER.debug('Received SIP packet')
@@ -134,10 +136,14 @@
 
         Note: Overrides scenario_started from VOIPListener
 
-        Arguments:
-        scenario Not actually used, just part of the signature.
+        Keyword Arguments:
+        scenario               -- The event payload. (Not actually used, just
+                                  part of the signature.)
         """
+
         def _perform_ami_action():
+            """Helper function to loop executing an ami action."""
+
             action = self.ami_action.pop(0)
             debug_msg = "Sending AMI action: {0}"
             LOGGER.debug(debug_msg.format(action))

-- 
To view, visit https://gerrit.asterisk.org/1438
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3af00440aa011786afd3241bae27d39c3518079
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Ashley Sanders <asanders at digium.com>



More information about the asterisk-code-review mailing list