def __init__(self, test_path='', test_config=None):
        """Class that handles tests involving two-party bridges.

        There are three Asterisk instances used for this test.
        0 : the unit under test "UUT"
        1 : the unit from which calls originate, also known as "Alice"
        2 : the unit where calls terminate, also known as "Bob"
        """
        TestCase.__init__(self, test_path)
        self.test_runs = []
        self.current_run = 0
        self.ami_uut = None
        self.ami_alice = None
        self.ami_bob = None
        self.call_end_observers = []
        self.feature_start_observers = []
        self.feature_end_observers = []
        self.instances = 3
        self.connections = 0
        self.features = []
        self.alice_channel = None
        self.bob_channel = None
        self.uut_alice_channel = None
        self.uut_bob_channel = None
        self.uut_bridge_id = None
        self.alice_hungup = False
        self.bob_hungup = False
        self.uut_alice_hungup = False
        self.uut_bob_hungup = False
        self.current_feature = 0
        self.infeatures = False
        self.issue_hangups_on_bridged = False
        self.bridged = False
        self.audio_detected = False
        self.feature_success = False

        msg = ("BridgeTestCase hasn't raised the flag to indicate completion "
               "of all expected calls.")
        self.bridge_fail_token = self.create_fail_token(msg)

        if test_config is None:
            LOGGER.error("No configuration provided. Bailing.")
            raise Exception

        # Just a quick sanity check so we can die early if
        # the tests are badly misconfigured
        for test_run in test_config['test-runs']:
            if not 'originate_channel' in test_run:
                LOGGER.error("No configured originate channel in test run")
                raise Exception

            self.test_runs.append(test_run)

        if 'asterisk-instances' in test_config:
            self.instances = test_config['asterisk-instances']
        self.create_asterisk(self.instances, "%s/configs/bridge" % os.getcwd())
        LOGGER.info("Bridge test initialized")
Esempio n. 2
0
 def __init__(self, name):
     TestCase.__init__(self, name)
Esempio n. 3
0
 def __init__(self, name):
     self.wasRun = None
     TestCase.__init__(self, name)
Esempio n. 4
0
 def __init__(self, name):
   self.wasRun   = None
   self.wasSetUp = 1
   self.name     = name
   self.log      = "setUp "
   TestCase.__init__(self, name)