]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add test for return after policy
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 10 Sep 2019 14:29:17 +0000 (09:29 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 10 Sep 2019 14:30:09 +0000 (09:30 -0500)
Policy sets return_point on that stack frame, so we need to make sure it's cleared when the next instruction is executed

src/tests/keywords/return-within-if-after-policy [new file with mode: 0644]

diff --git a/src/tests/keywords/return-within-if-after-policy b/src/tests/keywords/return-within-if-after-policy
new file mode 100644 (file)
index 0000000..30a4499
--- /dev/null
@@ -0,0 +1,14 @@
+#
+#  PRE: update if return
+#
+
+# Defeats return check...
+if ('true' == 'true') {
+       success
+       if(&User-Name == 'bob') {
+               "%{debug:%{debug:0}}"   # Noop
+               return
+       }
+       test_fail
+       return
+}