Debian Codegraph @

src/tests/keywords/update-xlat

raw
1 #
2 # PRE: update
3 #
4 # Form attribute references with xlats
5 #
6 update {
7 control:Cleartext-Password := 'hello'
8 reply:Filter-Id := 'filter'
9 }
10
11
12 update request {
13 Tmp-String-0 := 'Tmp-String-1'
14 }
15
16 #
17 # Shouldn't update Tmp-String-0, should instead update Tmp-String-1
18 # ... maybe this is what Alan meant when he was talking about people
19 # doing stupid things with this feature.
20 #
21 update request {
22 "%{Tmp-String-0}" := 'hello'
23 }
24
25 if (&Tmp-String-1 != 'hello') {
26 update reply {
27 Filter-Id += 'Fail 0'
28 }
29 }
30
31 if (&Tmp-String-0 == 'hello') {
32 update reply {
33 Filter-Id += 'Fail 1'
34 }
35 }
36
37 #
38 # Try updating an attribute specified by an OID string
39 #
40 update {
41 Tmp-Integer-0 := 11344
42 }
43 update {
44 "Vendor-%{Tmp-Integer-0}-Attr-1" := 127.0.0.1
45 }
46
47 if (&FreeRADIUS-Proxied-To != 127.0.0.1) {
48 update reply {
49 Filter-Id += 'Fail 2'
50 }
51 }
52
53 update {
54 "Attr-%{attr_num:Tmp-String-1}" := 'hello2'
55 }
56
57 if (&Tmp-String-1 != 'hello2') {
58 update reply {
59 Filter-Id += 'Fail 3'
60 }
61 }