<p>Kevin Harwell <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8468">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Corey Farrell: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Remove dynamic-modules test.<br><br>This test has been disabled since 2012. Due to reference counting<br>between modules (especially in master) this test is unworkable. The<br>ability to test unloads is better accomplished by enabling REF_DEBUG on<br>the entire testsuite and verifying that no leaks occur.<br><br>ASTERISK-19567 #close<br><br>Change-Id: I0c2ca9179cab3123477f7f75147596830efcdfd5<br>(cherry picked from commit d173472ac64f8a0850aac8d62dd5600f8a3b0fea)<br>---<br>D tests/dynamic-modules/configs/ast1/modules.conf<br>D tests/dynamic-modules/run-test<br>D tests/dynamic-modules/test-config.yaml<br>M tests/tests.yaml<br>4 files changed, 0 insertions(+), 184 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/dynamic-modules/configs/ast1/modules.conf b/tests/dynamic-modules/configs/ast1/modules.conf<br>deleted file mode 100644<br>index e71d535..0000000<br>--- a/tests/dynamic-modules/configs/ast1/modules.conf<br>+++ /dev/null<br>@@ -1,2 +0,0 @@<br>-[modules]<br>-autoload=no<br>diff --git a/tests/dynamic-modules/run-test b/tests/dynamic-modules/run-test<br>deleted file mode 100755<br>index 59cb023..0000000<br>--- a/tests/dynamic-modules/run-test<br>+++ /dev/null<br>@@ -1,169 +0,0 @@<br>-#!/usr/bin/env python<br>-'''<br>-Copyright (C) 2010, Digium, Inc.<br>-Paul Belanger <pabelanger@digium.com><br>-<br>-This program is free software, distributed under the terms of<br>-the GNU General Public License Version 2.<br>-'''<br>-<br>-import sys<br>-import os<br>-import logging<br>-<br>-from twisted.internet import reactor, defer<br>-<br>-sys.path.append("lib/python")<br>-from asterisk.asterisk import Asterisk<br>-from asterisk.test_case import TestCase<br>-<br>-logger = logging.getLogger(__name__)<br>-<br>-class moduleLoadUnloadTest(TestCase):<br>- def __init__(self):<br>- TestCase.__init__(self)<br>- self.create_asterisk()<br>-<br>- def check_file(self, module):<br>- module[1] = (os.path.isfile("%s%s/%s" % (self.ast[0].base,<br>- self.ast[0].directories["astmoddir"], module[0])))<br>- return module[1]<br>-<br>- def pre_load_next(self):<br>- self.__preload_test_counter += 1<br>- if (self.__preload_test_counter < len(self.preload_res)):<br>- self.pre_load_module(self.preload_res[self.__preload_test_counter])<br>- else:<br>- self.load_next()<br>-<br>- def pre_load_module(self, module):<br>- def __module_callback(reason):<br>- text = "Loaded " + self.__module[0]<br>- if reason.output.count(text) > 0:<br>- self.__module[2] = True<br>- logger.debug("Pre-load %s: %r" % (self.__module[0], self.__module[2]))<br>- self.pre_load_next()<br>- return reason<br>-<br>- if not self.check_file(module):<br>- logger.info(module[0] + " does not exist! Skipping this test.")<br>- self.pre_load_next()<br>- return<br>-<br>- df = self.ast[0].cli_exec("module load " + module[0])<br>- df.addCallback(__module_callback)<br>- self.__module = module<br>-<br>- def load_next(self):<br>- self.__load_test_counter += 1<br>- if (self.__load_test_counter < len(self.res)):<br>- self.load_module(self.res[self.__load_test_counter])<br>- else:<br>- self.unload_next()<br>-<br>- def load_module(self, module):<br>- def __module_callback(reason):<br>- text = "Loaded " + self.__module[0]<br>- if reason.output.count(text) > 0:<br>- self.__module[2] = True<br>- logger.debug("Load %s: %r" % (self.__module[0], self.__module[2]))<br>- self.load_next()<br>- return reason<br>-<br>- if not self.check_file(module):<br>- logger.info(module[0] + " does not exist! Skipping test.")<br>- self.load_next()<br>- return<br>-<br>- df = self.ast[0].cli_exec("module load " + module[0])<br>- df.addCallback(__module_callback)<br>- self.__module = module<br>-<br>- def unload_next(self):<br>- self.__unload_test_counter += 1<br>- if (self.__unload_test_counter < len(self.unloads)):<br>- self.unload_module(self.unloads[self.__unload_test_counter])<br>- else:<br>- if not self.__checking_results:<br>- self.__checking_results = True<br>- self.check_results()<br>-<br>- def unload_module(self, module):<br>- def __module_callback(reason):<br>- text = "Unloaded " + self.__module[0]<br>- if reason.output.count(text) > 0:<br>- self.__module[3] = True<br>- logger.debug("Load %s: %r" % (self.__module[0], self.__module[3]))<br>- self.unload_next()<br>- return reason<br>-<br>- if not self.check_file(module):<br>- logger.info(module[0] + " does not exist! Skipping test.")<br>- self.unload_next()<br>- return<br>-<br>- # Don't attempt an unload if we didn't load it<br>- if not module[2]:<br>- self.unload_next()<br>- return<br>-<br>- df = self.ast[0].cli_exec("module unload " + module[0])<br>- df.addCallback(__module_callback)<br>- self.__module = module<br>-<br>- def check_results(self):<br>- logger.info("Checking Results")<br>- for module in self.unloads:<br>- if not self.check_file(module):<br>- logger.info(module[0] + " does not exist! Skipping test.")<br>- else:<br>- self.check_failures(module);<br>- self.stop_reactor()<br>-<br>- def check_failures(self, module):<br>- if not module[2]:<br>- logger.error("ERROR: Loading " + module[0])<br>- self.passed = False<br>-<br>- if not module[3]:<br>- logger.error("ERROR: Unloading " + module[0])<br>- self.passed = False<br>-<br>- def run(self):<br>- TestCase.run(self)<br>- self.passed = True<br>- self.preload_res = []<br>- self.res = []<br>- self.unloads = []<br>-<br>- # TODO: Do not hardcode, read from source code. <br>- preload_resources = ["res_calendar", "res_curl", "res_fax", "res_odbc"]<br>- self.preload_res = [ [module + ".so", False, False, False] for module in preload_resources ]<br>-<br>- # TODO: Do not hardcode, read from source code. <br>- # TODO: Fixed res_http_post crash<br>- resources = ["res_adsi", "res_ael_share", "res_agi", "res_ais", "res_calendar_caldav", "res_calendar_exchange", "res_calendar_icalendar", "res_clialiases", "res_clioriginate", "res_config_curl", "res_config_ldap", "res_config_odbc", "res_config_pgsql", "res_config_sqlite", "res_convert", "res_crypto", "res_fax_spandsp", "res_jabber", "res_limit", "res_monitor", "res_musiconhold", "res_mutestream", "res_phoneprov", "res_pktccops", "res_realtime", "res_rtp_asterisk", "res_rtp_multicast", "res_security_log", "res_smdi", "res_snmp", "res_speech", "res_timing_dahdi", "res_timing_kqueue", "res_timing_pthread", "res_timing_timerfd"]<br>- self.res = [ [module + ".so", False, False, False] for module in resources ]<br>- self.unloads.extend(self.preload_res)<br>- self.unloads.extend(self.res)<br>-<br>- self.__preload_test_counter = -1<br>- self.__load_test_counter = -1<br>- self.__unload_test_counter = -1<br>- self.__checking_results = False<br>- self.pre_load_next()<br>-<br>-<br>-def main():<br>- test = moduleLoadUnloadTest()<br>- test.start_asterisk()<br>- reactor.run()<br>- test.stop_asterisk()<br>- if test.passed:<br>- return 0<br>- return 1<br>-<br>-if __name__ == "__main__":<br>- sys.exit(main() or 0)<br>-<br>-# vim:sw=4:ts=4:expandtab:textwidth=79<br>diff --git a/tests/dynamic-modules/test-config.yaml b/tests/dynamic-modules/test-config.yaml<br>deleted file mode 100644<br>index 8abea4b..0000000<br>--- a/tests/dynamic-modules/test-config.yaml<br>+++ /dev/null<br>@@ -1,12 +0,0 @@<br>-testinfo:<br>- skip: 'See ASTERISK-19567'<br>- summary: 'Test dynamicly loading and unloading modules'<br>- description: |<br>- 'This test provides a basic sanity check on Asterisk<br>- modules.'<br>-<br>-properties:<br>- minversion: '1.8.0.0'<br>- dependencies:<br>- - python : 'twisted'<br>- - python : 'starpy'<br>diff --git a/tests/tests.yaml b/tests/tests.yaml<br>index 9d7ef0f..fc5321a 100644<br>--- a/tests/tests.yaml<br>+++ b/tests/tests.yaml<br>@@ -2,7 +2,6 @@<br> tests:<br> - test: 'example'<br> - dir: 'custom'<br>- - test: 'dynamic-modules'<br> - dir: 'manager'<br> - dir: 'cdr'<br> - dir: 'channels'<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8468">change 8468</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8468"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: newmaster </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I0c2ca9179cab3123477f7f75147596830efcdfd5 </div>
<div style="display:none"> Gerrit-Change-Number: 8468 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>