[asterisk-commits] pabelanger: testsuite/asterisk/trunk r1016 - in /asterisk/trunk/tests/fastagi...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Nov 30 16:07:16 CST 2010
Author: pabelanger
Date: Tue Nov 30 16:07:12 2010
New Revision: 1016
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1016
Log:
Update fastagi tests to use proper config locations
Added:
asterisk/trunk/tests/fastagi/configs/ast1/
asterisk/trunk/tests/fastagi/configs/ast1/extensions.conf
- copied, changed from r1015, asterisk/trunk/tests/fastagi/configs/extensions.conf
asterisk/trunk/tests/fastagi/configs/ast1/manager.conf
- copied, changed from r1015, asterisk/trunk/tests/fastagi/configs/manager.conf
Removed:
asterisk/trunk/tests/fastagi/configs/extensions.conf
asterisk/trunk/tests/fastagi/configs/manager.conf
Modified:
asterisk/trunk/tests/fastagi/channel-status/run-test
asterisk/trunk/tests/fastagi/connect/run-test
asterisk/trunk/tests/fastagi/control-stream-file/run-test
asterisk/trunk/tests/fastagi/database/run-test
asterisk/trunk/tests/fastagi/execute/run-test
asterisk/trunk/tests/fastagi/get-data/run-test
asterisk/trunk/tests/fastagi/hangup/run-test
asterisk/trunk/tests/fastagi/record-file/run-test
asterisk/trunk/tests/fastagi/say-alpha/run-test
asterisk/trunk/tests/fastagi/say-date/run-test
asterisk/trunk/tests/fastagi/say-datetime/run-test
asterisk/trunk/tests/fastagi/say-digits/run-test
asterisk/trunk/tests/fastagi/say-number/run-test
asterisk/trunk/tests/fastagi/say-phonetic/run-test
asterisk/trunk/tests/fastagi/say-time/run-test
asterisk/trunk/tests/fastagi/stream-file/run-test
asterisk/trunk/tests/fastagi/wait-for-digit/run-test
Modified: asterisk/trunk/tests/fastagi/channel-status/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/channel-status/run-test?view=diff&rev=1016&r1=1015&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/channel-status/run-test (original)
+++ asterisk/trunk/tests/fastagi/channel-status/run-test Tue Nov 30 16:07:12 2010
@@ -17,6 +17,9 @@
from asterisk.asterisk import Asterisk
from asterisk.version import AsteriskVersion
+workingdir = "/tmp/asterisk-testsuite/fastagi/channel-status"
+testdir = "tests/fastagi"
+
class FastAGIChannelStatusTest:
def __init__(self, argv):
self.passed = {'4': False, '6':False}
@@ -34,9 +37,8 @@
reactor.listenTCP(4573, self.agi_factory, self.timeout, '127.0.0.1')
reactor.callWhenRunning(self.run)
- print self.ast_version
- self.asterisk = Asterisk(base="/tmp/asterisk-testsuite/fastagi/channel-status")
- self.asterisk.install_configs("tests/fastagi/configs")
+ self.ast1 = Asterisk(base=workingdir)
+ self.ast1.install_configs("%s/configs/ast1" % (testdir))
def on_answer_failure(self, reason):
print 'Could not answer the call:', reason.getTraceback()
@@ -84,12 +86,12 @@
if self.passed[4] is True and self.passed[6] is True:
print "PASS - FastAGI CHANNEL STATUS works as expected."
else:
- self.asterisk.cli_exec("core show channels")
+ self.ast1.cli_exec("core show channels")
if self.ast_version < AsteriskVersion("1.6.1"):
- self.asterisk.cli_exec("core show globals")
+ self.ast1.cli_exec("core show globals")
else:
- self.asterisk.cli_exec("dialplan show globals")
+ self.ast1.cli_exec("dialplan show globals")
print "FAIL - View result of 'core show globals' in log for",\
"more detailed failure results."
@@ -103,23 +105,23 @@
reactor.stop()
def launch_test(self):
- self.asterisk.cli_exec("agi set debug on")
+ self.ast1.cli_exec("agi set debug on")
# Set blocking=False so that we can test channel
# status before call is answered.
print "Originating call to begin test."
- self.asterisk.cli_originate(
+ self.ast1.cli_originate(
"Local/no_answer at agitest extension echo at agitest", blocking=False
)
def start_asterisk(self):
print "Starting Asterisk"
- self.asterisk.start()
+ self.ast1.start()
def stop_asterisk(self):
print "Stopping Asterisk"
- self.asterisk.stop()
+ self.ast1.stop()
# Read result before timeout
def result_changed(self):
Copied: asterisk/trunk/tests/fastagi/configs/ast1/extensions.conf (from r1015, asterisk/trunk/tests/fastagi/configs/extensions.conf)
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/configs/ast1/extensions.conf?view=diff&rev=1016&p1=asterisk/trunk/tests/fastagi/configs/extensions.conf&r1=1015&p2=asterisk/trunk/tests/fastagi/configs/ast1/extensions.conf&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/configs/extensions.conf (original)
+++ asterisk/trunk/tests/fastagi/configs/ast1/extensions.conf Tue Nov 30 16:07:12 2010
@@ -1,78 +1,0 @@
-[general]
-
-[globals]
-DEBUG=FAIL - nothing done
-
-[agitest]
-exten => echo,1,Answer()
-exten => echo,n,Echo()
-
-; Used in connect, hangup, control-stream-file, stream-file, database,
-; execute, get-data, record-file, say-alpha, say-date, say-datetime,
-; say-time, say-digits, say-number, say-phonetic
-exten => _5XX,1,Answer()
-exten => _5XX,n,Set(GLOBAL(DEBUG)=FAIL - before agi)
-exten => _5XX,n,SendDTMF(${EXTEN})
-exten => _5XX,n,AGI(agi://127.0.0.1:4573)
-exten => _5XX,n,Set(GLOBAL(DEBUG)=${AGISTATUS})
-exten => _5XX,n,HangUp()
-
-; Used in channel-status
-exten => no_answer,1,Set(GLOBAL(DEBUG)=FAIL - before agi)
-exten => no_answer,n,AGI(agi://127.0.0.1:4573)
-exten => no_answer,n,Set(GLOBAL(DEBUG)=${AGISTATUS})
-exten => no_answer,n,HangUp()
-
-
-
-[get-data]
-exten => 1,1,Answer()
-exten => 1,n,Set(GLOBAL(DEBUG)=FAIL - play_dtmf answered)
-exten => 1,n,WaitExten(10)
-exten => 1,n,HangUp()
-
-exten => 502,1,Wait(1)
-exten => 502,n,SendDTMF(w3w2w1w2w3w3w3w#)
-exten => 502,n,Set(GLOBAL(DEBUG)=FAIL - play_dtmf sent DTMF)
-exten => 502,n,Hangup()
-
-[record-file]
-exten => 1,1,Answer()
-exten => 1,n,Set(GLOBAL(DEBUG)=FAIL - play_snd_and_term answered)
-exten => 1,n,WaitExten(10)
-exten => 1,n,Hangup()
-
-exten => 508,1,Wait(1)
-exten => 508,n,Playback(beep)
-exten => 508,n,SendDTMF(#)
-exten => 508,n,Set(GLOBAL(DEBUG)=FAIL - play_snd_and_term sent sounds and exit digit)
-exten => 508,n,Hangup()
-
-; Used in record-file
-exten => 2,1,Answer()
-exten => 2,n,Set(GLOBAL(DEBUG)=FAIL - play_snd_and_hangup answered)
-exten => 2,n,WaitExten(10)
-exten => 2,n,Hangip()
-
-exten => 509,1,Wait(1)
-exten => 509,n,Playback(beep)
-exten => 509,n,Set(GLOBAL(DEBUG)=FAIL - play_snd_and_hangup sent sounds)
-exten => 509,n,HangUp()
-
-[td_and_agi_notify]
-exten => 1,1,Answer()
-exten => 1,n,Set(GLOBAL(DEBUG)=FAIL - td_and_agi_notify answered)
-exten => 1,n,WaitExten(10)
-exten => 1,n,Hangup()
-
-exten => _5XX,1,Wait(1)
-exten => _5XX,n,Set(TALK_DETECTED=0)
-exten => _5xx,n,BackgroundDetect(silence/10,100,10,20000)
-exten => _5XX,n,Wait(15)
-exten => _5XX,n,Set(GLOBAL(DEBUG)=FAIL - td_and_agi_notify listening for sounds)
-exten => _5XX,n,GoToIf($[${TALK_DETECTED}=0]?fail:pass)
-exten => _5XX,n(fail),Set(GLOBAL(DEBUG)=FAIL - talk detect failed with result ${TALK_DETECTED})
-exten => _5XX,n,HangUp()
-exten => _5XX,n(pass),Set(GLOBAL(DEBUG)=PASS)
-exten => _5XX,n,AGI(agi://127.0.0.1:4574)
-exten => _5XX,n,HangUp()
Copied: asterisk/trunk/tests/fastagi/configs/ast1/manager.conf (from r1015, asterisk/trunk/tests/fastagi/configs/manager.conf)
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/configs/ast1/manager.conf?view=diff&rev=1016&p1=asterisk/trunk/tests/fastagi/configs/manager.conf&r1=1015&p2=asterisk/trunk/tests/fastagi/configs/ast1/manager.conf&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/configs/manager.conf (original)
+++ asterisk/trunk/tests/fastagi/configs/ast1/manager.conf Tue Nov 30 16:07:12 2010
@@ -1,10 +1,0 @@
-[general]
-enabled = yes
-port = 5039
-bindaddr = 127.0.0.1
-
-[user]
-secret = mysecret
-read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
-write = system,call,agent,user,config,command,reporting,originate
-
Modified: asterisk/trunk/tests/fastagi/connect/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/connect/run-test?view=diff&rev=1016&r1=1015&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/connect/run-test (original)
+++ asterisk/trunk/tests/fastagi/connect/run-test Tue Nov 30 16:07:12 2010
@@ -17,6 +17,9 @@
from asterisk.asterisk import Asterisk
from asterisk.version import AsteriskVersion
+workingdir = "/tmp/asterisk-testsuite/fastagi/connect"
+testdir = "tests/fastagi"
+
class FastAGIConnectTest:
def __init__(self, argv):
self.passed = False
@@ -33,9 +36,8 @@
reactor.listenTCP(4573, self.agi_factory, self.timeout, '127.0.0.1')
reactor.callWhenRunning(self.run)
- print self.ast_version
- self.asterisk = Asterisk(base="/tmp/asterisk-testsuite/fastagi/connect")
- self.asterisk.install_configs("tests/fastagi/configs")
+ self.ast1 = Asterisk(base=workingdir)
+ self.ast1.install_configs("%s/configs/ast1" % (testdir))
# This gets invoked by the dialplan when the call is answered
# Disconnect agi and set test result values
@@ -51,12 +53,12 @@
if self.passed is True:
print "PASS - FastAGI connection works as expected."
else:
- self.asterisk.cli_exec("core show channels")
+ self.ast1.cli_exec("core show channels")
if self.ast_version < AsteriskVersion("1.6.1"):
- self.asterisk.cli_exec("core show globals")
+ self.ast1.cli_exec("core show globals")
else:
- self.asterisk.cli_exec("dialplan show globals")
+ self.ast1.cli_exec("dialplan show globals")
print "FAIL - FastAGI Connection test failed. View result of\
'core show globals' in log for more detailed failure\
@@ -70,17 +72,17 @@
def launch_test(self):
print "Originating call to begin test."
- self.asterisk.cli_originate(
+ self.ast1.cli_originate(
"Local/501 at agitest extension echo at agitest"
)
def start_asterisk(self):
print "Starting Asterisk"
- self.asterisk.start()
+ self.ast1.start()
def stop_asterisk(self):
print "Stopping Asterisk"
- self.asterisk.stop()
+ self.ast1.stop()
# Read result before timeout
def result_changed(self):
Modified: asterisk/trunk/tests/fastagi/control-stream-file/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/control-stream-file/run-test?view=diff&rev=1016&r1=1015&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/control-stream-file/run-test (original)
+++ asterisk/trunk/tests/fastagi/control-stream-file/run-test Tue Nov 30 16:07:12 2010
@@ -17,6 +17,9 @@
from asterisk.asterisk import Asterisk
from asterisk.version import AsteriskVersion
+workingdir = "/tmp/asterisk-testsuite/fastagi/control-stream-file"
+testdir = "tests/fastagi"
+
class FastAGIControlStreamFileTest:
def __init__(self, argv):
self.passed = False
@@ -33,9 +36,8 @@
reactor.listenTCP(4573, self.agi_factory, self.timeout, '127.0.0.1')
reactor.callWhenRunning(self.run)
- print self.ast_version
- self.asterisk = Asterisk(base="/tmp/asterisk-testsuite/fastagi/control-stream-file")
- self.asterisk.install_configs("tests/fastagi/configs")
+ self.ast1 = Asterisk(base=workingdir)
+ self.ast1.install_configs("%s/configs/ast1" % (testdir))
def on_failure(self, reason):
print 'Could not run CONTROL STREAM FILE: ', reason.getTraceback()
@@ -62,12 +64,12 @@
if self.passed is True:
print "PASS - FastAGI CONTROL STREAM FILE works as expected."
else:
- self.asterisk.cli_exec("core show channels")
+ self.ast1.cli_exec("core show channels")
if self.ast_version < AsteriskVersion("1.6.1"):
- self.asterisk.cli_exec("core show globals")
+ self.ast1.cli_exec("core show globals")
else:
- self.asterisk.cli_exec("dialplan show globals")
+ self.ast1.cli_exec("dialplan show globals")
print "FAIL - FastAGI CONTROL STREAM FILE test failed. You",\
"may need to update StarPy. Starpy 1.0.0a13 and older",\
"will always fail this test."
@@ -81,20 +83,20 @@
reactor.stop()
def launch_test(self):
- self.asterisk.cli_exec("agi set debug on")
+ self.ast1.cli_exec("agi set debug on")
print "Originating call to begin test."
- self.asterisk.cli_originate(
+ self.ast1.cli_originate(
"Local/504 at agitest extension echo at agitest"
)
def start_asterisk(self):
print "Starting Asterisk"
- self.asterisk.start()
+ self.ast1.start()
def stop_asterisk(self):
print "Stopping Asterisk"
- self.asterisk.stop()
+ self.ast1.stop()
# Read result before timeout
def result_changed(self):
Modified: asterisk/trunk/tests/fastagi/database/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/database/run-test?view=diff&rev=1016&r1=1015&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/database/run-test (original)
+++ asterisk/trunk/tests/fastagi/database/run-test Tue Nov 30 16:07:12 2010
@@ -16,6 +16,9 @@
sys.path.append("lib/python")
from asterisk.asterisk import Asterisk
from asterisk.version import AsteriskVersion
+
+workingdir = "/tmp/asterisk-testsuite/fastagi/database"
+testdir = "tests/fastagi"
class FastAGIDatabaseTest:
def __init__(self, argv):
@@ -36,9 +39,8 @@
reactor.listenTCP(4573, self.agi_factory, self.timeout, '127.0.0.1')
reactor.callWhenRunning(self.run)
- print self.ast_version
- self.asterisk = Asterisk(base="/tmp/asterisk-testsuite/fastagi/database")
- self.asterisk.install_configs("tests/fastagi/configs")
+ self.ast1 = Asterisk(base=workingdir)
+ self.ast1.install_configs("%s/configs/ast1" % (testdir))
def on_del_failure(self, reason):
print 'Could not delete the data from the database.'
@@ -184,20 +186,20 @@
reactor.stop()
def launch_test(self):
- self.asterisk.cli_exec("agi set debug on")
+ self.ast1.cli_exec("agi set debug on")
print "Originating call to begin test."
- self.asterisk.cli_originate(
+ self.ast1.cli_originate(
"Local/506 at agitest extension echo at agitest"
)
def start_asterisk(self):
print "Starting Asterisk"
- self.asterisk.start()
+ self.ast1.start()
def stop_asterisk(self):
print "Stopping Asterisk"
- self.asterisk.stop()
+ self.ast1.stop()
# Read result before timeout
def result_changed(self):
Modified: asterisk/trunk/tests/fastagi/execute/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/execute/run-test?view=diff&rev=1016&r1=1015&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/execute/run-test (original)
+++ asterisk/trunk/tests/fastagi/execute/run-test Tue Nov 30 16:07:12 2010
@@ -16,6 +16,9 @@
sys.path.append("lib/python")
from asterisk.asterisk import Asterisk
from asterisk.version import AsteriskVersion
+
+workingdir = "/tmp/asterisk-testsuite/fastagi/execute"
+testdir = "tests/fastagi"
class FastAGIExecuteTest:
def __init__(self, argv):
@@ -41,9 +44,8 @@
reactor.listenTCP(4573, self.agi_factory, self.timeout, '127.0.0.1')
reactor.callWhenRunning(self.run)
- print self.ast_version
- self.asterisk=Asterisk(base="/tmp/asterisk-testsuite/fastagi/execute")
- self.asterisk.install_configs("tests/fastagi/configs")
+ self.ast1 = Asterisk(base=workingdir)
+ self.ast1.install_configs("%s/configs/ast1" % (testdir))
def on_get_variable2_failure(self, reason):
self.passed['Set [Channel]'] = False
@@ -170,19 +172,19 @@
reactor.stop()
def launch_test(self):
- self.asterisk.cli_exec("agi set debug on")
+ self.ast1.cli_exec("agi set debug on")
print "Originating call to begin test."
- self.asterisk.cli_originate(
+ self.ast1.cli_originate(
"Local/507 at agitest extension echo at agitest"
)
def start_asterisk(self):
print "Starting Asterisk"
- self.asterisk.start()
+ self.ast1.start()
def stop_asterisk(self):
print "Stopping Asterisk"
- self.asterisk.stop()
+ self.ast1.stop()
# Read result before timeout
def result_changed(self):
Modified: asterisk/trunk/tests/fastagi/get-data/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/get-data/run-test?view=diff&rev=1016&r1=1015&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/get-data/run-test (original)
+++ asterisk/trunk/tests/fastagi/get-data/run-test Tue Nov 30 16:07:12 2010
@@ -17,6 +17,9 @@
from asterisk.asterisk import Asterisk
from asterisk.version import AsteriskVersion
+workingdir = "/tmp/asterisk-testsuite/fastagi/get-data"
+testdir = "tests/fastagi"
+
class FastAGIGetDataTest:
def __init__(self, argv):
self.passed = False
@@ -33,9 +36,8 @@
reactor.listenTCP(4573, self.agi_factory, self.timeout, '127.0.0.1')
reactor.callWhenRunning(self.run)
- print self.ast_version
- self.asterisk = Asterisk(base="/tmp/asterisk-testsuite/fastagi/get-data")
- self.asterisk.install_configs("tests/fastagi/configs")
+ self.ast1 = Asterisk(base=workingdir)
+ self.ast1.install_configs("%s/configs/ast1" % (testdir))
def on_failure(self, reason):
print 'Could not run GET DATA: ', reason.getTraceback()
@@ -70,12 +72,12 @@
if self.passed is True:
print "PASS - FastAGI GET DATA works as expected."
else:
- self.asterisk.cli_exec("core show channels")
+ self.ast1.cli_exec("core show channels")
if self.ast_version < AsteriskVersion("1.6.1"):
- self.asterisk.cli_exec("core show globals")
+ self.ast1.cli_exec("core show globals")
else:
- self.asterisk.cli_exec("dialplan show globals")
+ self.ast1.cli_exec("dialplan show globals")
print "FAIL - FastAGI GET DATA test failed. View result",\
"of 'core show globals' in log for more detailed",\
@@ -88,20 +90,20 @@
reactor.stop()
def launch_test(self):
- self.asterisk.cli_exec("agi set debug on")
+ self.ast1.cli_exec("agi set debug on")
print "Originating call to begin test."
- self.asterisk.cli_originate(
+ self.ast1.cli_originate(
"Local/502 at agitest extension 1 at get-data"
)
def start_asterisk(self):
print "Starting Asterisk"
- self.asterisk.start()
+ self.ast1.start()
def stop_asterisk(self):
print "Stopping Asterisk"
- self.asterisk.stop()
+ self.ast1.stop()
# Read result before timeout
def result_changed(self):
Modified: asterisk/trunk/tests/fastagi/hangup/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/hangup/run-test?view=diff&rev=1016&r1=1015&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/hangup/run-test (original)
+++ asterisk/trunk/tests/fastagi/hangup/run-test Tue Nov 30 16:07:12 2010
@@ -18,6 +18,9 @@
from asterisk.asterisk import Asterisk
from asterisk.version import AsteriskVersion
+workingdir = "/tmp/asterisk-testsuite/fastagi/channel-status"
+testdir = "tests/fastagi"
+
class FastAGIHangupTest:
def __init__(self, argv):
self.passed = False
@@ -35,9 +38,8 @@
reactor.listenTCP(4573, self.agi_factory, self.timeout, '127.0.0.1')
reactor.callWhenRunning(self.run)
- print self.ast_version
- self.asterisk = Asterisk(base="/tmp/asterisk-testsuite/fastagi/channel-status")
- self.asterisk.install_configs("tests/fastagi/configs")
+ self.ast1 = Asterisk(base=workingdir)
+ self.ast1.install_configs("%s/configs/ast1" % (testdir))
def on_hangup_failure(self, reason):
print 'Could not hangup:', reason.getTraceback()
@@ -91,12 +93,12 @@
if self.passed is True:
print "PASS - FastAGI HANGUP works as expected."
else:
- self.asterisk.cli_exec("core show channels")
+ self.ast1.cli_exec("core show channels")
if self.ast_version < AsteriskVersion("1.6.1"):
- self.asterisk.cli_exec("core show globals")
+ self.ast1.cli_exec("core show globals")
else:
- self.asterisk.cli_exec("dialplan show globals")
+ self.ast1.cli_exec("dialplan show globals")
print "FAIL - View result of 'core show globals' in log for more",\
"detailed failure results."
@@ -108,20 +110,20 @@
reactor.stop()
def launch_test(self):
- self.asterisk.cli_exec("agi set debug on")
+ self.ast1.cli_exec("agi set debug on")
print "Originating call to begin test."
- self.asterisk.cli_originate(
+ self.ast1.cli_originate(
"Local/503 at agitest extension echo at agitest"
)
def start_asterisk(self):
print "Starting Asterisk"
- self.asterisk.start()
+ self.ast1.start()
def stop_asterisk(self):
print "Stopping Asterisk"
- self.asterisk.stop()
+ self.ast1.stop()
# Read result before timeout
def result_changed(self):
Modified: asterisk/trunk/tests/fastagi/record-file/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/record-file/run-test?view=diff&rev=1016&r1=1015&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/record-file/run-test (original)
+++ asterisk/trunk/tests/fastagi/record-file/run-test Tue Nov 30 16:07:12 2010
@@ -16,6 +16,9 @@
sys.path.append("lib/python")
from asterisk.asterisk import Asterisk
from asterisk.version import AsteriskVersion
+
+workingdir = "/tmp/asterisk-testsuite/fastagi/execute"
+testdir = "tests/fastagi"
class FastAGIRecordFileTest:
def __init__(self, argv):
@@ -40,17 +43,15 @@
reactor.listenTCP(4573, self.agi_factory, self.timeout, '127.0.0.1')
reactor.callWhenRunning(self.run)
- print self.ast_version
- self.asterisk=Asterisk(base="/tmp/asterisk-testsuite/fastagi/execute")
- self.asterisk.install_configs("tests/fastagi/configs")
+ self.ast1 = Asterisk(base=workingdir)
+ self.ast1.install_configs("%s/configs/ast1" % (testdir))
+ self.audio_file = "%s/out.ulaw" % (workingdir)
def on_record_failure(self, reason):
- if os.path.exists("/tmp/asterisk-testsuite/fastagi/execute/out.ulaw"):
+ if os.path.exists(self.audio_file):
print "file exists"
- print "file size is", os.path.getsize(
- "/tmp/asterisk-testsuite/fastagi/execute/out.ulaw"
- )
+ print "file size is", os.path.getsize(self.audio_file)
self.passed[self.test] = False
print 'Could not record file:', reason.getTraceback()
if self.test is "DTMF":
@@ -67,10 +68,8 @@
print "Recording terminated by %s (%s) after %s bytes."\
% (result[1], digit, result[2])
- if os.path.exists("/tmp/asterisk-testsuite/fastagi/execute/out.ulaw"):
- file_size = os.path.getsize(
- "/tmp/asterisk-testsuite/fastagi/execute/out.ulaw"
- )
+ if os.path.exists(self.audio_file):
+ file_size = os.path.getsize(self.audio_file)
if file_size == 0:
print "The file was created, but it is empty."
self.passed[self.test] = False
@@ -96,7 +95,7 @@
def do_test(self, agi):
self.agi = agi
return agi.recordFile(
- "/tmp/asterisk-testsuite/fastagi/execute/out", "ulaw", "#", "3"
+ "%s/out" % (workingdir), "ulaw", "#", "3"
).addCallback(
self.on_record_success
).addErrback(self.on_record_failure)
@@ -111,12 +110,12 @@
self.overall_result = False
if self.overall_result is False:
- self.asterisk.cli_exec("core show channels")
+ self.ast1.cli_exec("core show channels")
if self.ast_version < AsteriskVersion("1.6.1"):
- self.asterisk.cli_exec("core show globals")
+ self.ast1.cli_exec("core show globals")
else:
- self.asterisk.cli_exec("dialplan show globals")
+ self.ast1.cli_exec("dialplan show globals")
print "FAIL - FastAGI RECORD FILE test failed. View result",\
"of 'core show globals' in log for more detailed",\
@@ -128,15 +127,15 @@
reactor.stop()
def launch_test(self):
- self.asterisk.cli_exec("agi set debug on")
+ self.ast1.cli_exec("agi set debug on")
print "Originating call to begin test which terminates recording",\
"with", self.test
if self.test is "DTMF":
- self.asterisk.cli_originate(
+ self.ast1.cli_originate(
"Local/508 at agitest extension 1 at record-file"
)
elif self.test is "HANGUP":
- self.asterisk.cli_originate(
+ self.ast1.cli_originate(
"Local/509 at agitest extension 2 at record-file"
)
else:
@@ -144,11 +143,11 @@
def start_asterisk(self):
print "Starting Asterisk"
- self.asterisk.start()
+ self.ast1.start()
def stop_asterisk(self):
print "Stopping Asterisk"
- self.asterisk.stop()
+ self.ast1.stop()
# Read result before timeout
def result_changed(self):
Modified: asterisk/trunk/tests/fastagi/say-alpha/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/say-alpha/run-test?view=diff&rev=1016&r1=1015&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/say-alpha/run-test (original)
+++ asterisk/trunk/tests/fastagi/say-alpha/run-test Tue Nov 30 16:07:12 2010
@@ -16,6 +16,9 @@
sys.path.append("lib/python")
from asterisk.asterisk import Asterisk
from asterisk.version import AsteriskVersion
+
+workingdir = "/tmp/asterisk-testsuite/fastagi/say-alpha"
+testdir = "tests/fastagi"
class FastAGISayAlphaTest:
def __init__(self, argv):
@@ -38,9 +41,8 @@
reactor.listenTCP(4574, self.agi_factory2, self.timeout, '127.0.0.1')
reactor.callWhenRunning(self.run)
- print self.ast_version
- self.asterisk = Asterisk(base="/tmp/asterisk-testsuite/fastagi/say-alpha")
- self.asterisk.install_configs("tests/fastagi/configs")
+ self.ast1 = Asterisk(base=workingdir)
+ self.ast1.install_configs("%s/configs/ast1" % (testdir))
def listen_result(self, agi):
print "Got test success confirmation from dialplan."
@@ -72,12 +74,12 @@
if self.passed is True and self.notified is True:
print "PASS - FastAGI SAY ALPHA works as expected."
else:
- self.asterisk.cli_exec("core show channels")
+ self.ast1.cli_exec("core show channels")
if self.ast_version < AsteriskVersion("1.6.1"):
- self.asterisk.cli_exec("core show globals")
+ self.ast1.cli_exec("core show globals")
else:
- self.asterisk.cli_exec("dialplan show globals")
+ self.ast1.cli_exec("dialplan show globals")
print "AGI reports success: ", self.passed
print "Diaplan reports success: ", self.notified
@@ -92,20 +94,20 @@
reactor.stop()
def launch_test(self):
- self.asterisk.cli_exec("agi set debug on")
+ self.ast1.cli_exec("agi set debug on")
print "Originating call to begin test."
- self.asterisk.cli_originate(
+ self.ast1.cli_originate(
"Local/510 at agitest extension 1 at td_and_agi_notify"
)
def start_asterisk(self):
print "Starting Asterisk"
- self.asterisk.start()
+ self.ast1.start()
def stop_asterisk(self):
print "Stopping Asterisk"
- self.asterisk.stop()
+ self.ast1.stop()
# Read result before timeout
def result_changed(self):
Modified: asterisk/trunk/tests/fastagi/say-date/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/say-date/run-test?view=diff&rev=1016&r1=1015&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/say-date/run-test (original)
+++ asterisk/trunk/tests/fastagi/say-date/run-test Tue Nov 30 16:07:12 2010
@@ -16,6 +16,9 @@
sys.path.append("lib/python")
from asterisk.asterisk import Asterisk
from asterisk.version import AsteriskVersion
+
+workingdir = "/tmp/asterisk-testsuite/fastagi/say-date"
+testdir = "tests/fastagi"
class FastAGISayDateTest:
def __init__(self, argv):
@@ -39,9 +42,8 @@
reactor.listenTCP(4574, self.agi_factory2, self.timeout, '127.0.0.1')
reactor.callWhenRunning(self.run)
- print self.ast_version
- self.asterisk = Asterisk(base="/tmp/asterisk-testsuite/fastagi/say-date")
- self.asterisk.install_configs("tests/fastagi/configs")
+ self.ast1 = Asterisk(base=workingdir)
+ self.ast1.install_configs("%s/configs/ast1" % (testdir))
def listen_result(self, agi):
print "Got test success confirmation from dialplan."
@@ -73,12 +75,12 @@
if self.passed is True and self.notified is True:
print "PASS - FastAGI SAY DATE works as expected."
else:
- self.asterisk.cli_exec("core show channels")
+ self.ast1.cli_exec("core show channels")
if self.ast_version < AsteriskVersion("1.6.1"):
- self.asterisk.cli_exec("core show globals")
+ self.ast1.cli_exec("core show globals")
else:
- self.asterisk.cli_exec("dialplan show globals")
+ self.ast1.cli_exec("dialplan show globals")
print "AGI reports success: ", self.passed
print "Diaplan reports success: ", self.notified
@@ -93,20 +95,20 @@
reactor.stop()
def launch_test(self):
- self.asterisk.cli_exec("agi set debug on")
+ self.ast1.cli_exec("agi set debug on")
print "Originating call to begin test."
- self.asterisk.cli_originate(
+ self.ast1.cli_originate(
"Local/511 at agitest extension 1 at td_and_agi_notify"
)
def start_asterisk(self):
print "Starting Asterisk"
- self.asterisk.start()
+ self.ast1.start()
def stop_asterisk(self):
print "Stopping Asterisk"
- self.asterisk.stop()
+ self.ast1.stop()
# Read result before timeout
def result_changed(self):
Modified: asterisk/trunk/tests/fastagi/say-datetime/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/say-datetime/run-test?view=diff&rev=1016&r1=1015&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/say-datetime/run-test (original)
+++ asterisk/trunk/tests/fastagi/say-datetime/run-test Tue Nov 30 16:07:12 2010
@@ -16,6 +16,9 @@
sys.path.append("lib/python")
from asterisk.asterisk import Asterisk
from asterisk.version import AsteriskVersion
+
+workingdir = "/tmp/asterisk-testsuite/fastagi/say-datetime"
+testdir = "tests/fastagi"
class FastAGISayDateTimeTest:
def __init__(self, argv):
@@ -38,9 +41,8 @@
reactor.listenTCP(4574, self.agi_factory2, self.timeout, '127.0.0.1')
reactor.callWhenRunning(self.run)
- print self.ast_version
- self.asterisk = Asterisk(base="/tmp/asterisk-testsuite/fastagi/say-datetime")
- self.asterisk.install_configs("tests/fastagi/configs")
+ self.ast1 = Asterisk(base=workingdir)
+ self.ast1.install_configs("%s/configs/ast1" % (testdir))
def listen_result(self, agi):
print "Got test success confirmation from dialplan."
@@ -72,12 +74,12 @@
if self.passed is True and self.notified is True:
print "PASS - FastAGI SAY DATETIME works as expected."
else:
- self.asterisk.cli_exec("core show channels")
+ self.ast1.cli_exec("core show channels")
if self.ast_version < AsteriskVersion("1.6.1"):
- self.asterisk.cli_exec("core show globals")
+ self.ast1.cli_exec("core show globals")
else:
- self.asterisk.cli_exec("dialplan show globals")
+ self.ast1.cli_exec("dialplan show globals")
print "AGI reports success: ", self.passed
print "Diaplan reports success: ", self.notified
@@ -92,20 +94,20 @@
reactor.stop()
def launch_test(self):
- self.asterisk.cli_exec("agi set debug on")
+ self.ast1.cli_exec("agi set debug on")
print "Originating call to begin test."
- self.asterisk.cli_originate(
+ self.ast1.cli_originate(
"Local/512 at agitest extension 1 at td_and_agi_notify"
)
def start_asterisk(self):
print "Starting Asterisk"
- self.asterisk.start()
+ self.ast1.start()
def stop_asterisk(self):
print "Stopping Asterisk"
- self.asterisk.stop()
+ self.ast1.stop()
# Read result before timeout
def result_changed(self):
Modified: asterisk/trunk/tests/fastagi/say-digits/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/say-digits/run-test?view=diff&rev=1016&r1=1015&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/say-digits/run-test (original)
+++ asterisk/trunk/tests/fastagi/say-digits/run-test Tue Nov 30 16:07:12 2010
@@ -16,6 +16,9 @@
sys.path.append("lib/python")
from asterisk.asterisk import Asterisk
from asterisk.version import AsteriskVersion
+
+workingdir = "/tmp/asterisk-testsuite/fastagi/say-digits"
+testdir = "tests/fastagi"
class FastAGISayDigitsTest:
def __init__(self, argv):
@@ -38,9 +41,8 @@
reactor.listenTCP(4574, self.agi_factory2, self.timeout, '127.0.0.1')
reactor.callWhenRunning(self.run)
- print self.ast_version
- self.asterisk = Asterisk(base="/tmp/asterisk-testsuite/fastagi/say-digits")
- self.asterisk.install_configs("tests/fastagi/configs")
+ self.ast1 = Asterisk(base=workingdir)
+ self.ast1.install_configs("%s/configs/ast1" % (testdir))
def listen_result(self, agi):
print "Got test success confirmation from dialplan."
@@ -72,12 +74,12 @@
if self.passed is True and self.notified is True:
print "PASS - FastAGI SAY DIGITS works as expected."
else:
- self.asterisk.cli_exec("core show channels")
+ self.ast1.cli_exec("core show channels")
if self.ast_version < AsteriskVersion("1.6.1"):
- self.asterisk.cli_exec("core show globals")
+ self.ast1.cli_exec("core show globals")
else:
- self.asterisk.cli_exec("dialplan show globals")
+ self.ast1.cli_exec("dialplan show globals")
print "AGI reports success: ", self.passed
print "Diaplan reports success: ", self.notified
@@ -92,20 +94,20 @@
reactor.stop()
def launch_test(self):
- self.asterisk.cli_exec("agi set debug on")
+ self.ast1.cli_exec("agi set debug on")
print "Originating call to begin test."
- self.asterisk.cli_originate(
+ self.ast1.cli_originate(
"Local/514 at agitest extension 1 at td_and_agi_notify"
)
def start_asterisk(self):
print "Starting Asterisk"
- self.asterisk.start()
+ self.ast1.start()
def stop_asterisk(self):
print "Stopping Asterisk"
- self.asterisk.stop()
+ self.ast1.stop()
# Read result before timeout
def result_changed(self):
Modified: asterisk/trunk/tests/fastagi/say-number/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/say-number/run-test?view=diff&rev=1016&r1=1015&r2=1016
==============================================================================
--- asterisk/trunk/tests/fastagi/say-number/run-test (original)
+++ asterisk/trunk/tests/fastagi/say-number/run-test Tue Nov 30 16:07:12 2010
@@ -16,6 +16,9 @@
sys.path.append("lib/python")
from asterisk.asterisk import Asterisk
from asterisk.version import AsteriskVersion
+
+workingdir = "/tmp/asterisk-testsuite/fastagi/say-number"
+testdir = "tests/fastagi"
class FastAGISayNumberTest:
def __init__(self, argv):
@@ -38,9 +41,8 @@
reactor.listenTCP(4574, self.agi_factory2, self.timeout, '127.0.0.1')
reactor.callWhenRunning(self.run)
- print self.ast_version
- self.asterisk = Asterisk(base="/tmp/asterisk-testsuite/fastagi/say-number")
- self.asterisk.install_configs("tests/fastagi/configs")
+ self.ast1 = Asterisk(base=workingdir)
+ self.ast1.install_configs("%s/configs/ast1" % (testdir))
def listen_result(self, agi):
print "Got test success confirmation from dialplan."
@@ -72,12 +74,12 @@
if self.passed is True and self.notified is True:
print "PASS - FastAGI SAY NUMBER works as expected."
else:
- self.asterisk.cli_exec("core show channels")
+ self.ast1.cli_exec("core show channels")
if self.ast_version < AsteriskVersion("1.6.1"):
- self.asterisk.cli_exec("core show globals")
+ self.ast1.cli_exec("core show globals")
else:
- self.asterisk.cli_exec("dialplan show globals")
+ self.ast1.cli_exec("dialplan show globals")
print "AGI reports success: ", self.passed
print "Diaplan reports success: ", self.notified
@@ -92,20 +94,20 @@
reactor.stop()
def launch_test(self):
- self.asterisk.cli_exec("agi set debug on")
+ self.ast1.cli_exec("agi set debug on")
print "Originating call to begin test."
- self.asterisk.cli_originate(
+ self.ast1.cli_originate(
"Local/515 at agitest extension 1 at td_and_agi_notify"
)
def start_asterisk(self):
print "Starting Asterisk"
- self.asterisk.start()
[... 286 lines stripped ...]
More information about the asterisk-commits
mailing list