[asterisk-commits] kmoore: testsuite/asterisk/trunk r5584 - in /asterisk/trunk/tests/manager: ./...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 16 08:09:41 CDT 2014


Author: kmoore
Date: Tue Sep 16 08:09:36 2014
New Revision: 5584

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5584
Log:
Testsuite: Add AllVariables Status parameter test

This adds a basic test for the AllVariables parameter to the Status AMI
command which returns all channel variables associated with a channel.

Review: https://reviewboard.asterisk.org/r/3916/

Added:
    asterisk/trunk/tests/manager/status_all_vars/
    asterisk/trunk/tests/manager/status_all_vars/configs/
    asterisk/trunk/tests/manager/status_all_vars/configs/ast1/
    asterisk/trunk/tests/manager/status_all_vars/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/manager/status_all_vars/status.py   (with props)
    asterisk/trunk/tests/manager/status_all_vars/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/manager/tests.yaml

Added: asterisk/trunk/tests/manager/status_all_vars/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/status_all_vars/configs/ast1/extensions.conf?view=auto&rev=5584
==============================================================================
--- asterisk/trunk/tests/manager/status_all_vars/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/manager/status_all_vars/configs/ast1/extensions.conf Tue Sep 16 08:09:36 2014
@@ -1,0 +1,7 @@
+[default]
+
+exten => s,1,NoOp()
+ same => n,Answer()
+ same => n,Set(test_var=test_var_content)
+ same => n,Echo()
+

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

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

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

Added: asterisk/trunk/tests/manager/status_all_vars/status.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/status_all_vars/status.py?view=auto&rev=5584
==============================================================================
--- asterisk/trunk/tests/manager/status_all_vars/status.py (added)
+++ asterisk/trunk/tests/manager/status_all_vars/status.py Tue Sep 16 08:09:36 2014
@@ -1,0 +1,31 @@
+#!/usr/bin/env python
+"""Test snippet that drives the Status AMI action in the status test
+
+Copyright (C) 2014, Digium, Inc.
+Matt Jordan <mjordan at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+"""
+
+def exec_status(ami, event):
+    """Run the Status AMI action, then hangup
+
+    Keyword Arguments:
+    ami   The AMI connection
+    event The event that triggered the callback
+    """
+
+    def _hangup_channels(result, ami, channel):
+        ami.hangup(channel)
+        return result
+
+    # Get a list of channels
+    message = {
+        'action': 'Status',
+        'AllVariables': 'true'
+    }
+    df = ami.collectDeferred(message, 'StatusComplete')
+    df.addCallback(_hangup_channels, ami, "Local/s at default-00000000;1")
+
+    return True

Propchange: asterisk/trunk/tests/manager/status_all_vars/status.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/manager/status_all_vars/status.py
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/manager/status_all_vars/status.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/manager/status_all_vars/status.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/manager/status_all_vars/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/status_all_vars/test-config.yaml?view=auto&rev=5584
==============================================================================
--- asterisk/trunk/tests/manager/status_all_vars/test-config.yaml (added)
+++ asterisk/trunk/tests/manager/status_all_vars/test-config.yaml Tue Sep 16 08:09:36 2014
@@ -1,0 +1,124 @@
+testinfo:
+    summary: 'Test AMI Status Action'
+    description: |
+        This test verifies the AMI Status Action AllVariables parameter.
+        A Local channel is created and then the test runs the action for
+        all channels on the system. Two events are expected, one for each
+        of the Local channel pairs.
+
+test-modules:
+    add-test-to-search-path: 'True'
+    test-object:
+        config-section: test-config
+        typename: 'test_case.SimpleTestCase'
+    modules:
+      -
+        config-section: 'ami-config'
+        typename: 'ami.AMIEventModule'
+
+test-config:
+  spawn-after-hangup: True
+  expected_events: 0
+  test-iterations:
+    -
+      channel: 'Local/s at default'
+      application: 'Echo'
+      data: ''
+
+ami-config:
+  -
+    type: 'callback'
+    conditions:
+      match:
+          Event: 'Newexten'
+          Exten: 's'
+          Context: 'default'
+          Priority: '4'
+          Channel: 'Local/s at default-00000000;2'
+    callbackModule: 'status'
+    callbackMethod: 'exec_status'
+    count: '1'
+  -
+    type: 'headermatch'
+    conditions:
+      match:
+          Event: 'Status'
+          Channel: 'Local/s at default-00000000;1'
+    requirements:
+      match:
+          Privilege: 'Call'
+          ChannelState: '6'
+          ChannelStateDesc: 'Up'
+          CallerIDNum: '<unknown>'
+          CallerIDName: '<unknown>'
+          ConnectedLineNum: '<unknown>'
+          ConnectedLineName: '<unknown>'
+          Accountcode: ''
+          Context: 'default'
+          Exten: 's'
+          Priority: '1'
+          Uniqueid: '.+'
+          Type: 'Local'
+          DNID: ''
+          EffectiveConnectedLineNum: '<unknown>'
+          EffectiveConnectedLineName: '<unknown>'
+          TimeToHangup: '0'
+          BridgeID: ''
+          Linkedid: '.+'
+          Application: 'Echo'
+          Data: ''
+          Nativeformats: '\(slin\)'
+          Readformat: 'slin'
+          Readtrans: ''
+          Writeformat: 'slin'
+          Writetrans: ''
+          Callgroup: '0'
+          Pickupgroup: '0'
+          Seconds: '[0-9]'
+          Variable: 'testuniqueid=.*'
+    count: '1'
+  -
+    type: 'headermatch'
+    conditions:
+      match:
+          Event: 'Status'
+          Channel: 'Local/s at default-00000000;2'
+    requirements:
+      match:
+          Privilege: 'Call'
+          ChannelState: '6'
+          ChannelStateDesc: 'Up'
+          CallerIDNum: '<unknown>'
+          CallerIDName: '<unknown>'
+          ConnectedLineNum: '<unknown>'
+          ConnectedLineName: '<unknown>'
+          Accountcode: ''
+          Context: 'default'
+          Exten: 's'
+          Priority: '4'
+          Uniqueid: '.+'
+          Type: 'Local'
+          DNID: ''
+          EffectiveConnectedLineNum: '<unknown>'
+          EffectiveConnectedLineName: '<unknown>'
+          TimeToHangup: '0'
+          BridgeID: ''
+          Linkedid: '.+'
+          Application: 'Echo'
+          Data: ''
+          Nativeformats: '\(slin\)'
+          Readformat: 'slin'
+          Readtrans: ''
+          Writeformat: 'slin'
+          Writetrans: ''
+          Callgroup: '0'
+          Pickupgroup: '0'
+          Seconds: '[0-9]'
+          Variable: 'test_var=test_var_content|testuniqueid=.*'
+    count: '1'
+
+properties:
+    minversion: '14.0.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'

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

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

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

Modified: asterisk/trunk/tests/manager/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/tests.yaml?view=diff&rev=5584&r1=5583&r2=5584
==============================================================================
--- asterisk/trunk/tests/manager/tests.yaml (original)
+++ asterisk/trunk/tests/manager/tests.yaml Tue Sep 16 08:09:36 2014
@@ -16,6 +16,7 @@
     - test: 'mixmonitor'
     - test: 'manager_vars'
     - test: 'status'
+    - test: 'status_all_vars'
     - test: 'userevent'
     # Temporarily disabled while failures are debugged
     #- test: 'response-time'




More information about the asterisk-commits mailing list