[Asterisk-code-review] chan pjsip: Creating Channel Causes Asterisk to Crash When D... (testsuite[master])

Ashley Sanders asteriskteam at digium.com
Tue Apr 28 11:16:01 CDT 2015


Ashley Sanders has posted comments on this change.

Change subject: chan_pjsip: Creating Channel Causes Asterisk to Crash When Duplicate AOR             Sections Exist in pjsip.conf
......................................................................


Patch Set 2:

(2 comments)

https://gerrit.asterisk.org/#/c/241/2/tests/channels/pjsip/configuration/duplicate_sections/duplicate_sections.py
File tests/channels/pjsip/configuration/duplicate_sections/duplicate_sections.py:

Line 1: #!/usr/bin/env python
      : """
      : Copyright (C) 2015, Digium, Inc.
      : Ashley Sanders <asanders at digium.com>
      : 
      : This program is free software, distributed under the terms of
      : the GNU General Public License Version 2.
      : """
      : 
      : import sys
      : 
      : sys.path.append("lib/python")
      : sys.path.append("tests/channels/pjsip/configuration")
      : 
      : from test_harness import TestHarness
      : 
      : 
      : class DuplicateSectionsTestHarness(TestHarness):
      :     """The test harness for the duplicate sections test."""
      : 
      :     def __init__(self, config, test_object):
      :         """Constructor.
      : 
      :         Keyword Arguments:
      :         config                 -- The YAML configuration for this test.
      :         test_object            -- The TestCaseModule instance for this test.
      :         """
      : 
      :         super(DuplicateSectionsTestHarness, self).__init__(config,
      :                                                            test_object)
> There's actually a way to explicitly add a path (independent of the module)
Thanks! I didn't realize that was available.


https://gerrit.asterisk.org/#/c/241/2/tests/channels/pjsip/configuration/test_harness.py
File tests/channels/pjsip/configuration/test_harness.py:

Line 66:         scenarios = list()
       :         for _ in range(0, self.test_object.asterisk_instances):
       :             scenario = TestScenario(config['cli_command'],
       :                                     config['re_query'])
       :             scenarios.append(scenario)
> There's a shortcut notation you can use for this:
That was a nifty trick.

As it turns out, I needed a little bit more information than before. If you have a suggestion for a better approach me based on the updated logic, that would be awesome.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I36078aae985050cff323ace3ccfd7464fe1de35f
Gerrit-PatchSet: 2
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list