]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add test to proxy detached subrequest
authorNick Porter <nick@portercomputing.co.uk>
Mon, 28 Apr 2025 14:23:00 +0000 (15:23 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Mon, 28 Apr 2025 14:23:00 +0000 (15:23 +0100)
and missing files from rlm_radius originate test

src/tests/radclient/auth_originate.out [new file with mode: 0644]
src/tests/radclient/auth_originate.txt [new file with mode: 0644]
src/tests/radclient/auth_proxy_detach.out [new file with mode: 0644]
src/tests/radclient/auth_proxy_detach.txt [new file with mode: 0644]
src/tests/radclient/config/radiusd.conf

diff --git a/src/tests/radclient/auth_originate.out b/src/tests/radclient/auth_originate.out
new file mode 100644 (file)
index 0000000..6208585
--- /dev/null
@@ -0,0 +1,8 @@
+Sent Access-Request Id 123 from 0.0.0.0:1244 to 127.0.0.1:12351 length 72 
+        User-Name = "bob"
+        User-Password = "hello"
+        NAS-Identifier = "originate"
+        Password.Cleartext = "hello"
+Received Access-Accept Id 123 from 127.0.0.1:12360 to 0.0.0.0:1244 via lo length 63 
+        Reply-Message = "Successfully originated"
+(0) src/tests/radclient/auth_originate.txt response code 2
diff --git a/src/tests/radclient/auth_originate.txt b/src/tests/radclient/auth_originate.txt
new file mode 100644 (file)
index 0000000..a49729e
--- /dev/null
@@ -0,0 +1,6 @@
+#
+#      ARGV: -i 123 -c 1 -x -F
+#
+User-Name = "bob",
+User-Password = "hello"
+NAS-Identifier := "originate"
diff --git a/src/tests/radclient/auth_proxy_detach.out b/src/tests/radclient/auth_proxy_detach.out
new file mode 100644 (file)
index 0000000..1b3a2c8
--- /dev/null
@@ -0,0 +1,7 @@
+Sent Access-Request Id 123 from 0.0.0.0:1246 to 127.0.0.1:12351 length 45 
+        User-Name = "proxy_detach"
+        User-Password = "hello"
+        Password.Cleartext = "hello"
+Received Access-Accept Id 123 from 127.0.0.1:12351 to 0.0.0.0:1246 via lo length 64 
+        Reply-Message = "Detached subrequest sent"
+(0) src/tests/radclient/auth_proxy_detach.txt response code 2
diff --git a/src/tests/radclient/auth_proxy_detach.txt b/src/tests/radclient/auth_proxy_detach.txt
new file mode 100644 (file)
index 0000000..04be0ee
--- /dev/null
@@ -0,0 +1,5 @@
+#
+#      ARGV: -i 123 -c 1 -x -F
+#
+User-Name = "proxy_detach",
+User-Password = "hello"
index 1b276820cf21aa2136781303d21a3fcfa7b6c72e..8705b49392593c482fe76927dbc18d7810991d93 100644 (file)
@@ -179,6 +179,20 @@ server test {
                        return
                }
 
+               if (User-Name == "proxy_detach") {
+                       if (!NAS-Identifier) {
+                               subrequest ::Access-Request {
+                                       request += parent.request
+                                       NAS-Identifier := 'detached-client'
+                                       detach
+                                       radius
+                               }
+                               reply.Reply-Message := 'Detached subrequest sent'
+                       }
+                       accept
+                       return
+               }
+
                if ((NAS-Identifier == "dynamic") && !Proxy-State) {
                        control.Auth-Type := ::dynamic-proxy
                        return