summaryrefslogtreecommitdiffstats
path: root/src/tests/modules/files/authorize
blob: 6ef314eb4bc92ce1ad00d662afac8eff259f61e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#
#  Test if the "users" file works
#


#
#  Basic syntax tests with comments. Parsing only.
#

user    Cleartext-Password := "hello" # comment!


user2   # comment!
        Reply-Message := "24"


#
#  Setting ":=" of reply and control items
#

bob  Cleartext-Password := "hello"
     Reply-Message := "success"


#
#  Detect erroneous Fall-Through
#

doug  Cleartext-Password := "goodbye"
      Reply-Message := "success"

doug
      Reply-Message := "unreachable"


#
#  Fall-Through across a non-matching entry
#

famous  Cleartext-Password := "bradpitt"
        Fall-Through = yes

unused  Cleartext-Password := "jabberwocky"
        Reply-Message := "fail"

famous
        Reply-Message := "success"


#
#  Modification of the reply list
#

addreply  Cleartext-Password := "testing123"
          Reply-Message := "success1",
          Fall-Through = yes

addreply
          Reply-Message += "success2"


subreply  Cleartext-Password := "testing123"
          Reply-Message := "success1",
          Reply-Message += "success2",
          Reply-Message += "success3",
          Fall-Through = yes

subreply  Cleartext-Password := "testing123"
          Reply-Message -= "success2"


filterreply  Cleartext-Password := "testing123"
             Reply-Message := "success1",
             Reply-Message += "success2",
             Fall-Through = yes

filterreply  Cleartext-Password := "testing123"
             Reply-Message !* ANY


#
#  Addition "+=" to the control list
#
#  Note: Set ":=" of control items is already tested with Cleartext-Password
#  Note: Filtering "!*" does not apply to control items as this would overload
#        the operator syntax since "!*" checks that no such attribute in the
#        request.

addcontrol  Cleartext-Password := "testing123", Reply-Message := "success1"
            Fall-Through = yes

addcontrol  Reply-Message += "success2"


#
#  Doesn't match
#
DEFAULT	Framed-IP-Address == 192.0.2.1
	Reply-Message += "unexpected match in DEFAULT"

DEFAULT
	Reply-Message = "empty DEFAULT"