]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add accounting, and do minor cleanups
authorAlan T. DeKok <aland@freeradius.org>
Thu, 6 Apr 2023 17:03:36 +0000 (13:03 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 6 Apr 2023 17:03:36 +0000 (13:03 -0400)
src/tests/tls/README.md
src/tests/tls/acct [new file with mode: 0644]
src/tests/tls/home/radiusd.conf
src/tests/tls/proxy/proxy.conf
src/tests/tls/proxy/radiusd.conf
src/tests/tls/radacct.sh [new file with mode: 0755]
src/tests/tls/radclient.sh
src/tests/tls/radiusd-home.sh
src/tests/tls/radiusd-proxy.sh

index e614c5905ba7d09f3b743a107913289be0e7fba9..e0cb6867ed85bd2edee708f386f32d4fc3962b21 100644 (file)
@@ -32,3 +32,9 @@ Send 500,000 packets:
 ./radclient.sh -c 500000
 ```
 
+You can also send accounting packets:
+
+```
+./radacct.sh
+```
+
diff --git a/src/tests/tls/acct b/src/tests/tls/acct
new file mode 100644 (file)
index 0000000..c246714
--- /dev/null
@@ -0,0 +1,7 @@
+User-Name = "bob"
+Acct-Session-Id := "0000"
+Acct-Status-Type = Start
+Called-Station-Id := "00:01:02:03"
+Calling-Station-Id := "04:05:06:07"
+Message-Authenticator = 0x00
+Framed-IP-Address = 127.0.0.1
index 46e66a85f4f82800235a120c2f4c8931b009aac7..d38c4f1e2cbf50504c242cf6359f616add61e557 100644 (file)
@@ -27,6 +27,8 @@ thread pool {
 #  Referenced by some modules for default thread pool configuration
 #
 modules {
+       
+$INCLUDE ${raddb}/mods-available/always
 }
 
 clients radsec {
@@ -60,10 +62,44 @@ listen {
        }
 }
 
+listen {
+       type = acct
+
+       ipaddr = 127.0.0.1
+       port = 2084
+       proto = tcp
+
+       clients = radsec
+
+       virtual_server = default
+
+       tls {
+               private_key_password = whatever
+               private_key_file = ${certdir}/server.pem
+               certificate_file = ${certdir}/server.pem
+               ca_file = ${cadir}/ca.pem
+               fragment_size = 8192
+               ca_path = ${cadir}
+               cipher_list = "DEFAULT"
+               tls_min_version = "1.3"
+               tls_max_version = "1.3"
+       }
+}
+
 server default {
        authorize {
                update control {
                        Auth-Type := accept
                }
        }
+
+       preacct {
+               update control {
+                       Response-Packet-Type := Accounting-Response
+               }
+       }
+
+       acct {
+               ok
+       }
 }
index 56b345340ec54c1b92534be415df4693ce86e623..bb8ec1ea7224522ba874d46a7bad82c9ae31d5fc 100644 (file)
@@ -27,3 +27,33 @@ home_server_pool home {
        type = fail-over
        home_server = home
 }
+
+home_server home_acct {
+       ipaddr = 127.0.0.1
+       port = 2084
+       type = acct
+       secret = radsec
+       proto = tcp
+       status_check = none
+
+#      nonblock = yes
+
+       revive_interval = 10
+
+       tls {
+               private_key_password = whatever
+               private_key_file = ${certdir}/client.pem
+               certificate_file = ${certdir}/client.pem
+               ca_file = ${cadir}/ca.pem
+               fragment_size = 8192
+               ca_path = ${cadir}
+               cipher_list = "DEFAULT"
+               tls_min_version = "1.3"
+               tls_max_version = "1.3"
+       }
+}
+
+home_server_pool home_acct {
+       type = fail-over
+       home_server = home_acct
+}
index 605d531e551b21478b0d5d535f4eaf1cef1502a1..89a14bb59e0553d65dd8d04520c93cfa2841d380 100644 (file)
@@ -39,10 +39,25 @@ listen {
        virtual_server = default
 }
 
+listen {
+       type = acct
+       ipaddr = 127.0.0.1
+       port = 1813
+       proto = udp
+       virtual_server = default
+}
+
+
 server default {
        authorize {
                update control {
                        &Home-Server-Pool = "home"
                }
        }
+
+       preacct {
+               update control {
+                       &Home-Server-Pool = "home_acct"
+               }
+       }
 }
diff --git a/src/tests/tls/radacct.sh b/src/tests/tls/radacct.sh
new file mode 100755 (executable)
index 0000000..e00b482
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+. $(dirname $0)/common.sh
+
+#
+#  Run radclient acct
+#
+exec $DIR/build/make/jlibtool --mode=execute $FR_DEBUGGER $DIR/build/bin/local/radclient -d $(dirname $0)/home -D $DIR/share/ -f acct $@ localhost acct testing123
index 4b38168ba7e7787a9f171e8a3036af2ccd7f5e8c..49f83b25ae6ad938d24ff59af400c1ff94671185 100755 (executable)
@@ -1,14 +1,7 @@
 #!/bin/sh
+. $(dirname $0)/common.sh
 
 #
-#  Run the home server.
+#  Run radclient auth
 #
-
-DIR=$(dirname $0)/../../..
-PROGRAM=$(basename $0)
-
-export RADDB=$DIR/raddb
-export TEST_PATH=$(dirname $0)/
-export LIB_PATH=$DIR/build/lib/local/
-
 exec $DIR/build/make/jlibtool --mode=execute $FR_DEBUGGER $DIR/build/bin/local/radclient -d $(dirname $0)/home -D $DIR/share/ -f user_password $@ localhost auth testing123
index fb1f6780c05a268f56d191652b7b26e70332d557..ea2e694233b342e37f41b79b88e3a9004b22cf2f 100755 (executable)
@@ -1,14 +1,7 @@
 #!/bin/sh
+. $(dirname $0)/common.sh
 
 #
 #  Run the home server.
 #
-
-DIR=$(dirname $0)/../../..
-PROGRAM=$(basename $0)
-
-export RADDB=$DIR/raddb
-export TEST_PATH=$(dirname $0)/
-export LIB_PATH=$DIR/build/lib/local/
-
 exec $DIR/build/make/jlibtool --mode=execute $FR_DEBUGGER $DIR/build/bin/local/radiusd -d $(dirname $0)/home -D $DIR/share/ -fxx -l stdout $@
index 12e8d81bd4b1cfd13c2c3a8e6e558a0805c055b5..65f8066eea3a2404f4ca953216dbbb980abd6c2b 100755 (executable)
@@ -1,14 +1,7 @@
 #!/bin/sh
+. $(dirname $0)/common.sh
 
 #
-#  Run the home server.
+#  Run the proxy server.
 #
-
-DIR=$(dirname $0)/../../..
-PROGRAM=$(basename $0)
-
-export RADDB=$DIR/raddb
-export TEST_PATH=$(dirname $0)/
-export LIB_PATH=$DIR/build/lib/local/
-
 exec $DIR/build/make/jlibtool --mode=execute $FR_DEBUGGER $DIR/build/bin/local/radiusd -d $(dirname $0)/proxy -D $DIR/share/ -fxx -l stdout $@