[asterisk-commits] twilson: branch twilson/srtp r278 - in /asterisk/team/twilson/srtp/tests/srtp...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 3 11:49:02 CDT 2010


Author: twilson
Date: Mon May  3 11:48:58 2010
New Revision: 278

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=278
Log:
Initial import of SRTP tests

Added:
    asterisk/team/twilson/srtp/tests/srtp/
    asterisk/team/twilson/srtp/tests/srtp/encryption_yes/
    asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs1/
    asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs1/sip.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs2/
    asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs2/sip.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/
    asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/extensions.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/manager.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/encryption_yes/run-test   (with props)
    asterisk/team/twilson/srtp/tests/srtp/encryption_yes/test-config.yaml   (with props)
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs1/
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs1/sip.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs2/
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs2/sip.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/extensions.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/manager.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/modules.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/run-test   (with props)
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/test-config.yaml   (with props)
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs1/
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs1/sip.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs2/
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs2/sip.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/extensions.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/manager.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/modules.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/run-test   (with props)
    asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/test-config.yaml   (with props)
    asterisk/team/twilson/srtp/tests/srtp/secure_bridge_media/
    asterisk/team/twilson/srtp/tests/srtp/secure_bridge_media/configs1/
    asterisk/team/twilson/srtp/tests/srtp/secure_bridge_media/configs1/sip.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/secure_bridge_media/configs2/
    asterisk/team/twilson/srtp/tests/srtp/secure_bridge_media/configs2/sip.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/secure_bridge_media/configs_common/
    asterisk/team/twilson/srtp/tests/srtp/secure_bridge_media/configs_common/extensions.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/secure_bridge_media/configs_common/manager.conf   (with props)
    asterisk/team/twilson/srtp/tests/srtp/secure_bridge_media/run-test   (with props)
    asterisk/team/twilson/srtp/tests/srtp/secure_bridge_media/test-config.yaml   (with props)

Added: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs1/sip.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs1/sip.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs1/sip.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,17 @@
+[general]
+context=default                 ; Default context for incoming calls
+allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
+
+transport=udp
+udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
+bindport=5060
+
+[authentication]
+
+[ast2]
+type=peer
+host=127.0.0.1
+port=5070
+disallow=all
+allow=ulaw
+encryption=yes

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs2/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs2/sip.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs2/sip.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs2/sip.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,9 @@
+[general]
+context=default                 ; Default context for incoming calls
+allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
+
+transport=udp
+udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
+bindport=5070
+
+[authentication]

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs2/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs2/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs2/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/extensions.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/extensions.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/extensions.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,11 @@
+[general]
+writeprotect=no
+clearglobalvars=no
+
+[globals]
+
+[default]
+exten => s,1,Answer
+exten => s,n,Set(CDR(userfield)=${CHANNEL(secure_media)})
+exten => s,n,Wait(3)
+exten => s,n,Hangup

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/manager.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/manager.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/manager.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/manager.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,10 @@
+[general]
+enabled = yes 
+port = 5038
+bindaddr = 0.0.0.0
+
+[mark]
+secret = mysecret
+read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
+write = system,call,agent,user,config,command,reporting,originate
+

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/manager.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/manager.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/configs_common/manager.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/encryption_yes/run-test?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/encryption_yes/run-test (added)
+++ asterisk/team/twilson/srtp/tests/srtp/encryption_yes/run-test Mon May  3 11:48:58 2010
@@ -1,0 +1,86 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2010, Digium, Inc.
+Terry Wilson <twilson at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+from time import sleep
+import os
+sys.path.append("lib/python")
+from asterisk.asterisk import Asterisk
+from asterisk.cdr import AsteriskCSVCDR, AsteriskCSVCDRLine
+from asterisk.ami import AMI
+from twisted.internet import reactor
+import logging
+
+testname = "encryption_yes"
+workingdir = "/tmp/asterisk-testsuite/%s" % (testname)
+testdir = "tests/srtp/%s" % (testname)
+
+class Test:
+    def __init__(self):
+        self.passed = False
+        asterisk1 = Asterisk(base=workingdir)
+        asterisk1.install_config("%s/configs_common/manager.conf" % (testdir))
+        asterisk1.install_config("%s/configs_common/extensions.conf" % (testdir))
+        asterisk1.install_config("%s/configs1/sip.conf" % (testdir))
+
+        asterisk2 = Asterisk(base=workingdir)
+        asterisk2.install_config("%s/configs_common/manager.conf" % (testdir))
+        asterisk2.install_config("%s/configs_common/extensions.conf" % (testdir))
+        asterisk2.install_config("%s/configs2/sip.conf" % (testdir))
+
+        asterisk1.start()
+        asterisk2.start()
+
+        self.asterisk1 = asterisk1
+        self.asterisk2 = asterisk2
+
+        self.ami = AMI(self.start, self.abort, timeout=20)
+        self.ami.login()
+
+    def start(self, ami):
+        ami.registerEvent('Hangup', self.end)
+        self.asterisk1.cli_exec("channel originate SIP/s at ast2 application Wait 5")
+
+    def stop_asterisk(self):
+        self.asterisk1.stop()
+        self.asterisk2.stop()
+
+    def abort(self):
+        self.stop_asterisk()
+        reactor.stop()
+
+    def end(self, ami, event):
+        self.stop_asterisk()
+
+        cdr1 = AsteriskCSVCDR(fn="%s/var/log/asterisk/cdr-csv/Master.csv" % (self.asterisk1.base))
+        cdr2 = AsteriskCSVCDR(fn="%s/var/log/asterisk/cdr-csv/Master.csv" % (self.asterisk2.base))
+
+        cdr1_expect = AsteriskCSVCDR(records=[AsteriskCSVCDRLine(
+            destination="s", disposition="ANSWERED")])
+
+        cdr2_expect = AsteriskCSVCDR(records=[AsteriskCSVCDRLine(
+            disposition="ANSWERED", userfield="1")])
+
+        if cdr1_expect.match(cdr1) and cdr2_expect.match(cdr2):
+            print "Success"
+            self.passed = True
+        else:
+            print "Failure"
+
+        reactor.stop()
+
+
+def main():
+    logging.basicConfig()
+    test = Test()
+    reactor.run()
+    return not test.passed
+
+if __name__ == '__main__':
+    sys.exit(main())

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/encryption_yes/test-config.yaml?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/encryption_yes/test-config.yaml (added)
+++ asterisk/team/twilson/srtp/tests/srtp/encryption_yes/test-config.yaml Mon May  3 11:48:58 2010
@@ -1,0 +1,10 @@
+testinfo:
+    summary: 'Test encryption=yes in sip.conf'
+    description: |
+        'Ensure that if encryption=yes in sip.conf, an SRTP offer is made'
+
+properties:
+    minversion: '1.8'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/encryption_yes/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs1/sip.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs1/sip.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs1/sip.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,16 @@
+[general]
+context=default                 ; Default context for incoming calls
+allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
+
+transport=udp
+udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
+bindport=5060
+
+[authentication]
+
+[ast2]
+type=peer
+host=127.0.0.1
+port=5070
+disallow=all
+allow=ulaw

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs2/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs2/sip.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs2/sip.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs2/sip.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,9 @@
+[general]
+context=default                 ; Default context for incoming calls
+allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
+
+transport=udp
+udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
+bindport=5070
+
+[authentication]

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs2/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs2/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs2/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/extensions.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/extensions.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/extensions.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,10 @@
+[general]
+writeprotect=no
+clearglobalvars=no
+
+[globals]
+
+[default]
+exten => s,1,Answer
+exten => s,n,Wait(3)
+exten => s,n,Hangup

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/manager.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/manager.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/manager.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/manager.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,10 @@
+[general]
+enabled = yes 
+port = 5038
+bindaddr = 0.0.0.0
+
+[mark]
+secret = mysecret
+read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
+write = system,call,agent,user,config,command,reporting,originate
+

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/manager.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/manager.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/manager.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/modules.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/modules.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/modules.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/modules.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,6 @@
+[modules]
+autoload=yes
+noload => pbx_gtkconsole.so
+load => res_musiconhold.so
+noload => chan_alsa.so
+noload => res_srtp.so

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/modules.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/modules.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/configs_common/modules.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/run-test?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/run-test (added)
+++ asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/run-test Mon May  3 11:48:58 2010
@@ -1,0 +1,83 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2010, Digium, Inc.
+Terry Wilson <twilson at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+from time import sleep
+import os
+sys.path.append("lib/python")
+from asterisk.asterisk import Asterisk
+from asterisk.cdr import AsteriskCSVCDR, AsteriskCSVCDRLine
+from asterisk.ami import AMI
+from twisted.internet import reactor
+import logging
+
+testname = "noload_res_srtp"
+workingdir = "/tmp/asterisk-testsuite/%s" % (testname)
+testdir = "tests/srtp/%s" % (testname)
+
+class Test:
+    def __init__(self):
+        self.passed = False
+        asterisk1 = Asterisk(base=workingdir)
+        asterisk1.install_config("%s/configs_common/manager.conf" % (testdir))
+        asterisk1.install_config("%s/configs_common/extensions.conf" % (testdir))
+        asterisk1.install_config("%s/configs_common/modules.conf" % (testdir))
+        asterisk1.install_config("%s/configs1/sip.conf" % (testdir))
+
+        asterisk2 = Asterisk(base=workingdir)
+        asterisk2.install_config("%s/configs_common/manager.conf" % (testdir))
+        asterisk2.install_config("%s/configs_common/extensions.conf" % (testdir))
+        asterisk2.install_config("%s/configs_common/modules.conf" % (testdir))
+        asterisk2.install_config("%s/configs2/sip.conf" % (testdir))
+
+        asterisk1.start()
+        asterisk2.start()
+
+        self.asterisk1 = asterisk1
+        self.asterisk2 = asterisk2
+
+        self.ami = AMI(self.start, self.abort, timeout=20)
+        self.ami.login()
+
+    def start(self, ami):
+        ami.registerEvent('Hangup', self.end)
+        self.asterisk1.cli_exec("channel originate SIP/s at ast2 application Wait 5")
+
+    def stop_asterisk(self):
+        self.asterisk1.stop()
+        self.asterisk2.stop()
+
+    def abort(self):
+        self.stop_asterisk()
+        reactor.stop()
+
+    def end(self, ami, event):
+        self.stop_asterisk()
+        cdr1 = AsteriskCSVCDR(fn="%s/var/log/asterisk/cdr-csv/Master.csv" % (self.asterisk1.base))
+
+        cdr1_expect = AsteriskCSVCDR(records=[AsteriskCSVCDRLine(
+            destination="s", disposition="ANSWERED")])
+
+        if cdr1_expect.match(cdr1):
+            print "Success"
+            self.passed = True
+        else:
+            print "Failure"
+
+        reactor.stop()
+
+
+def main():
+    logging.basicConfig()
+    test = Test()
+    reactor.run()
+    return not test.passed
+
+if __name__ == '__main__':
+    sys.exit(main())

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/test-config.yaml?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/test-config.yaml (added)
+++ asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/test-config.yaml Mon May  3 11:48:58 2010
@@ -1,0 +1,10 @@
+testinfo:
+    summary: 'Make sure that systems without libsrtp still work'
+    description: |
+        'noload => res_srtp.so and make sure SIP calls still work.'
+
+properties:
+    minversion: '1.8'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs1/sip.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs1/sip.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs1/sip.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,17 @@
+[general]
+context=default                 ; Default context for incoming calls
+allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
+
+transport=udp
+udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
+bindport=5060
+
+[authentication]
+
+[ast2]
+type=peer
+host=127.0.0.1
+port=5070
+disallow=all
+allow=ulaw
+encryption=yes

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs2/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs2/sip.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs2/sip.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs2/sip.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,9 @@
+[general]
+context=default                 ; Default context for incoming calls
+allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
+
+transport=udp
+udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
+bindport=5070
+
+[authentication]

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs2/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs2/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs2/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/extensions.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/extensions.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/extensions.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,10 @@
+[general]
+writeprotect=no
+clearglobalvars=no
+
+[globals]
+
+[default]
+exten => s,1,Answer
+exten => s,n,Wait(3)
+exten => s,n,Hangup

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/manager.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/manager.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/manager.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/manager.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,10 @@
+[general]
+enabled = yes 
+port = 5038
+bindaddr = 0.0.0.0
+
+[mark]
+secret = mysecret
+read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
+write = system,call,agent,user,config,command,reporting,originate
+

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/manager.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/manager.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/manager.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/modules.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/modules.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/modules.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/modules.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,6 @@
+[modules]
+autoload=yes
+noload => pbx_gtkconsole.so
+load => res_musiconhold.so
+noload => chan_alsa.so
+noload => res_srtp.so

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/modules.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/modules.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/configs_common/modules.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/run-test?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/run-test (added)
+++ asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/run-test Mon May  3 11:48:58 2010
@@ -1,0 +1,82 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2010, Digium, Inc.
+Terry Wilson <twilson at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+from time import sleep
+import os
+sys.path.append("lib/python")
+from asterisk.asterisk import Asterisk
+from asterisk.cdr import AsteriskCSVCDR, AsteriskCSVCDRLine
+from asterisk.ami import AMI
+from twisted.internet import reactor
+import logging
+
+testname = "noload_res_srtp_encryption_yes"
+workingdir = "/tmp/asterisk-testsuite/%s" % (testname)
+testdir = "tests/srtp/%s" % (testname)
+
+class Test:
+    def __init__(self):
+        self.passed = False
+        asterisk1 = Asterisk(base=workingdir)
+        asterisk1.install_config("%s/configs_common/manager.conf" % (testdir))
+        asterisk1.install_config("%s/configs_common/extensions.conf" % (testdir))
+        asterisk1.install_config("%s/configs_common/modules.conf" % (testdir))
+        asterisk1.install_config("%s/configs1/sip.conf" % (testdir))
+
+        asterisk2 = Asterisk(base=workingdir)
+        asterisk2.install_config("%s/configs_common/manager.conf" % (testdir))
+        asterisk2.install_config("%s/configs_common/extensions.conf" % (testdir))
+        asterisk2.install_config("%s/configs_common/modules.conf" % (testdir))
+        asterisk2.install_config("%s/configs2/sip.conf" % (testdir))
+
+        asterisk1.start()
+        asterisk2.start()
+
+        self.asterisk1 = asterisk1
+        self.asterisk2 = asterisk2
+
+        self.ami = AMI(self.start, self.abort, timeout=20)
+        self.ami.login()
+
+    def start(self, ami):
+        ami.registerEvent('Hangup', self.end)
+        self.asterisk1.cli_exec("channel originate SIP/s at ast2 application Wait 5")
+
+    def stop_asterisk(self):
+        self.asterisk1.stop()
+        self.asterisk2.stop()
+
+    def abort(self):
+        self.stop_asterisk()
+        reactor.stop()
+
+    def end(self, ami, event):
+        self.stop_asterisk()
+
+        print "The next CDR failure is expected, disregard."
+        cdr1 = AsteriskCSVCDR(fn="%s/var/log/asterisk/cdr-csv/Master.csv" % (self.asterisk1.base))
+
+        if len(cdr1) == 0:
+            print "Success"
+            self.passed = True
+        else:
+            print "Failure"
+
+        reactor.stop()
+
+
+def main():
+    logging.basicConfig()
+    test = Test()
+    reactor.run()
+    return not test.passed
+
+if __name__ == '__main__':
+    sys.exit(main())

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/run-test
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/run-test
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/run-test
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/test-config.yaml?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/test-config.yaml (added)
+++ asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/test-config.yaml Mon May  3 11:48:58 2010
@@ -1,0 +1,10 @@
+testinfo:
+    summary: 'If secure media is required and is not available, the call should fail.'
+    description: |
+        'Place a call that has encryption=yes set, but the peer does not support it.'
+
+properties:
+    minversion: '1.8'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/twilson/srtp/tests/srtp/noload_res_srtp_encryption_yes/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/twilson/srtp/tests/srtp/secure_bridge_media/configs1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/twilson/srtp/tests/srtp/secure_bridge_media/configs1/sip.conf?view=auto&rev=278
==============================================================================
--- asterisk/team/twilson/srtp/tests/srtp/secure_bridge_media/configs1/sip.conf (added)
+++ asterisk/team/twilson/srtp/tests/srtp/secure_bridge_media/configs1/sip.conf Mon May  3 11:48:58 2010
@@ -1,0 +1,17 @@
+[general]
+context=default                 ; Default context for incoming calls
+allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
+
+transport=udp
+udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
+bindport=5060
+
+[authentication]
+
+[ast2]
+type=peer
+host=127.0.0.1
+port=5070
+disallow=all
+allow=ulaw
+encryption=yes


[... 240 lines stripped ...]



More information about the asterisk-commits mailing list