[asterisk-commits] lmadsen: branch lmadsen/DialplanTestCase r1655 - /asterisk/team/lmadsen/Dialp...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 20 14:48:01 CDT 2011


Author: lmadsen
Date: Mon Jun 20 14:47:57 2011
New Revision: 1655

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1655
Log:
Add my current list of dialplan tests.

Modified:
    asterisk/team/lmadsen/DialplanTestCase/tests/DialPlan/configs/ast1/extensions.conf

Modified: asterisk/team/lmadsen/DialplanTestCase/tests/DialPlan/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/lmadsen/DialplanTestCase/tests/DialPlan/configs/ast1/extensions.conf?view=diff&rev=1655&r1=1654&r2=1655
==============================================================================
--- asterisk/team/lmadsen/DialplanTestCase/tests/DialPlan/configs/ast1/extensions.conf (original)
+++ asterisk/team/lmadsen/DialplanTestCase/tests/DialPlan/configs/ast1/extensions.conf Mon Jun 20 14:47:57 2011
@@ -5,9 +5,164 @@
 
 [test]
 exten => s,1,NoOp()
-    same => n,Answer()
-    same => n,Set(TestResult=True)
-    same => n,Hangup()
+same => n,Goto(start,1)
+
+exten => start,1,NoOp()
+same => n,Set(TestCounter=0)
+same => n,Set(Result=OK)
+same => n(top),NoOp()
+same => n,Set(TestCounter=${INC(TestCounter)})
+same => n,GotoIf($[${Result} != OK]?result_fail,1)
+
+; test numerical extensions
+same => n,ExecIf($[${TestCounter} = 1]?Goto(patterns,100,1))
+same => n,ExecIf($[${TestCounter} = 2]?Goto(patterns,101,1))
+same => n,ExecIf($[${TestCounter} = 3]?Goto(patterns,106,1))
+same => n,ExecIf($[${TestCounter} = 10]?Goto(patterns,155,1))
+same => n,ExecIf($[${TestCounter} = 11]?Goto(patterns,255,1))
+
+; test alpha extensions
+same => n,ExecIf($[${TestCounter} = 4]?Goto(patterns,abc,1))
+same => n,ExecIf($[${TestCounter} = 5]?Goto(patterns,abc0,1))
+same => n,ExecIf($[${TestCounter} = 6]?Goto(patterns,abc2,1))
+same => n,ExecIf($[${TestCounter} = 7]?Goto(patterns,cba,1))
+same => n,ExecIf($[${TestCounter} = 8]?Goto(patterns,cbaz,1))
+same => n,ExecIf($[${TestCounter} = 9]?Goto(patterns,cbazy,1))
+
+; test dialplan functions
+same => n,ExecIf($[${TestCounter} = 12]?Goto(base64,start,1))
+same => n,ExecIf($[${TestCounter} = 13]?Goto(aes,start,1))
+
+; end of pattern match testing
+
+
+
+same => n,Goto(result_pass,1)
+
+; *** Results
+exten => result_pass,1,NoOp()
+same => n,Set(TestResult=True)
+same => n,Hangup()
+
+exten => result_fail,1,NoOp()
+same => n,Set(TestResult=False)
+same => n,Hangup()
+; ***
 
 exten => h,1,UserEvent(TestResult, result: ${TestResult})
 
+; MATH
+
+; BASE64
+[base64]
+exten => start,1,NoOp()
+same => n,Set(Encoded=YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NTY3ODk=)
+same => n,Set(Decoded=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789)
+same => n,Set(EncodingResult=${BASE64_ENCODE(${Decoded})})
+same => n,Set(TestResult=${IF($["${EncodingResult}" = "${Encoded}"]?OK:Fail)})
+same => n,GotoIf($[${TestResult} = Fail]?test,result_fail,1)
+same => n,Set(DecodingResult=${BASE64_DECODE(${Encoded})})
+same => n,Set(TestResult=${IF($["${DecodingResult}" = "${Decoded}"]?OK:Fail)})
+same => n,GotoIf($[${TestResult} = Fail]?test,result_fail,1)
+same => n,Goto(test,start,top)
+
+; AES
+[aes]
+exten => start,1,NoOp()
+same => n,Set(Key=1qaz2wsx3edc4rfv)
+same => n,Set(Encoded=KfAgilzmckUn1bH3NNLFHKfHA36w2EAHJvJvWqEQSSwdLroipj/Cp+dVt2FtjxBXT30cQcQiM0Plgb20pTqPAw==)
+same => n,Set(Decoded=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789)
+same => n,Set(EncodingResult=${AES_ENCRYPT(${Key},${Decoded})})
+same => n,Set(TestResult=${IF($["${EncodingResult}" = "${Encoded}"]?OK:Fail)})
+same => n,GotoIf($[${TestResult} = Fail]?test,result_fail,1)
+same => n,Set(DecodingResult=${AES_DECRYPT(${Key},${Encoded})})
+same => n,Set(TestResult=${IF($["${DecodingResult}" = "${Decoded}"]?OK:Fail)})
+same => n,GotoIf($[${TestResult} = Fail]?test,result_fail,1)
+same => n,Goto(test,start,top)
+
+; STRING (LEN, CUT, ISNULL, EXISTS)
+
+; REPLACE()
+
+; IF
+
+; MD5
+
+; SHA1
+
+; DEC / INC
+
+; SHELL
+
+; FIELDNUM / FIELDQTY
+
+; AstDB functions
+
+; POP, PUSH, SHIFT, UNSHIFT
+
+; URIENCODE, URIDECODE
+
+; VALID_EXTEN
+
+
+[patterns]
+; *** Patterns to match
+exten => 100,1,NoOp()
+same => n,Set(2,Extension '${EXTEN}' matched on '100')
+same => n,Set(Result=${IF($[${TestCounter} = 1]?OK:Fail)})
+same => n,Goto(test,start,top)
+
+exten => _1X[0-5],1,NoOp()
+same => n,Set(2,Extension '${EXTEN}' matched on '_1X[0-5]')
+same => n,Set(Result=${IF($[${TestCounter} = 2]?OK:Fail)})
+same => n,Goto(test,start,top)
+
+exten => _1XX,1,NoOp()
+same => n,Set(2,Extension '${EXTEN}' matched on '_1XX')
+same => n,Set(Result=${IF($[${TestCounter} = 3]?OK:Fail)})
+same => n,Goto(test,start,top)
+
+exten => abc,1,NoOp()
+same => n,Set(2,Extension '${EXTEN}' matched on 'abc')
+same => n,Set(Result=${IF($[${TestCounter} = 4]?OK:Fail)})
+same => n,Goto(test,start,top)
+
+exten => _[a][b][c]X,1,NoOp()
+same => n,Set(2,Extension '${EXTEN}' matched on '_[a][b][c]X')
+same => n,Set(Result=${IF($[${TestCounter} = 5]?OK:Fail)})
+same => n,Goto(test,start,top)
+
+exten => _[a][b][c]N,1,NoOp()
+same => n,Set(2,Extension '${EXTEN}' matched on '_[a][b][c]N')
+same => n,Set(Result=${IF($[${TestCounter} = 6]?OK:Fail)})
+same => n,Goto(test,start,top)
+
+exten => cba,1,NoOp()
+same => n,Set(2,Extension '${EXTEN}' matched on 'cba')
+same => n,Set(Result=${IF($[${TestCounter} = 7]?OK:Fail)})
+same => n,Goto(test,start,top)
+
+exten => _[c][b][a]!,1,NoOp()
+same => n,Set(2,Extension '${EXTEN}' matched on '_[c][b][a]!')
+same => n,Set(Result=${IF($[${TestCounter} = 8]?OK:Fail)})
+same => n,Goto(test,start,top)
+
+exten => _[c][b][a][z].,1,NoOp()
+same => n,Set(2,Extension '${EXTEN}' matched on '_[c][b][a][z].')
+same => n,Set(Result=${IF($[${TestCounter} = 9]?OK:Fail)})
+same => n,Goto(test,start,top)
+
+exten => _1[5][0-5],1,NoOp()
+same => n,Set(2,Extension '${EXTEN}' matched on '_1[5][0-5]')
+same => n,Set(Result=${IF($[${TestCounter} = 10]?OK:Fail)})
+same => n,Goto(test,start,top)
+
+exten => _[1-2][5][0-5],1,NoOp()
+same => n,Set(2,Extension '${EXTEN}' matched on '_[1-2][5][0-5]')
+same => n,Set(Result=${IF($[${TestCounter} = 11]?OK:Fail)})
+same => n,Goto(test,start,top)
+
+; ***
+
+
+




More information about the asterisk-commits mailing list