diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 14:11:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 14:11:00 +0000 |
commit | af754e596a8dbb05ed8580c342e7fe02e08b28e0 (patch) | |
tree | b2f334c2b55ede42081aa6710a72da784547d8ea /src/tests/keywords/foreach-return | |
parent | Initial commit. (diff) | |
download | freeradius-af754e596a8dbb05ed8580c342e7fe02e08b28e0.tar.xz freeradius-af754e596a8dbb05ed8580c342e7fe02e08b28e0.zip |
Adding upstream version 3.2.3+dfsg.upstream/3.2.3+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tests/keywords/foreach-return')
-rw-r--r-- | src/tests/keywords/foreach-return | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/tests/keywords/foreach-return b/src/tests/keywords/foreach-return new file mode 100644 index 0000000..05409c9 --- /dev/null +++ b/src/tests/keywords/foreach-return @@ -0,0 +1,52 @@ +# PRE: foreach foreach-break +# + +update control { + Cleartext-Password := 'hello' +} + +# +# Adding attribute during request and immediately returning should still work +# +update request { + Filter-Id := "1" + Filter-Id += "2" + Filter-Id += "3" + Filter-Id += "4" + Filter-Id += "5" +} + +foreach &Filter-Id { + if ("%{Foreach-Variable-0}" == "3") { + update reply { + Filter-Id := "filter" + } + + # + # We need this because the "return" below + # will prevent the "pap" module from being run + # in the "authorize" section. + # + update control { + Auth-Type := PAP + } + + # + # Stop processing "authorize", and go to the next section. + # + return + + # + # Shouldn't reach this + # + update reply { + Filter-Id := "fail" + } + } + + if ("%{Foreach-Variable-0}" == "4") { + update reply { + Filter-Id := "fail-4" + } + } +} |