[Asterisk-code-review] RFC: Automatic conversion of tests to use realtime. (testsuite[master])

Mark Michelson asteriskteam at digium.com
Wed Dec 16 09:05:52 CST 2015


Hello Anonymous Coward #1000019,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/1802

to look at the new patch set (#4).

Change subject: RFC: Automatic conversion of tests to use realtime.
......................................................................

RFC: Automatic conversion of tests to use realtime.

This commit adds a pluggable module that can be used to automatically
make a test that currently uses static configuration files get converted
into a realtime test that uses a database.

The conversion works by keeping track of a registry of config files that
it understands how to convert into database data. When one of the known
files is encountered on a test, the configuration is converted to the
database data.

In addition to the conversion, the pluggable module also writes
configuration files necessary to make the test realtime-capable. For
instance, it will write extconfig.conf, res_odbc.conf, and potentially
sorcery.conf files automatically.

This commit only adds support for conversion of pjsip.conf to database,
but the groundwork is laid to be able to write converters that could
convert other types of files as well.

This commit has "RFC" applied to it because it is, in my opinion, not
optimally implemented. With this change, you would need to modify every
test's test-config.yaml to have database settings in it. In order to
have static and realtime versions of identical tests, you'd need to
duplicate every test, as well.

What I want to be able to do is to have database configuration exist
within the global test-config.yaml file. Then, when runtests.py is
invoked, a command-line option could be invoked to tell the testsuite to
realtime-enable all tests. This way, you would not have to make any
changes to individual tests in order to realtime-enable them.

The problem is that I'm running into issues since there currently is no
such thing as "global" pluggable modules for individual tests. In
addition, the TestRunner class does not have access to runtests.py
command line options, so even if global pluggable modules were added as
a feature, knowing when to enable them would not be straightforward.

This review is being offered in order to determine now if there is
potentially a better way to realtime-enable tests than a pluggable
module that gets invoked fore each test. Feel free to critique the
mechanics of the code submission (I'd be happy to fix bugs), but I'm
more interested in high-level sugestions about where to go from here.

Change-Id: I3ceaae8b8f4160a6d23f2062ce75017351c1559e
---
A lib/python/asterisk/astconfigparser.py
A lib/python/asterisk/astdicts.py
A lib/python/asterisk/realtime_converter.py
3 files changed, 1,101 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/02/1802/4
-- 
To view, visit https://gerrit.asterisk.org/1802
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3ceaae8b8f4160a6d23f2062ce75017351c1559e
Gerrit-PatchSet: 4
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list