Add more tests for deletions
[freeradius.git] / src / tests / keywords / update-remove-list
1 #
2 # PRE: update
3 #
4 #  Remove all attributes in a list
5 #
6 update {
7         control:Cleartext-Password := 'hello'
8         reply:Filter-Id := 'filter'
9 }
10
11 update request {
12         Tmp-String-0 := 'foobarbaz'
13         Tmp-Integer-0 := 123456789
14         Tmp-IP-Address-0 := 192.0.2.1
15 }
16
17 if ((Tmp-String-0 != 'foobarbaz') || (Tmp-Integer-0 != 123456789) || (Tmp-IP-Address-0 != 192.0.2.1)) {
18         update reply {
19                 Filter-Id += 'fail 0'
20         }
21 }
22
23 # Remove all attributes in the control list
24 update {
25         request: !* ANY
26 }
27
28 # All attributes should now of been removed
29 if ((Tmp-String-0 && (Tmp-String-0 == 'foobarbaz')) || \
30     (Tmp-Integer-0 && (Tmp-Integer-0 == 123456789)) || \
31     (Tmp-IP-Address-0 && (Tmp-IP-Address-0 == 192.0.2.1))) {
32         update reply {
33                 Filter-Id := 'fail 1'
34         }
35 }
36
37 # This will of been removed too
38 update request {
39         User-Password := 'hello'
40 }