From: Alan T. DeKok Date: Fri, 27 Dec 2024 13:27:25 +0000 (-0500) Subject: add test for %proxy.sendto.ipaddr(...) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=696db334c528fc62ef6642e30cc452c817cf5d8e;p=thirdparty%2Ffreeradius-server.git add test for %proxy.sendto.ipaddr(...) which checks that proxying is a success --- diff --git a/src/tests/radclient/auth_dynamic.out b/src/tests/radclient/auth_dynamic.out new file mode 100644 index 00000000000..d4b14640f94 --- /dev/null +++ b/src/tests/radclient/auth_dynamic.out @@ -0,0 +1,9 @@ +Sent Access-Request Id 123 from 0.0.0.0:1243 to 127.0.0.1:12351 length 45 + User-Name = "bob" + User-Password = "hello" + NAS-Identifier = "dynamic" + Password.Cleartext = "hello" +Received Access-Accept Id 123 from 127.0.0.1:12351 to 0.0.0.0:1243 via lo length 38 + Reply-Message = "Have Proxy-State" + NAS-Port = 2 +(0) src/tests/radclient/auth_dynamic.txt response code 2 diff --git a/src/tests/radclient/auth_dynamic.txt b/src/tests/radclient/auth_dynamic.txt new file mode 100644 index 00000000000..be46ba51110 --- /dev/null +++ b/src/tests/radclient/auth_dynamic.txt @@ -0,0 +1,6 @@ +# +# ARGV: -i 123 -c 1 -x -F +# +User-Name = "bob", +User-Password = "hello" +NAS-Identifier := "dynamic" diff --git a/src/tests/radclient/config/radiusd.conf b/src/tests/radclient/config/radiusd.conf index 8b41435bbdf..299b939229a 100644 --- a/src/tests/radclient/config/radiusd.conf +++ b/src/tests/radclient/config/radiusd.conf @@ -81,6 +81,19 @@ modules { } } + + radius proxy { + mode = dynamic-proxy + + type = Access-Request + type = Accounting-Request + + transport = udp + udp { + src_ipaddr = 127.0.0.1 + secret = testing123 + } + } } # @@ -155,6 +168,11 @@ server test { return } + if ((&NAS-Identifier == "dynamic") && !&Proxy-State) { + &control.Auth-Type := ::dynamic-proxy + return + } + if (&User-Name == "bob") { accept } else { @@ -167,6 +185,11 @@ server test { radius } + authenticate dynamic-proxy { + &reply.NAS-Port := %proxy.sendto.ipaddr(127.0.0.1, $ENV{TEST_PORT}, 'testing123') + ok + } + send Access-Accept { if (&Proxy-State) { &reply.Reply-Message := "Have Proxy-State"