[Asterisk-code-review] Allow apptest to work with master. (testsuite[master])

Anonymous Coward asteriskteam at digium.com
Mon Oct 31 13:38:51 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged. ( https://gerrit.asterisk.org/4239 )

Change subject: Allow apptest to work with master.
......................................................................


Allow apptest to work with master.

Master tests that use the app_test module were failing under the master
branch. This is due to the commit that added version checking for
individual events. The code attempted to set arbitrary version
boundaries of "0.0.0" and "999.999.999" if no version was specified in
the configuration. The problem is that when doing version comparisons,
"GIT-master" gets changed into sys.max_int. This means that it will
always be greater than any maxversion you specify.

The fix here is to no longer attempt to use arbitrary values when
versions are not specified. If a version is not specified, we do no
comparison and just assume the test is runnable with the current running
version.

Change-Id: Id30e7c3a57cb720d070cc5677aa9960bd40a8ada
---
M lib/python/asterisk/apptest.py
1 file changed, 7 insertions(+), 4 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Scott Griepentrog: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/lib/python/asterisk/apptest.py b/lib/python/asterisk/apptest.py
index b865b83..dc982b5 100644
--- a/lib/python/asterisk/apptest.py
+++ b/lib/python/asterisk/apptest.py
@@ -87,10 +87,13 @@
 
     def _create_application_event_instances(self, channel_id, events):
         for event_config in events:
-            minversion = event_config.get('minversion', '0.0.0')
-            maxversion = event_config.get('maxversion', '999.999.999')
-            if (AsteriskVersion() < AsteriskVersion(minversion) or
-                AsteriskVersion() >= AsteriskVersion(maxversion)):
+            minversion = event_config.get('minversion')
+            maxversion = event_config.get('maxversion')
+            if (minversion is not None and
+                    AsteriskVersion() < AsteriskVersion(minversion)):
+                continue
+            if (maxversion is not None and
+                    AsteriskVersion() >= AsteriskVersion(maxversion)):
                 continue
             ae_instance = ApplicationEventInstance(channel_id,
                                                    event_config,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id30e7c3a57cb720d070cc5677aa9960bd40a8ada
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Scott Griepentrog <sgriepentrog at digium.com>



More information about the asterisk-code-review mailing list