[asterisk-commits] dvossel: testsuite/asterisk/trunk r768 - in /asterisk/trunk/tests: ./ mixmoni...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 18 14:45:11 CDT 2010


Author: dvossel
Date: Wed Aug 18 14:45:07 2010
New Revision: 768

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=768
Log:
AUDIOHOOK_INHERIT with MixMonitor external test

Tests using AUDIOHOOK_INHERIT with MixMonitor to verify
the recording continues after a transfer.

Added:
    asterisk/trunk/tests/mixmonitor_audiohook_inherit/
    asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/
    asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/extensions.conf   (with props)
    asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/features.conf   (with props)
    asterisk/trunk/tests/mixmonitor_audiohook_inherit/run-test   (with props)
    asterisk/trunk/tests/mixmonitor_audiohook_inherit/sounds/
    asterisk/trunk/tests/mixmonitor_audiohook_inherit/sounds/talking.ulaw   (with props)
    asterisk/trunk/tests/mixmonitor_audiohook_inherit/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/tests.yaml

Added: asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/extensions.conf?view=auto&rev=768
==============================================================================
--- asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/extensions.conf (added)
+++ asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/extensions.conf Wed Aug 18 14:45:07 2010
@@ -1,0 +1,23 @@
+[general]
+
+[globals]
+
+[mixmonitortest]
+
+exten => test1,1,Answer()
+exten => test1,n,MixMonitor(${TESTAUDIO1})
+exten => test1,n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
+exten => test1,n,Dial(Local/test_transfer at mixmonitortest,,tT)
+
+exten => test_transfer,1,Answer()
+
+exten => test_transfer,n,SendDTMF(*w2w)
+;exten => test_transfer,n,Wait(1)
+exten => test_transfer,n,SendDTMF(1w2w3w4w)
+
+exten => 1234,1,Answer()
+exten => 1234,n,Playback(${TALK_AUDIO})
+exten => 1234,n,Playback(${TALK_AUDIO})
+exten => 1234,n,Playback(${TALK_AUDIO})
+exten => 1234,n,Playback(${TALK_AUDIO})
+exten => 1234,n,Hangup()

Propchange: asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/features.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/features.conf?view=auto&rev=768
==============================================================================
--- asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/features.conf (added)
+++ asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/features.conf Wed Aug 18 14:45:07 2010
@@ -1,0 +1,4 @@
+[general]
+
+[featuremap]
+atxfer => *2

Propchange: asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/features.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/features.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/mixmonitor_audiohook_inherit/configs/features.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/mixmonitor_audiohook_inherit/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/mixmonitor_audiohook_inherit/run-test?view=auto&rev=768
==============================================================================
--- asterisk/trunk/tests/mixmonitor_audiohook_inherit/run-test (added)
+++ asterisk/trunk/tests/mixmonitor_audiohook_inherit/run-test Wed Aug 18 14:45:07 2010
@@ -1,0 +1,110 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2010, Digium, Inc.
+David Vossel <dvossel at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+import os
+import math
+from optparse import OptionParser
+from twisted.internet import reactor
+
+sys.path.append("lib/python")
+from asterisk.asterisk import Asterisk
+from asterisk.version import AsteriskVersion
+
+class MixMonitorTest:
+    def __init__(self, argv):
+        self.passed = False
+        self.last_step = ""
+        # if audiohook inherit does not work, file will be much smaller than 150000 bytes
+        self.expectedfilesize = 150000
+        self.audiofile1size = -1
+
+        # get version info
+        parser = OptionParser()
+        parser.add_option("-v", "--version", dest="ast_version",
+                          help="Asterisk version string")
+        (options, args) = parser.parse_args(argv)
+        self.ast_version = AsteriskVersion(options.ast_version)
+
+        reactor.callWhenRunning(self.run)
+
+        print self.ast_version
+        self.asterisk = Asterisk(base="/tmp/asterisk-testsuite/mixmonitor_audiohook_inherit")
+        self.audiofile1 = os.path.join(os.getcwd(), "tests/mixmonitor_audiohook_inherit/testaudio1")
+        self.asterisk.install_config("tests/mixmonitor_audiohook_inherit/configs/extensions.conf")
+        self.asterisk.install_config("tests/mixmonitor_audiohook_inherit/configs/features.conf")
+        self.talkingaudio = os.path.join(os.getcwd(), "tests/mixmonitor_audiohook_inherit/sounds/talking")
+
+    def read_result(self):
+        self.log_last_step("Reading result file from MixMonitor")
+        if os.path.exists(self.audiofile1 + ".raw"):
+            self.audiofile1size = os.path.getsize(self.audiofile1 + ".raw")
+
+        self.stop_asterisk()
+        print "Stopping Reactor ..."
+        if reactor.running:
+            reactor.stop()
+
+        self.passed = True
+
+        self.log_last_step("audiofile1 size is %d, a negative size indicates the file was not present." % (self.audiofile1size, ))
+        if self.audiofile1size < self.expectedfilesize:
+            # if this failed mixmonitor is not creating the correct file size for the time we expect.
+            self.log_last_step("audiofile1 size is not within the size tolerance.")
+            self.passed = False
+
+        if self.passed == True:
+            self.log_last_step("Test Passed... All audio files are the correct.")
+
+    def launch_test1(self):
+        self.log_last_step("Placing call to test1 exten")
+        self.asterisk.cli_exec("console dial test1 at mixmonitortest")
+
+    def start_asterisk(self):
+        self.log_last_step("Starting Asterisk")
+        self.asterisk.start()
+
+        self.asterisk.cli_exec("core set verbose 10")
+
+        if self.ast_version < AsteriskVersion("1.6.1"):
+            self.asterisk.cli_exec("core set global TESTAUDIO1 " + self.audiofile1)
+            self.asterisk.cli_exec("core set global TALK_AUDIO " + self.talkingaudio)
+        else:
+            self.asterisk.cli_exec("dialplan set global TESTAUDIO1 " + self.audiofile1)
+            self.asterisk.cli_exec("dialplan set global TALK_AUDIO " + self.talkingaudio)
+
+    def stop_asterisk(self):
+        self.asterisk.stop()
+
+    def log_last_step(self, step):
+        print step
+        self.last_step = step
+
+    def run(self):
+        self.start_asterisk()
+
+        # call test1 extension now
+        self.launch_test1()
+
+        # read test results in 20 seconds
+        reactor.callLater(20, self.read_result)
+
+def main(argv=None):
+    if argv is None:
+        argv = sys.argv
+    test = MixMonitorTest(argv)
+    reactor.run()
+    test.stop_asterisk()
+    if test.passed:
+        return 0
+    return 1
+
+if __name__ == "__main__":
+    sys.exit(main() or 0)
+

Propchange: asterisk/trunk/tests/mixmonitor_audiohook_inherit/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/mixmonitor_audiohook_inherit/run-test
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/mixmonitor_audiohook_inherit/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/mixmonitor_audiohook_inherit/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/mixmonitor_audiohook_inherit/sounds/talking.ulaw
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/mixmonitor_audiohook_inherit/sounds/talking.ulaw?view=auto&rev=768
==============================================================================
Binary file - no diff available.

Propchange: asterisk/trunk/tests/mixmonitor_audiohook_inherit/sounds/talking.ulaw
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: asterisk/trunk/tests/mixmonitor_audiohook_inherit/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/mixmonitor_audiohook_inherit/test-config.yaml?view=auto&rev=768
==============================================================================
--- asterisk/trunk/tests/mixmonitor_audiohook_inherit/test-config.yaml (added)
+++ asterisk/trunk/tests/mixmonitor_audiohook_inherit/test-config.yaml Wed Aug 18 14:45:07 2010
@@ -1,0 +1,16 @@
+testinfo:
+    summary:     'Test MixMonitor with AUDIOHOOK_INHERIT'
+    description: |
+        'This test verifies basic functionality using MixMonitor with AUDIOHOOK_INHERIT.
+         To test this, an extension is called using the console channel driver. MixMonitor
+         and AUDIOHOOK_INHERIT are used on that channel and then the channel is transfered
+         to another extension.  After the transfer, audio is played back for a period of time. 
+         In order to verify AUDIOHOOK_INHERIT worked properly, the file size is checked to verify
+         it is the size we would expect.  If AUDIOHOOK_INHERIT did not work properly, the file 
+         size would be much smaller than what we expect since we play several seconds of audio after 
+         the transfer.'
+
+properties:
+    minversion: '1.4'
+    dependencies:
+        - python : 'twisted'

Propchange: asterisk/trunk/tests/mixmonitor_audiohook_inherit/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/mixmonitor_audiohook_inherit/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/mixmonitor_audiohook_inherit/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/trunk/tests/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/tests.yaml?view=diff&rev=768&r1=767&r2=768
==============================================================================
--- asterisk/trunk/tests/tests.yaml (original)
+++ asterisk/trunk/tests/tests.yaml Wed Aug 18 14:45:07 2010
@@ -37,6 +37,7 @@
     - test: 'one-step-parking'
     - test: 'callparking'
     - test: 'mixmonitor'
+    - test: 'mixmonitor_audiohook_inherit'
     - test: 'chanspy/chanspy_w_mixmonitor'
     - test: 'chanspy/chanspy_barge'
     - test: 'queues/queue_baseline'




More information about the asterisk-commits mailing list