[asterisk-commits] mnicholson: testsuite/asterisk/trunk r1882 - in /asterisk/trunk/tests/fax: ./...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 22 11:36:33 CDT 2011


Author: mnicholson
Date: Mon Aug 22 11:36:29 2011
New Revision: 1882

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1882
Log:
added tests for the new gateway timeout functionality

ASTERISK-18219

Added:
    asterisk/trunk/tests/fax/gateway_timeout3/
    asterisk/trunk/tests/fax/gateway_timeout3/configs/
    asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/
    asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/manager.general.conf.inc   (with props)
    asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/
    asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/extensions.conf   (with props)
    asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/manager.general.conf.inc   (with props)
    asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/sip.conf   (with props)
    asterisk/trunk/tests/fax/gateway_timeout3/run-test   (with props)
    asterisk/trunk/tests/fax/gateway_timeout3/send.tiff   (with props)
    asterisk/trunk/tests/fax/gateway_timeout3/test-config.yaml   (with props)
    asterisk/trunk/tests/fax/gateway_timeout4/
    asterisk/trunk/tests/fax/gateway_timeout4/configs/
    asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/
    asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/manager.general.conf.inc   (with props)
    asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/
    asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/extensions.conf   (with props)
    asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/manager.general.conf.inc   (with props)
    asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/sip.conf   (with props)
    asterisk/trunk/tests/fax/gateway_timeout4/run-test   (with props)
    asterisk/trunk/tests/fax/gateway_timeout4/send.tiff   (with props)
    asterisk/trunk/tests/fax/gateway_timeout4/test-config.yaml   (with props)
    asterisk/trunk/tests/fax/gateway_timeout5/
    asterisk/trunk/tests/fax/gateway_timeout5/configs/
    asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/
    asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/manager.general.conf.inc   (with props)
    asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/sip.conf   (with props)
    asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/
    asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/extensions.conf   (with props)
    asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/manager.general.conf.inc   (with props)
    asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/sip.conf   (with props)
    asterisk/trunk/tests/fax/gateway_timeout5/run-test   (with props)
    asterisk/trunk/tests/fax/gateway_timeout5/send.tiff   (with props)
    asterisk/trunk/tests/fax/gateway_timeout5/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/fax/tests.yaml

Added: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/extensions.conf?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/extensions.conf Mon Aug 22 11:36:29 2011
@@ -1,0 +1,16 @@
+[receivefax]
+exten => 1234,1,noop
+exten => 1234,n,Playback(demo-congrats)
+exten => 1234,n,Playback(demo-congrats)
+
+exten => h,1,noop
+exten => h,n,UserEvent(TestStatus,status: SUCCESS)
+
+[sendfax]
+exten => 1234,1,noop
+exten => 1234,n,Playback(demo-congrats)
+exten => 1234,n,Playback(demo-congrats)
+
+exten => h,1,noop
+exten => h,n,UserEvent(TestStatus,status: SUCCESS)
+

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

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

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

Added: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/manager.general.conf.inc
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/manager.general.conf.inc?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/manager.general.conf.inc (added)
+++ asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/manager.general.conf.inc Mon Aug 22 11:36:29 2011
@@ -1,0 +1,2 @@
+enabled = yes
+bindaddr = 127.0.0.1

Propchange: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/sip.conf?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/sip.conf Mon Aug 22 11:36:29 2011
@@ -1,0 +1,25 @@
+[general]
+bindaddr = 127.0.0.1
+
+[ast2-g711]
+type = friend
+fromuser = ast1-g711
+context = receivefax
+host = 127.0.0.2
+t38pt_udptl = no
+disallow = all
+allow = ulaw
+qualify = no
+insecure = invite
+
+[ast2-t38]
+type = friend
+fromuser = ast1-t38
+context = receivefax
+host = 127.0.0.2
+t38pt_udptl = yes
+disallow = all
+allow = ulaw
+qualify = no
+insecure = invite
+

Propchange: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/extensions.conf?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/extensions.conf (added)
+++ asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/extensions.conf Mon Aug 22 11:36:29 2011
@@ -1,0 +1,9 @@
+[gatewayfax]
+exten => 1234,1,noop
+exten => 1234,n,Set(FAXOPT(gateway)=yes)
+exten => 1234,n,Set(FAXOPT(timeout)=30)
+exten => 1234,n,Dial(sip/ast1-t38/1234)
+
+exten => h,1,noop
+exten => h,n,UserEvent(FaxStatus,operation: gateway,status: ${FAXOPT(status)},statusstr: ${FAXOPT(statusstr)},error: ${FAXOPT(error)})
+

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

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

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

Added: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/manager.general.conf.inc
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/manager.general.conf.inc?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/manager.general.conf.inc (added)
+++ asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/manager.general.conf.inc Mon Aug 22 11:36:29 2011
@@ -1,0 +1,2 @@
+enabled = yes
+bindaddr = 127.0.0.2

Propchange: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/sip.conf?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/sip.conf (added)
+++ asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/sip.conf Mon Aug 22 11:36:29 2011
@@ -1,0 +1,25 @@
+[general]
+bindaddr = 127.0.0.2
+
+[ast1-g711]
+type = friend
+fromuser = ast2-g711
+context = gatewayfax
+host = 127.0.0.1
+t38pt_udptl = no
+disallow = all
+allow = ulaw
+qualify = no
+insecure = invite
+
+[ast1-t38]
+type = friend
+fromuser = ast2-t38
+context = gatewayfax
+host = 127.0.0.1
+t38pt_udptl = yes
+disallow = all
+allow = ulaw
+qualify = no
+insecure = invite
+

Propchange: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/fax/gateway_timeout3/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/gateway_timeout3/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout3/run-test?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout3/run-test (added)
+++ asterisk/trunk/tests/fax/gateway_timeout3/run-test Mon Aug 22 11:36:29 2011
@@ -1,0 +1,110 @@
+#!/usr/bin/env python
+# vim: sw=3 et:
+'''
+Copyright (C) 2011, Digium, Inc.
+Matthew Nicholson <mnicholson 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 re
+import shutil
+
+from twisted.internet import reactor
+
+sys.path.append("lib/python")
+from asterisk.asterisk import Asterisk
+from asterisk.TestCase import TestCase
+
+class GatewayTest(TestCase):
+   event_count = 0
+   success_count = 0
+   reactor_timeout = 360
+
+   def __init__(self, argv):
+      TestCase.__init__(self, argv)
+      self.create_asterisk(2)
+
+      # copy the tiff file we are going to send to a good known location
+      shutil.copy("%s/send.tiff" % (os.path.dirname(argv[0]),), "%s%s" % (self.ast[0].base, self.ast[0].directories['astdatadir']))
+
+   def ami_connect(self, ami):
+      TestCase.ami_connect(self, ami)
+
+      if ami.id == 0:
+
+         print "sending a call from ast1 to ast2"
+
+         ami.registerEvent('UserEvent', self.fax_result)
+         df = ami.originate("sip/ast2-t38/1234", "sendfax", "1234", 1)
+
+         def handle_failure(reason):
+            print "error sending originate:"
+            print reason.getTraceback()
+            self.stop_reactor()
+
+            return reason
+
+         df.addErrback(handle_failure)
+      else:
+         ami.registerEvent('UserEvent', self.fax_gateway_result)
+
+   def fax_gateway_result(self, ami, event):
+      if event['userevent'] != 'FaxStatus':
+         return
+
+      self.event_count += 1
+
+      if event['status'] == "FAILED" and event['error'] == "TIMEOUT":
+         print "successful gateway operation"
+         self.success_count += 1
+      else:
+         print "test error, expected FAILED and TIMEOUT"
+         print "status: %s" % (event['status'],)
+         print "error: %s" % (event['error'],)
+         print "statusstr: %s" % (event['statusstr'],)
+
+      self.are_we_there_yet()
+
+   def fax_result(self, ami, event):
+      if event['userevent'] != 'TestStatus':
+         return
+
+      self.event_count += 1
+
+      if event['status'] == "SUCCESS":
+         print "successful playback"
+         self.success_count += 1
+      else:
+         print "this can't happen"
+
+      self.are_we_there_yet()
+
+   def are_we_there_yet(self):
+      if self.event_count == 3:
+         if self.success_count == 3:
+            self.passed = True
+         self.stop_reactor()
+
+   def run(self):
+      TestCase.run(self)
+      self.create_ami_factory(2)
+
+
+def main(argv = sys.argv):
+   test = GatewayTest(argv)
+   test.start_asterisk()
+   reactor.run()
+   test.stop_asterisk()
+
+   if not test.passed:
+      return 1
+
+   return 0
+
+if __name__ == "__main__":
+   sys.exit(main() or 0)
+

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

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

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

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

Added: asterisk/trunk/tests/fax/gateway_timeout3/send.tiff
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout3/send.tiff?view=auto&rev=1882
==============================================================================
Binary file - no diff available.

Propchange: asterisk/trunk/tests/fax/gateway_timeout3/send.tiff
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: asterisk/trunk/tests/fax/gateway_timeout3/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout3/test-config.yaml?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout3/test-config.yaml (added)
+++ asterisk/trunk/tests/fax/gateway_timeout3/test-config.yaml Mon Aug 22 11:36:29 2011
@@ -1,0 +1,21 @@
+testinfo:
+    summary: 'Test the fax gateway.'
+    description: |
+        This test verifies that the gateway times out when no fax activity is
+        detected.
+
+        The call flow looks like this:
+         |send        |
+         |t38      t38|
+         |----------->|
+         |     gateway|
+         |t38      t38|
+         |<-----------|
+        \|receive     |/
+
+properties:
+    minversion: '10'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - custom : 'fax'

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

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

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

Added: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/extensions.conf?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/extensions.conf Mon Aug 22 11:36:29 2011
@@ -1,0 +1,16 @@
+[receivefax]
+exten => 1234,1,noop
+exten => 1234,n,Playback(demo-congrats)
+exten => 1234,n,Hangup
+
+exten => h,1,noop
+exten => h,n,UserEvent(TestStatus,status: SUCCESS)
+
+[sendfax]
+exten => 1234,1,noop
+exten => 1234,n,Playback(demo-congrats)
+exten => 1234,n,Hangup
+
+exten => h,1,noop
+exten => h,n,UserEvent(TestStatus,status: SUCCESS)
+

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

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

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

Added: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/manager.general.conf.inc
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/manager.general.conf.inc?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/manager.general.conf.inc (added)
+++ asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/manager.general.conf.inc Mon Aug 22 11:36:29 2011
@@ -1,0 +1,2 @@
+enabled = yes
+bindaddr = 127.0.0.1

Propchange: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/sip.conf?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/sip.conf Mon Aug 22 11:36:29 2011
@@ -1,0 +1,25 @@
+[general]
+bindaddr = 127.0.0.1
+
+[ast2-g711]
+type = friend
+fromuser = ast1-g711
+context = receivefax
+host = 127.0.0.2
+t38pt_udptl = no
+disallow = all
+allow = ulaw
+qualify = no
+insecure = invite
+
+[ast2-t38]
+type = friend
+fromuser = ast1-t38
+context = receivefax
+host = 127.0.0.2
+t38pt_udptl = yes
+disallow = all
+allow = ulaw
+qualify = no
+insecure = invite
+

Propchange: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/extensions.conf?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/extensions.conf (added)
+++ asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/extensions.conf Mon Aug 22 11:36:29 2011
@@ -1,0 +1,9 @@
+[gatewayfax]
+exten => 1234,1,noop
+exten => 1234,n,Set(FAXOPT(gateway)=yes)
+exten => 1234,n,Set(FAXOPT(timeout)=no)
+exten => 1234,n,Dial(sip/ast1-t38/1234)
+
+exten => h,1,noop
+exten => h,n,UserEvent(FaxStatus,operation: gateway,status: ${FAXOPT(status)},statusstr: ${FAXOPT(statusstr)},error: ${FAXOPT(error)})
+

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

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

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

Added: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/manager.general.conf.inc
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/manager.general.conf.inc?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/manager.general.conf.inc (added)
+++ asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/manager.general.conf.inc Mon Aug 22 11:36:29 2011
@@ -1,0 +1,2 @@
+enabled = yes
+bindaddr = 127.0.0.2

Propchange: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/sip.conf?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/sip.conf (added)
+++ asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/sip.conf Mon Aug 22 11:36:29 2011
@@ -1,0 +1,25 @@
+[general]
+bindaddr = 127.0.0.2
+
+[ast1-g711]
+type = friend
+fromuser = ast2-g711
+context = gatewayfax
+host = 127.0.0.1
+t38pt_udptl = no
+disallow = all
+allow = ulaw
+qualify = no
+insecure = invite
+
+[ast1-t38]
+type = friend
+fromuser = ast2-t38
+context = gatewayfax
+host = 127.0.0.1
+t38pt_udptl = yes
+disallow = all
+allow = ulaw
+qualify = no
+insecure = invite
+

Propchange: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/fax/gateway_timeout4/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/gateway_timeout4/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout4/run-test?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout4/run-test (added)
+++ asterisk/trunk/tests/fax/gateway_timeout4/run-test Mon Aug 22 11:36:29 2011
@@ -1,0 +1,95 @@
+#!/usr/bin/env python
+# vim: sw=3 et:
+'''
+Copyright (C) 2011, Digium, Inc.
+Matthew Nicholson <mnicholson 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 re
+import shutil
+
+from twisted.internet import reactor
+
+sys.path.append("lib/python")
+from asterisk.asterisk import Asterisk
+from asterisk.TestCase import TestCase
+
+class GatewayTest(TestCase):
+   event_count = 0
+   success_count = 0
+   reactor_timeout = 360
+
+   def __init__(self, argv):
+      TestCase.__init__(self, argv)
+      self.create_asterisk(2)
+
+      # copy the tiff file we are going to send to a good known location
+      shutil.copy("%s/send.tiff" % (os.path.dirname(argv[0]),), "%s%s" % (self.ast[0].base, self.ast[0].directories['astdatadir']))
+
+   def ami_connect(self, ami):
+      TestCase.ami_connect(self, ami)
+
+      if ami.id == 0:
+
+         print "sending a call from ast1 to ast2"
+
+         ami.registerEvent('UserEvent', self.fax_result)
+         df = ami.originate("sip/ast2-t38/1234", "sendfax", "1234", 1)
+
+         def handle_failure(reason):
+            print "error sending originate:"
+            print reason.getTraceback()
+            self.stop_reactor()
+
+            return reason
+
+         df.addErrback(handle_failure)
+      else:
+         ami.registerEvent('UserEvent', self.fax_result)
+
+   def fax_result(self, ami, event):
+      if event['userevent'] != 'TestStatus' and event['userevent'] != 'FaxStatus':
+         return
+
+      self.event_count += 1
+
+      if event['status'] == "SUCCESS":
+         self.success_count += 1
+      else:
+         print "test error, expected SUCCESS"
+         print "status: %s" % (event['status'],)
+         print "error: %s" % (event['error'],)
+         print "statusstr: %s" % (event['statusstr'],)
+
+      self.are_we_there_yet()
+
+   def are_we_there_yet(self):
+      if self.event_count == 3:
+         if self.success_count == 3:
+            self.passed = True
+         self.stop_reactor()
+
+   def run(self):
+      TestCase.run(self)
+      self.create_ami_factory(2)
+
+
+def main(argv = sys.argv):
+   test = GatewayTest(argv)
+   test.start_asterisk()
+   reactor.run()
+   test.stop_asterisk()
+
+   if not test.passed:
+      return 1
+
+   return 0
+
+if __name__ == "__main__":
+   sys.exit(main() or 0)
+

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

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

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

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

Added: asterisk/trunk/tests/fax/gateway_timeout4/send.tiff
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout4/send.tiff?view=auto&rev=1882
==============================================================================
Binary file - no diff available.

Propchange: asterisk/trunk/tests/fax/gateway_timeout4/send.tiff
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: asterisk/trunk/tests/fax/gateway_timeout4/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout4/test-config.yaml?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout4/test-config.yaml (added)
+++ asterisk/trunk/tests/fax/gateway_timeout4/test-config.yaml Mon Aug 22 11:36:29 2011
@@ -1,0 +1,21 @@
+testinfo:
+    summary: 'Test the fax gateway.'
+    description: |
+        This test verifies that the gateway times out when no fax activity is
+        detected.
+
+        The call flow looks like this:
+         |send        |
+         |t38      t38|
+         |----------->|
+         |     gateway|
+         |t38      t38|
+         |<-----------|
+        \|receive     |/
+
+properties:
+    minversion: '10'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - custom : 'fax'

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

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

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

Added: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/extensions.conf?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/extensions.conf Mon Aug 22 11:36:29 2011
@@ -1,0 +1,16 @@
+[receivefax]
+exten => 1234,1,noop
+exten => 1234,n,Playback(demo-congrats)
+exten => 1234,n,ReceiveFax(${ASTDATADIR}/receive.tiff)
+
+exten => h,1,noop
+exten => h,n,UserEvent(FaxStatus,operation: receive,status: ${FAXOPT(status)},statusstr: ${FAXOPT(statusstr)},error: ${FAXOPT(error)})
+
+[sendfax]
+exten => 1234,1,noop
+exten => 1234,n,Playback(demo-congrats)
+exten => 1234,n,SendFax(${ASTDATADIR}/send.tiff)
+
+exten => h,1,noop
+exten => h,n,UserEvent(FaxStatus,operation: send,status: ${FAXOPT(status)},statusstr: ${FAXOPT(statusstr)},error: ${FAXOPT(error)})
+

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

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

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

Added: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/manager.general.conf.inc
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/manager.general.conf.inc?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/manager.general.conf.inc (added)
+++ asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/manager.general.conf.inc Mon Aug 22 11:36:29 2011
@@ -1,0 +1,2 @@
+enabled = yes
+bindaddr = 127.0.0.1

Propchange: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/sip.conf?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/sip.conf Mon Aug 22 11:36:29 2011
@@ -1,0 +1,25 @@
+[general]
+bindaddr = 127.0.0.1
+
+[ast2-g711]
+type = friend
+fromuser = ast1-g711
+context = receivefax
+host = 127.0.0.2
+t38pt_udptl = no
+disallow = all
+allow = ulaw
+qualify = no
+insecure = invite
+
+[ast2-t38]
+type = friend
+fromuser = ast1-t38
+context = receivefax
+host = 127.0.0.2
+t38pt_udptl = yes
+disallow = all
+allow = gsm
+qualify = no
+insecure = invite
+

Propchange: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast1/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/extensions.conf?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/extensions.conf (added)
+++ asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/extensions.conf Mon Aug 22 11:36:29 2011
@@ -1,0 +1,9 @@
+[gatewayfax]
+exten => 1234,1,noop
+exten => 1234,n,Set(FAXOPT(gateway)=yes)
+exten => 1234,n,Set(FAXOPT(timeout)=60)
+exten => 1234,n,Dial(sip/ast1-g711/1234)
+
+exten => h,1,noop
+exten => h,n,UserEvent(FaxStatus,operation: gateway,status: ${FAXOPT(status)},statusstr: ${FAXOPT(statusstr)},error: ${FAXOPT(error)})
+

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

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

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

Added: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/manager.general.conf.inc
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/manager.general.conf.inc?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/manager.general.conf.inc (added)
+++ asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/manager.general.conf.inc Mon Aug 22 11:36:29 2011
@@ -1,0 +1,2 @@
+enabled = yes
+bindaddr = 127.0.0.2

Propchange: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/manager.general.conf.inc
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/sip.conf?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/sip.conf (added)
+++ asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/sip.conf Mon Aug 22 11:36:29 2011
@@ -1,0 +1,25 @@
+[general]
+bindaddr = 127.0.0.2
+
+[ast1-g711]
+type = friend
+fromuser = ast2-g711
+context = gatewayfax
+host = 127.0.0.1
+t38pt_udptl = no
+disallow = all
+allow = ulaw
+qualify = no
+insecure = invite
+
+[ast1-t38]
+type = friend
+fromuser = ast2-t38
+context = gatewayfax
+host = 127.0.0.1
+t38pt_udptl = yes
+disallow = all
+allow = gsm
+qualify = no
+insecure = invite
+

Propchange: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/fax/gateway_timeout5/configs/ast2/sip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/fax/gateway_timeout5/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fax/gateway_timeout5/run-test?view=auto&rev=1882
==============================================================================
--- asterisk/trunk/tests/fax/gateway_timeout5/run-test (added)
+++ asterisk/trunk/tests/fax/gateway_timeout5/run-test Mon Aug 22 11:36:29 2011
@@ -1,0 +1,114 @@
+#!/usr/bin/env python
+# vim: sw=3 et:
+'''
+Copyright (C) 2011, Digium, Inc.
+Matthew Nicholson <mnicholson 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 re
+import shutil
+
+from twisted.internet import reactor
+
+sys.path.append("lib/python")
+from asterisk.asterisk import Asterisk
+from asterisk.TestCase import TestCase
+
+class GatewayTest(TestCase):
+   event_count = 0
+   success_count = 0
+   reactor_timeout = 360
+
+   def __init__(self, argv):

[... 166 lines stripped ...]



More information about the asterisk-commits mailing list