]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Test the rlm_delay cancellation point works
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 21 Nov 2017 19:18:48 +0000 (19:18 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 21 Nov 2017 19:19:04 +0000 (19:19 +0000)
src/tests/keywords/parallel-cancellation [new file with mode: 0644]
src/tests/keywords/parallel-yield
src/tests/keywords/unit_test_module.conf

diff --git a/src/tests/keywords/parallel-cancellation b/src/tests/keywords/parallel-cancellation
new file mode 100644 (file)
index 0000000..a2218a8
--- /dev/null
@@ -0,0 +1,20 @@
+#
+#  PRE: parallel
+#
+
+group {
+       parallel {
+               delay_10s       # If the test appears to hang for 10 seconds it's broken
+               fail            # Should cancel the timer
+       }
+
+       actions {
+               fail = 1
+       }
+}
+
+if (!fail) {
+       test_fail
+}
+
+success
index 505ca82b1cad20e1c397703f11acf4819638978f..bac74286f92e5d633ee9b06b77d33ca876ccdf23 100644 (file)
@@ -4,7 +4,7 @@
 
 # Ensure if one module yields, the rest execute
 parallel {
-       delay
+       reschedule
        update request {
                Tmp-String-0 := 'foo'
        }
index 0fc985bf2a4a2bc4b42cff5ddad2c42f07d4577a..33a420ff09011f7a88d8b9c4c5a423c6fc5463cd 100644 (file)
@@ -20,10 +20,14 @@ modules {
 
        $INCLUDE ${raddb}/mods-enabled/expr
 
-       delay {
+       delay reschedule {
                force_reschedule = yes
        }
 
+       delay delay_10s {
+               delay = 10
+       }
+
        test {
 
        }