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

Mark Michelson asteriskteam at digium.com
Mon Oct 31 10:21:42 CDT 2016


Mark Michelson has uploaded a new change for review. ( 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(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/39/4239/1

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: newchange
Gerrit-Change-Id: Id30e7c3a57cb720d070cc5677aa9960bd40a8ada
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list