From: Nick Porter Date: Mon, 28 Apr 2025 14:23:00 +0000 (+0100) Subject: Add test to proxy detached subrequest X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c9503cbdde6d856200c27c953d677e92fc1f4e5;p=thirdparty%2Ffreeradius-server.git Add test to proxy detached subrequest and missing files from rlm_radius originate test --- diff --git a/src/tests/radclient/auth_originate.out b/src/tests/radclient/auth_originate.out new file mode 100644 index 00000000000..6208585ec44 --- /dev/null +++ b/src/tests/radclient/auth_originate.out @@ -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 index 00000000000..a49729ea236 --- /dev/null +++ b/src/tests/radclient/auth_originate.txt @@ -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 index 00000000000..1b3a2c80a28 --- /dev/null +++ b/src/tests/radclient/auth_proxy_detach.out @@ -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 index 00000000000..04be0eec743 --- /dev/null +++ b/src/tests/radclient/auth_proxy_detach.txt @@ -0,0 +1,5 @@ +# +# ARGV: -i 123 -c 1 -x -F +# +User-Name = "proxy_detach", +User-Password = "hello" diff --git a/src/tests/radclient/config/radiusd.conf b/src/tests/radclient/config/radiusd.conf index 1b276820cf2..8705b493925 100644 --- a/src/tests/radclient/config/radiusd.conf +++ b/src/tests/radclient/config/radiusd.conf @@ -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