]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Test cancellations within subrequests
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 5 Mar 2024 16:38:07 +0000 (10:38 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 5 Mar 2024 16:38:14 +0000 (10:38 -0600)
src/tests/keywords/subrequest-cancel [new file with mode: 0644]

diff --git a/src/tests/keywords/subrequest-cancel b/src/tests/keywords/subrequest-cancel
new file mode 100644 (file)
index 0000000..710cbf3
--- /dev/null
@@ -0,0 +1,21 @@
+# Cancel in subrequest
+subrequest Access-Request {
+       &parent.Tmp-String-0 := 'testing'
+
+       # Immediately cancel the subrequest
+       %cancel(0)
+
+       &parent.Tmp-String-1 := 'should not see me'
+
+       # We should've been cancelled here
+       test_fail
+}
+
+if (!(&Tmp-String-0 == 'testing')) {
+       test_fail
+}
+
+if (&Tmp-String-1 == 'should not see me') {
+       test_fail
+}
+success