Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / tests / test_sip_conf.aug
1 module Test_sip_conf =
2
3 let conf = "[general]
4 context=default                 ; Default context for incoming calls
5 udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
6 ; The address family of the bound UDP address is used to determine how Asterisk performs
7 ; DNS lookups. In cases a) and c) above, only A records are considered. In case b), only
8 ; AAAA records are considered. In case d), both A and AAAA records are considered. Note,
9
10
11 [basic-options-title](!,superclass-template);a template for my preferred codecs !@#$%#@$%^^&%%^*&$%
12         #comment after the title
13         dtmfmode=rfc2833
14         context=from-office
15         type=friend
16
17
18 [my-codecs](!)                    ; a template for my preferred codecs
19         disallow=all
20         allow=ilbc
21         allow=g729
22         allow=gsm
23         allow=g723
24         allow=ulaw
25
26 [2133](natted-phone,my-codecs) ;;;;; some sort of comment
27        secret = peekaboo
28 [2134](natted-phone,ulaw-phone)
29        secret = not_very_secret
30 [2136](public-phone,ulaw-phone)
31        secret = not_very_secret_either
32 "
33
34 test Sip_Conf.lns get conf =
35   { "title" = "general"
36     { "context" = "default"
37       { "#comment" = "Default context for incoming calls" }
38     }
39     { "udpbindaddr" = "0.0.0.0"
40       { "#comment" = "IP address to bind UDP listen socket to (0.0.0.0 binds to all)" }
41     }
42     { "#comment" = "The address family of the bound UDP address is used to determine how Asterisk performs" }
43     { "#comment" = "DNS lookups. In cases a) and c) above, only A records are considered. In case b), only" }
44     { "#comment" = "AAAA records are considered. In case d), both A and AAAA records are considered. Note," }
45     {  }
46     {  }
47   }
48   { "title" = "basic-options-title"
49     { "@is_template" }
50     { "@use_template" = "superclass-template" }
51     { "#title_comment" = ";a template for my preferred codecs !@#$%#@$%^^&%%^*&$%" }
52     { "#comment" = "comment after the title" }
53     { "dtmfmode" = "rfc2833" }
54     { "context" = "from-office" }
55     { "type" = "friend" }
56     {  }
57     {  }
58   }
59   { "title" = "my-codecs"
60     { "@is_template" }
61     { "#title_comment" = "                    ; a template for my preferred codecs" }
62     { "disallow" = "all" }
63     { "allow" = "ilbc" }
64     { "allow" = "g729" }
65     { "allow" = "gsm" }
66     { "allow" = "g723" }
67     { "allow" = "ulaw" }
68     {  }
69   }
70   { "title" = "2133"
71     { "@use_template" = "natted-phone" }
72     { "@use_template" = "my-codecs" }
73     { "#title_comment" = " ;;;;; some sort of comment" }
74     { "secret" = "peekaboo" }
75   }
76   { "title" = "2134"
77     { "@use_template" = "natted-phone" }
78     { "@use_template" = "ulaw-phone" }
79     { "secret" = "not_very_secret" }
80   }
81   { "title" = "2136"
82     { "@use_template" = "public-phone" }
83     { "@use_template" = "ulaw-phone" }
84     { "secret" = "not_very_secret_either" }
85   }
86
87   (*********************************************
88   * Tests for update, create, delete
89   *
90   *********************************************)
91   
92   (*********************************************
93   * Test to confirm that we can update the
94   * default context
95   *
96   *********************************************)
97   test Sip_Conf.lns put "[general]\ncontext=default\n" after
98       set "title[.='general']/context" "updated"
99   = "[general]\ncontext=updated
100 "
101
102   (*********************************************
103   * Test to confirm that we can create a
104   * new title with a context
105   *
106   *********************************************)
107   test Sip_Conf.lns put "[general]\ncontext=default\n" after
108       set "/title[.='newtitle']" "newtitle"; set "/title[.='newtitle']/context" "foobarbaz"
109   = "[general]\ncontext=default
110 [newtitle]
111 context=foobarbaz
112 "
113