]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Make the default radclient tests run with dynamic clients
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 13 May 2024 20:29:37 +0000 (14:29 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 13 May 2024 20:29:37 +0000 (14:29 -0600)
src/tests/radclient/config/radiusd.conf

index b1084a687a139b7fb1589ee75c8b03b6d12d2f7f..81d0cf506ad0a39f822b172e804c9c64acf2f2f7 100644 (file)
@@ -38,11 +38,6 @@ policy {
        $INCLUDE ${maindir}/policy.d/
 }
 
-client localhost {
-       ipaddr = 127.0.0.1
-       secret = testing123
-}
-
 modules {
        always reject {
                rcode = reject
@@ -97,13 +92,44 @@ server test {
        listen {
                type = Access-Request
                type = Accounting-Request
-               transport = udp
 
-               udp {
-                       ipaddr = 127.0.0.1
-                       port = ${test_port}
-               }
-       }
+                udp {
+                        ipaddr = *
+                        port = ${test_port}
+                        dynamic_clients = true
+                        networks {
+                                allow = 0.0.0.0/0
+                        }
+                }
+                transport = udp
+
+                #
+                #  Dynamic client section
+                #
+                limit {
+                        max_clients = 0
+                        max_connections = 0
+                        idle_timeout = 600.0
+                        nak_lifetime = 10.0
+                        cleanup_delay = 5.0
+                }
+        }
+
+        new client {
+                &control.FreeRADIUS-Client-IP-Address := 127.0.0.1
+                &control.FreeRADIUS-Client-Secret := 'testing123'
+                &control.FreeRADIUS-Client-Shortname := 'test-client'
+                &control.FreeRADIUS-Client-NAS-Type := 'test'
+               ok
+        }
+
+        add client {
+                ok
+        }
+
+        deny client {
+                ok
+        }
 
        recv Access-Request {
                #
@@ -125,7 +151,7 @@ server test {
 
                        accept
                        return
-               }               
+               }
 
                if (&User-Name == "bob") {
                        accept