[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-commits
Subject:    [asterisk-commits] =?utf-8?q?Remove_dynamic-modules_test=2E_=28te?= =?utf-8?q?stsuite=5Bnewmaster=5D
From:       SVN commits to the Asterisk project <asterisk-commits () lists ! digium ! com>
Date:       2018-03-08 17:24:51
Message-ID: mailman.1344.1520529939.1324.asterisk-commits () lists ! digium ! com
[Download RAW message or body]

Kevin Harwell has submitted this change and it was merged. ( \
https://gerrit.asterisk.org/8468 )

Change subject: Remove dynamic-modules test.
......................................................................

Remove dynamic-modules test.

This test has been disabled since 2012.  Due to reference counting
between modules (especially in master) this test is unworkable.  The
ability to test unloads is better accomplished by enabling REF_DEBUG on
the entire testsuite and verifying that no leaks occur.

ASTERISK-19567 #close

Change-Id: I0c2ca9179cab3123477f7f75147596830efcdfd5
(cherry picked from commit d173472ac64f8a0850aac8d62dd5600f8a3b0fea)
---
D tests/dynamic-modules/configs/ast1/modules.conf
D tests/dynamic-modules/run-test
D tests/dynamic-modules/test-config.yaml
M tests/tests.yaml
4 files changed, 0 insertions(+), 184 deletions(-)

Approvals:
  Corey Farrell: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved; Approved for Submit



diff --git a/tests/dynamic-modules/configs/ast1/modules.conf \
b/tests/dynamic-modules/configs/ast1/modules.conf deleted file mode 100644
index e71d535..0000000
--- a/tests/dynamic-modules/configs/ast1/modules.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-[modules]
-autoload=no
diff --git a/tests/dynamic-modules/run-test b/tests/dynamic-modules/run-test
deleted file mode 100755
index 59cb023..0000000
--- a/tests/dynamic-modules/run-test
+++ /dev/null
@@ -1,169 +0,0 @@
-#!/usr/bin/env python
-'''
-Copyright (C) 2010, Digium, Inc.
-Paul Belanger <pabelanger@digium.com>
-
-This program is free software, distributed under the terms of
-the GNU General Public License Version 2.
-'''
-
-import sys
-import os
-import logging
-
-from twisted.internet import reactor, defer
-
-sys.path.append("lib/python")
-from asterisk.asterisk import Asterisk
-from asterisk.test_case import TestCase
-
-logger = logging.getLogger(__name__)
-
-class moduleLoadUnloadTest(TestCase):
-    def __init__(self):
-        TestCase.__init__(self)
-        self.create_asterisk()
-
-    def check_file(self, module):
-        module[1] = (os.path.isfile("%s%s/%s" % (self.ast[0].base,
-            self.ast[0].directories["astmoddir"], module[0])))
-        return module[1]
-
-    def pre_load_next(self):
-        self.__preload_test_counter += 1
-        if (self.__preload_test_counter < len(self.preload_res)):
-            self.pre_load_module(self.preload_res[self.__preload_test_counter])
-        else:
-            self.load_next()
-
-    def pre_load_module(self, module):
-        def __module_callback(reason):
-            text = "Loaded " + self.__module[0]
-            if reason.output.count(text) > 0:
-                self.__module[2] = True
-            logger.debug("Pre-load %s: %r" % (self.__module[0], self.__module[2]))
-            self.pre_load_next()
-            return reason
-
-        if not self.check_file(module):
-            logger.info(module[0] + " does not exist! Skipping this test.")
-            self.pre_load_next()
-            return
-
-        df = self.ast[0].cli_exec("module load " + module[0])
-        df.addCallback(__module_callback)
-        self.__module = module
-
-    def load_next(self):
-        self.__load_test_counter += 1
-        if (self.__load_test_counter < len(self.res)):
-            self.load_module(self.res[self.__load_test_counter])
-        else:
-            self.unload_next()
-
-    def load_module(self, module):
-        def __module_callback(reason):
-            text = "Loaded " + self.__module[0]
-            if reason.output.count(text) > 0:
-                self.__module[2] = True
-            logger.debug("Load %s: %r" % (self.__module[0], self.__module[2]))
-            self.load_next()
-            return reason
-
-        if not self.check_file(module):
-            logger.info(module[0] + " does not exist! Skipping test.")
-            self.load_next()
-            return
-
-        df = self.ast[0].cli_exec("module load " + module[0])
-        df.addCallback(__module_callback)
-        self.__module = module
-
-    def unload_next(self):
-        self.__unload_test_counter += 1
-        if (self.__unload_test_counter < len(self.unloads)):
-            self.unload_module(self.unloads[self.__unload_test_counter])
-        else:
-            if not self.__checking_results:
-                self.__checking_results = True
-                self.check_results()
-
-    def unload_module(self, module):
-        def __module_callback(reason):
-            text = "Unloaded " + self.__module[0]
-            if reason.output.count(text) > 0:
-                self.__module[3] = True
-            logger.debug("Load %s: %r" % (self.__module[0], self.__module[3]))
-            self.unload_next()
-            return reason
-
-        if not self.check_file(module):
-            logger.info(module[0] + " does not exist! Skipping test.")
-            self.unload_next()
-            return
-
-        # Don't attempt an unload if we didn't load it
-        if not module[2]:
-            self.unload_next()
-            return
-
-        df = self.ast[0].cli_exec("module unload " + module[0])
-        df.addCallback(__module_callback)
-        self.__module = module
-
-    def check_results(self):
-        logger.info("Checking Results")
-        for module in self.unloads:
-            if not self.check_file(module):
-                logger.info(module[0] + " does not exist! Skipping test.")
-            else:
-                self.check_failures(module);
-        self.stop_reactor()
-
-    def check_failures(self, module):
-        if not module[2]:
-            logger.error("ERROR: Loading " + module[0])
-            self.passed = False
-
-        if not module[3]:
-            logger.error("ERROR: Unloading " + module[0])
-            self.passed = False
-
-    def run(self):
-        TestCase.run(self)
-        self.passed = True
-        self.preload_res = []
-        self.res = []
-        self.unloads = []
-
-        # TODO: Do not hardcode, read from source code.
-        preload_resources = ["res_calendar", "res_curl", "res_fax", "res_odbc"]
-        self.preload_res = [ [module + ".so", False, False, False] for module in \
                preload_resources ]
-
-        # TODO: Do not hardcode, read from source code.
-        # TODO: Fixed res_http_post crash
-        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"]
-        self.res = [ [module + ".so", False, False, False] for module in resources ]
-        self.unloads.extend(self.preload_res)
-        self.unloads.extend(self.res)
-
-        self.__preload_test_counter = -1
-        self.__load_test_counter = -1
-        self.__unload_test_counter = -1
-        self.__checking_results = False
-        self.pre_load_next()
-
-
-def main():
-    test = moduleLoadUnloadTest()
-    test.start_asterisk()
-    reactor.run()
-    test.stop_asterisk()
-    if test.passed:
-        return 0
-    return 1
-
-if __name__ == "__main__":
-    sys.exit(main() or 0)
-
-# vim:sw=4:ts=4:expandtab:textwidth=79
diff --git a/tests/dynamic-modules/test-config.yaml \
b/tests/dynamic-modules/test-config.yaml deleted file mode 100644
index 8abea4b..0000000
--- a/tests/dynamic-modules/test-config.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-testinfo:
-    skip: 'See ASTERISK-19567'
-    summary:     'Test dynamicly loading and unloading modules'
-    description: |
-        'This test provides a basic sanity check on Asterisk
-        modules.'
-
-properties:
-    minversion: '1.8.0.0'
-    dependencies:
-        - python : 'twisted'
-        - python : 'starpy'
diff --git a/tests/tests.yaml b/tests/tests.yaml
index 9d7ef0f..fc5321a 100644
--- a/tests/tests.yaml
+++ b/tests/tests.yaml
@@ -2,7 +2,6 @@
 tests:
     - test: 'example'
     - dir: 'custom'
-    - test: 'dynamic-modules'
     - dir: 'manager'
     - dir: 'cdr'
     - dir: 'channels'

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

Gerrit-Project: testsuite
Gerrit-Branch: newmaster
Gerrit-MessageType: merged
Gerrit-Change-Id: I0c2ca9179cab3123477f7f75147596830efcdfd5
Gerrit-Change-Number: 8468
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell@digium.com>
Gerrit-Reviewer: Corey Farrell <git@cfware.com>
Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com>


[Attachment #3 (text/html)]

<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>-&#39;&#39;&#39;<br>-Copyright (C) 2010, \
Digium, Inc.<br>-Paul Belanger &lt;pabelanger@digium.com&gt;<br>-<br>-This program is \
free software, distributed under the terms of<br>-the GNU General Public License \
Version 2.<br>-&#39;&#39;&#39;<br>-<br>-import sys<br>-import os<br>-import \
logging<br>-<br>-from twisted.internet import reactor, \
defer<br>-<br>-sys.path.append(&quot;lib/python&quot;)<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(&quot;%s%s/%s&quot; % (self.ast[0].base,<br>-            \
self.ast[0].directories[&quot;astmoddir&quot;], 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 &lt; \
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 = \
&quot;Loaded &quot; + self.__module[0]<br>-            if reason.output.count(text) \
&gt; 0:<br>-                self.__module[2] = True<br>-            \
logger.debug(&quot;Pre-load %s: %r&quot; % (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] + &quot; does not \
exist! Skipping this test.&quot;)<br>-            self.pre_load_next()<br>-           \
return<br>-<br>-        df = self.ast[0].cli_exec(&quot;module load &quot; + \
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 &lt; 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 = &quot;Loaded &quot; + \
self.__module[0]<br>-            if reason.output.count(text) &gt; 0:<br>-            \
self.__module[2] = True<br>-            logger.debug(&quot;Load %s: %r&quot; % \
(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] + &quot; does not exist! Skipping test.&quot;)<br>-            \
self.load_next()<br>-            return<br>-<br>-        df = \
self.ast[0].cli_exec(&quot;module load &quot; + 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 &lt; 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 = \
&quot;Unloaded &quot; + self.__module[0]<br>-            if reason.output.count(text) \
&gt; 0:<br>-                self.__module[3] = True<br>-            \
logger.debug(&quot;Load %s: %r&quot; % (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] + &quot; does not \
exist! Skipping test.&quot;)<br>-            self.unload_next()<br>-            \
return<br>-<br>-        # Don&#39;t attempt an unload if we didn&#39;t load it<br>-   \
if not module[2]:<br>-            self.unload_next()<br>-            return<br>-<br>- \
df = self.ast[0].cli_exec(&quot;module unload &quot; + module[0])<br>-        \
df.addCallback(__module_callback)<br>-        self.__module = module<br>-<br>-    def \
check_results(self):<br>-        logger.info(&quot;Checking Results&quot;)<br>-       \
for module in self.unloads:<br>-            if not self.check_file(module):<br>-      \
logger.info(module[0] + &quot; does not exist! Skipping test.&quot;)<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(&quot;ERROR: Loading &quot; + module[0])<br>- \
self.passed = False<br>-<br>-        if not module[3]:<br>-            \
logger.error(&quot;ERROR: Unloading &quot; + 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 = [&quot;res_calendar&quot;, &quot;res_curl&quot;, \
&quot;res_fax&quot;, &quot;res_odbc&quot;]<br>-        self.preload_res = [ [module + \
&quot;.so&quot;, 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 = [&quot;res_adsi&quot;, \
&quot;res_ael_share&quot;, &quot;res_agi&quot;, &quot;res_ais&quot;, \
&quot;res_calendar_caldav&quot;, &quot;res_calendar_exchange&quot;, \
&quot;res_calendar_icalendar&quot;, &quot;res_clialiases&quot;, \
&quot;res_clioriginate&quot;, &quot;res_config_curl&quot;, \
&quot;res_config_ldap&quot;, &quot;res_config_odbc&quot;, \
&quot;res_config_pgsql&quot;, &quot;res_config_sqlite&quot;, &quot;res_convert&quot;, \
&quot;res_crypto&quot;, &quot;res_fax_spandsp&quot;, &quot;res_jabber&quot;, \
&quot;res_limit&quot;, &quot;res_monitor&quot;, &quot;res_musiconhold&quot;, \
&quot;res_mutestream&quot;, &quot;res_phoneprov&quot;, &quot;res_pktccops&quot;, \
&quot;res_realtime&quot;, &quot;res_rtp_asterisk&quot;, \
&quot;res_rtp_multicast&quot;, &quot;res_security_log&quot;, &quot;res_smdi&quot;, \
&quot;res_snmp&quot;, &quot;res_speech&quot;, &quot;res_timing_dahdi&quot;, \
&quot;res_timing_kqueue&quot;, &quot;res_timing_pthread&quot;, \
&quot;res_timing_timerfd&quot;]<br>-        self.res = [ [module + &quot;.so&quot;, \
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__ == &quot;__main__&quot;:<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: &#39;See \
ASTERISK-19567&#39;<br>-    summary:     &#39;Test dynamicly loading and unloading \
modules&#39;<br>-    description: |<br>-        &#39;This test provides a basic \
sanity check on Asterisk<br>-        modules.&#39;<br>-<br>-properties:<br>-    \
minversion: &#39;1.8.0.0&#39;<br>-    dependencies:<br>-        - python : \
&#39;twisted&#39;<br>-        - python : &#39;starpy&#39;<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: &#39;example&#39;<br>     - dir: &#39;custom&#39;<br>-    - test: \
&#39;dynamic-modules&#39;<br>     - dir: &#39;manager&#39;<br>     - dir: \
&#39;cdr&#39;<br>     - dir: &#39;channels&#39;<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 \
&lt;kharwell@digium.com&gt; </div> <div style="display:none"> Gerrit-Reviewer: Corey \
Farrell &lt;git@cfware.com&gt; </div> <div style="display:none"> Gerrit-Reviewer: \
Kevin Harwell &lt;kharwell@digium.com&gt; </div>



-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-commits
--===============2042021844473376933==--


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic