Skip to content

Commit f7ef08a

Browse files
InterLinked1Friendly Automation
authored and
Friendly Automation
committed
cdr: Add tests for ignore options.
Adds tests for the ignorestatechanges and ignoredialchanges options in cdr.conf. ASTERISK-30091 Change-Id: Idbb65c8427284d13c8a8a08739d2eb5f3f8d36b6
1 parent 36f1abe commit f7ef08a

File tree

7 files changed

+147
-0
lines changed

7 files changed

+147
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[general]
2+
enable=yes
3+
debug=yes
4+
ignorestatechanges=yes
5+
ignoredialchanges=yes
6+
7+
[csv]
8+
usegmtime=yes ; log date/time in GMT. Default is "no"
9+
loguniqueid=yes ; log uniqueid. Default is "no"
10+
loguserfield=yes ; log user field. Default is "no"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[default]
2+
exten => echo,1,NoOp()
3+
same => n,Set(CDR_PROP(disable)=1)
4+
same => n,Answer()
5+
same => n,Echo()
6+
exten => nodialchanges,1,NoOp()
7+
same => n,Set(CDR_PROP(disable)=0)
8+
same => n,Dial(Local/target@default/n,,g)
9+
same => n,Dial(Local/valid@default/n,,g)
10+
same => n,Dial(Local/valid@default/n,,g)
11+
same => n,Hangup()
12+
exten => target,1,NoOp()
13+
same => n,Set(CDR_PROP(disable)=1)
14+
same => n,Answer()
15+
same => n,Wait(0.1)
16+
same => n,Hangup()
17+
exten => valid,1,NoOp()
18+
same => n,Set(CDR_PROP(disable)=1)
19+
same => n,Answer()
20+
same => n,Wait(0.1)
21+
same => n,Hangup()
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
testinfo:
2+
summary: 'Test ignoredialchanges'
3+
description: |
4+
'This test makes sure that dial state changes
5+
do not affect the CDR when the ignoredialchanges
6+
option is set to yes.'
7+
8+
test-modules:
9+
test-object:
10+
config-section: 'test-object-config'
11+
typename: 'test_case.SimpleTestCase'
12+
modules:
13+
-
14+
config-section: 'cdr-config'
15+
typename: 'cdr.CDRModule'
16+
17+
test-object-config:
18+
spawn-after-hangup: True
19+
test-iterations:
20+
-
21+
channel: 'Local/nodialchanges@default'
22+
context: 'default'
23+
exten: 'echo'
24+
priority: '1'
25+
26+
cdr-config:
27+
-
28+
file: 'Master'
29+
lines:
30+
-
31+
destination: 'nodialchanges'
32+
dcontext: 'default'
33+
channel: 'Local/nodialchanges@default-.*'
34+
disposition: 'ANSWERED'
35+
amaflags: 'DOCUMENTATION'
36+
37+
properties:
38+
dependencies:
39+
- python: 'twisted'
40+
- python: 'starpy'
41+
- asterisk: 'app_echo'
42+
- asterisk: 'app_dial'
43+
- asterisk: 'func_cdr'
44+
tags:
45+
- CDR
46+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[general]
2+
enable=yes
3+
debug=yes
4+
ignorestatechanges=yes
5+
6+
[csv]
7+
usegmtime=yes ; log date/time in GMT. Default is "no"
8+
loguniqueid=yes ; log uniqueid. Default is "no"
9+
loguserfield=yes ; log user field. Default is "no"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[default]
2+
exten => echo,1,NoOp()
3+
same => n,Set(CDR_PROP(disable)=1)
4+
same => n,Answer()
5+
same => n,Echo()
6+
exten => nostatechanges,1,NoOp()
7+
same => n,Set(CDR_PROP(disable)=0)
8+
same => n,Set(CONFBRIDGE(user,quiet)=yes) ; suppress prompts to speed up the test
9+
same => n,Set(CONFBRIDGE(user,timeout)=1)
10+
same => n,ConfBridge(test)
11+
same => n,ConfBridge(test)
12+
same => n,ConfBridge(test)
13+
same => n,Hangup()
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
testinfo:
2+
summary: 'Test ignorestatechanges'
3+
description: |
4+
'This test makes sure that bridging changes, such
5+
as entering and leaving bridges like ConfBridge, do not affect the
6+
CDR when the ignorestatechanges option is set to yes.'
7+
8+
test-modules:
9+
test-object:
10+
config-section: 'test-object-config'
11+
typename: 'test_case.SimpleTestCase'
12+
modules:
13+
-
14+
config-section: 'cdr-config'
15+
typename: 'cdr.CDRModule'
16+
17+
test-object-config:
18+
spawn-after-hangup: True
19+
test-iterations:
20+
-
21+
channel: 'Local/nostatechanges@default'
22+
context: 'default'
23+
exten: 'echo'
24+
priority: '1'
25+
26+
cdr-config:
27+
-
28+
file: 'Master'
29+
lines:
30+
-
31+
destination: 'nostatechanges'
32+
dcontext: 'default'
33+
channel: 'Local/nostatechanges@default-.*'
34+
disposition: 'ANSWERED'
35+
amaflags: 'DOCUMENTATION'
36+
37+
properties:
38+
dependencies:
39+
- python: 'twisted'
40+
- python: 'starpy'
41+
- asterisk: 'app_echo'
42+
- asterisk: 'app_dial'
43+
- asterisk: 'func_cdr'
44+
tags:
45+
- CDR
46+

tests/cdr/cdr_manipulation/tests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ tests:
66
- test: 'nocdr'
77
- test: 'cdr_prop_disable'
88
- test: 'func_cdr'
9+
- test: 'cdr_ignore_state_changes'
10+
- test: 'cdr_ignore_dial_changes'

0 commit comments

Comments
 (0)