[asterisk-dev] [Code Review]: Testsuite: Test for Queue Reload Members (performed via the AMI command, but they all use the same stuff)
jrose
reviewboard at asterisk.org
Thu Sep 20 11:41:09 CDT 2012
> On Sept. 20, 2012, 11:05 a.m., Paul Belanger wrote:
> > /asterisk/trunk/tests/apps/queues/reload_queue_members/run-test, lines 45-46
> > <https://reviewboard.asterisk.org/r/2128/diff/1/?file=31325#file31325line45>
> >
> > Hmm, this is an interesting thing. IIRC, this will be the first test were we are over-writing existing asterisk configuration files.
> >
> > Personally, I'd like to see us create a new function, similar to install_config() but called update_config() wrapping around install_config(), where you could specify the filename you want to replace with.
> >
> > Then you don't have to do the ugly logic to figure out path names.
>
> Paul Belanger wrote:
> Actually, it would be easier.
>
> Just add a target variable to install_config()
>
> Example Usage:
> asterisk.install_config("tests/my-cool-test/configs/manager.conf")
>
>
> Paul Belanger wrote:
> err, target filename.
>
>
> Example Usage:
> asterisk.install_config("tests/my-cool-test/configs/manager.conf.custom", "manager.conf")
>
Hey Paul, thanks for this advice. I did it ever so slightly differently by changing the function declaration to the following:
def install_config(self, cfg_path, target_filename = None):
And I included the following example usage:
asterisk.install_config("tests/my-cool-test/replacement_manager_config.conf", target_filename = "manager.conf")
So now my own test invokes it with:
self.ast[0].install_config(src, target_filename = "queues.conf")
- jrose
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2128/#review7112
-----------------------------------------------------------
On Sept. 20, 2012, 10:50 a.m., jrose wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2128/
> -----------------------------------------------------------
>
> (Updated Sept. 20, 2012, 10:50 a.m.)
>
>
> Review request for Asterisk Developers and Matt Jordan.
>
>
> Summary
> -------
>
> This test seems to work fine as far as pass/failure is concerned, but one thing that bugs me is that it always produces the following error:
>
> [Sep 20 10:37:59] ERROR[25026]: AMI:192 connectionLost: Failure during connectionLost for callable <bound method QueueReloadMembersTest.reload_finished of <__main__.QueueReloadMembersTest object at 0x975668c>>: sequence index must be integer, not 'str'
> <?xml version="1.0" encoding="utf-8"?>
>
> at the end of the test.
>
> The test itself is fairly simple. Asterisk is started with one queue configuration, then another is swapped in for it and a QueueReload {Members: Yes} action is issued. Right now it fails in all versions of Asterisk because these queues get skipped during the reload in what seems to have been something of a coding snafu. I've also created a patch which fixes this and I've tested the patch against this test, but in the spirit of test driven development, want to finish the test before the patch.
>
>
> This addresses bug AST-956.
> https://issues.asterisk.org/jira/browse/AST-956
>
>
> Diffs
> -----
>
> /asterisk/trunk/tests/apps/queues/reload_queue_members/configs/ast1/queues.conf PRE-CREATION
> /asterisk/trunk/tests/apps/queues/reload_queue_members/queues.conf.replacement PRE-CREATION
> /asterisk/trunk/tests/apps/queues/reload_queue_members/run-test PRE-CREATION
> /asterisk/trunk/tests/apps/queues/reload_queue_members/test-config.yaml PRE-CREATION
> /asterisk/trunk/tests/apps/queues/tests.yaml 3472
>
> Diff: https://reviewboard.asterisk.org/r/2128/diff
>
>
> Testing
> -------
>
> Ran the test both while forcing expectations to match results and when using the expectations as I would expect them to be based on the contents of the replacement queues.conf. In both cases, failure/success occurs as expected.
>
>
> Thanks,
>
> jrose
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120920/326c0446/attachment.htm>
More information about the asterisk-dev
mailing list