--- /dev/null
+# Performance test framework
+
+These tests should be run manually for now.
+
+In one terminal window, start up the `ack` virtual server. This
+server just "acks" every request it gets.
+
+```
+./run -n ack
+```
+
+In one terminal window, start up the `proxy` virtual server. This
+server just proxies every request it gets, to the `ack` server.
+
+```
+./run -n proxy
+```
+
+And then send the `proxy` server packets.
+
+## Less Debug Output
+
+For less debug output, use the `quiet` script. This will run the
+server in the foreground, and log to `stdout`:
+
+```
+./quiet -n ack
+```
+
+and
+
+```
+./quiet -n proxy
+```
+
+## Stress Testing
+
+Run the stress tests:
+
+```
+./stress
+```
+
+You will need `radperf` in your `$PATH`.
--- /dev/null
+#
+# We don't need to set anything here.
+#
+modules {
+ $INCLUDE mods-enabled/always
+}
+
+#
+# Does nothing other than proxying.
+#
+server default {
+ namespace = radius
+
+ listen {
+ type = Access-Request
+ type = Status-Server
+ transport = udp
+ udp {
+ ipaddr = 127.0.0.1
+ port = 3000
+ }
+ }
+ listen {
+ type = Accounting-Request
+ transport = udp
+ udp {
+ ipaddr = 127.0.0.1
+ port = 3001
+ }
+ }
+ listen {
+ type = CoA-Request
+ type = Disconnect-Request
+ transport = udp
+ udp {
+ ipaddr = 127.0.0.1
+ port = 3002
+ }
+ }
+
+ client localhost {
+ shortname = local
+ ipaddr = 127.0.0.1
+ secret = testing123
+ }
+ recv Access-Request {
+ update control {
+ &Auth-Type := Accept
+ }
+ }
+ send Access-Accept {
+ }
+ send Access-Reject {
+ }
+ recv Accounting-Request {
+ ok
+ }
+ send Accounting-Response {
+ }
+
+ recv CoA-Request {
+ ok
+ }
+ recv Disconnect-Request {
+ ok
+ }
+
+ recv Status-Server {
+ ok
+ }
+}
--- /dev/null
+../../../../raddb/mods-available/always
\ No newline at end of file
--- /dev/null
+radius radius_acct {
+ transport = udp
+ type = Accounting-Request
+
+ replicate = yes
+
+ status_check {
+ type = Status-Server
+
+ }
+
+ zombie_period = 2
+ revive_interval = 10
+
+ pool {
+ start = 1
+ min = 1
+ max = 8
+ connecting = 1
+ uses = 0
+
+ lifetime = 0
+ open_delay = 0.2
+ close_delay = 1.0
+ manage_interval = 0.2
+
+ connection {
+ connection_timeout = 1.0
+ reconnect_delay = 2
+ }
+
+ requests {
+ per_connection_max = 255
+ per_connection_target = 255
+ free_delay = 2
+ }
+ }
+
+ udp {
+ ipaddr = 127.0.0.1
+ port = 3001
+ secret = testing123
+ }
+
+ Accounting-Request {
+ initial_rtx_time = 2
+ max_rtx_time = 16
+ max_rtx_count = 5
+ max_rtx_duration = 30
+ }
+
+ Status-Server {
+ initial_rtx_time = 2
+ max_rtx_time = 5
+ max_rtx_count = 5
+ max_rtx_duration = 30
+ }
+}
--- /dev/null
+radius radius_auth {
+ transport = udp
+ type = Access-Request
+
+ status_check {
+ type = Status-Server
+ }
+
+ zombie_period = 2
+ revive_interval = 10
+
+ pool {
+ start = 1
+ min = 1
+ max = 8
+ connecting = 1
+ uses = 0
+ lifetime = 0
+
+ open_delay = 0.2
+ close_delay = 1.0
+ manage_interval = 0.2
+
+ connection {
+ connection_timeout = 1.0
+ }
+
+ requests {
+ per_connection_max = 255
+ per_connection_target = 255
+ free_delay = 2
+ }
+ }
+
+ udp {
+ ipaddr = 127.0.0.1
+ port = 3000
+ secret = testing123
+ }
+
+ Access-Request {
+ initial_rtx_time = 2
+ max_rtx_time = 16
+ max_rtx_count = 1
+ max_rtx_duration = 30
+ }
+
+ Status-Server {
+ initial_rtx_time = 2
+ max_rtx_time = 5
+ max_rtx_count = 5
+ max_rtx_duration = 30
+ }
+}
--- /dev/null
+
+radius radius_coa {
+ transport = udp
+
+ type = CoA-Request
+ type = Disconnect-Request
+
+ zombie_period = 2
+ revive_interval = 10
+
+ pool {
+ start = 1
+ min = 1
+ max = 8
+ connecting = 1
+ uses = 0
+
+ lifetime = 0
+ open_delay = 0.2
+ close_delay = 1.0
+ manage_interval = 0.2
+
+ connection {
+ connection_timeout = 1.0
+ reconnect_delay = 2
+ }
+
+ requests {
+ per_connection_max = 255
+ per_connection_target = 255
+ free_delay = 2
+ }
+ }
+
+ udp {
+ ipaddr = 127.0.0.1
+ port = 3002
+ secret = testing123
+ }
+
+
+ CoA-Request {
+ initial_rtx_time = 2
+ max_rtx_time = 16
+ max_rtx_count = 5
+ max_rtx_duration = 30
+ }
+
+ Disconnect-Request {
+ initial_rtx_time = 2
+ max_rtx_time = 16
+ max_rtx_count = 5
+ max_rtx_duration = 30
+ }
+
+}
--- /dev/null
+Acct-Status-Type = Start
+User-Name = "testuser"
+Acct-Session-ID = "0123456789"
+Service-Type = Framed-User
+NAS-IP-Address = 127.0.0.1
+NAS-Port-ID = 0
+Message-Authenticator = 0x
+Called-Station-Id = "scald_pega_pilha"
+Calling-Station-Id = "LulaLivre"
+NAS-Port = 123
--- /dev/null
+User-Name = "testuser"
+User-Password = "supersecret"
+Service-Type = Framed-User
+#Tunnel-Password = "supersecret"
+Called-Station-Id = "scald_pega_pilha"
+Class = 0x69616D616E6F706171756576616C756569616D616E6F706171756576616C7565
--- /dev/null
+User-Name = "testuser"
+Acct-Session-ID = "0123456789"
+Service-Type = Framed-User
+NAS-IP-Address = 127.0.0.1
+NAS-Port-ID = 0
+Message-Authenticator = 0x
\ No newline at end of file
--- /dev/null
+#
+# We don't need to set anything here.
+#
+modules {
+ $INCLUDE mods-enabled/
+}
+
+#
+# Does nothing other than proxying.
+#
+server default {
+ namespace = radius
+
+ listen {
+ type = Access-Request
+ type = Status-Server
+ transport = udp
+ udp {
+ ipaddr = 127.0.0.1
+ port = 1812
+ }
+ }
+ listen {
+ type = Accounting-Request
+ transport = udp
+ udp {
+ ipaddr = 127.0.0.1
+ port = 1813
+ }
+ }
+ listen {
+ type = CoA-Request
+ type = Disconnect-Request
+ transport = udp
+ udp {
+ ipaddr = 127.0.0.1
+ port = 3799
+ }
+ }
+
+ client localhost {
+ shortname = local
+ ipaddr = 127.0.0.1
+ secret = testing123
+ }
+
+ recv Access-Request {
+ update control {
+ &Auth-Type := proxy
+ }
+ }
+ authenticate proxy {
+ radius_auth
+ }
+ send Access-Accept {
+ }
+ send Access-Reject {
+ }
+
+ recv Accounting-Request {
+ if (!&Event-Timestamp) {
+ update request {
+ &Event-Timestamp := "%l"
+ }
+ }
+ radius_acct
+ }
+ send Accounting-Response {
+ }
+
+ recv CoA-Request {
+ radius_coa
+ }
+ recv Disconnect-Request {
+ radius_coa
+ }
+
+ recv Status-Server {
+ ok
+ }
+}
--- /dev/null
+#!/bin/sh
+export FR_GLOBAL_POOL=4M
+
+BUILD_DIR=../../../build
+
+exec ${BUILD_DIR}/make/jlibtool --mode=execute ${BUILD_DIR}/bin/local/radiusd -f -l stdout -d . -D ../../../share/dictionary $@
--- /dev/null
+#!/bin/sh
+export FR_GLOBAL_POOL=4M
+
+BUILD_DIR=../../../build
+
+exec ${BUILD_DIR}/make/jlibtool --mode=execute ${BUILD_DIR}/bin/local/radiusd -sf -xx -l stdout -d . -D ../../../share/dictionary $@
--- /dev/null
+#!/bin/bash
+# Author: Jorge Pereira <jpereira@freeradius.org>
+# Dummy script to flood the server
+#
+
+fr_server="${1:-127.0.0.1}"
+fr_secret="${2:-testing123}"
+n_packets=${3:-50000}
+forks=${forks:-3}
+
+#RADPERF_DIR=/Users/alandekok/git/radperf
+#radperf="${RADPERF_DIR}/radperf -d ${RADPERF_DIR}/share"
+
+#
+# Use this if you have "radperf" in your $PATH
+#
+radperf=radperf
+
+function _cleanup() {
+ echo "Cleanup"
+ killall -15 radperf radperf.bin 1> /dev/null 2>&1
+ kill -9 $$
+}
+
+trap _cleanup HUP INT QUIT KILL TERM
+
+echo "Flooding the server ${fr_server} with ${n_packets} of auth/acct/coa."
+
+inter=1
+rnd=1
+while true; do
+ echo "# >> Interaction $inter"
+ echo "[$inter] Start the flood of auth/acct/coa"
+ for t in $(seq 1 $forks); do
+ ${radperf} -q -s -f packets/packet-auth_pap.txt -p50 -c ${n_packets} ${fr_server}:1812 auth ${fr_secret} &
+ ${radperf} -q -s -f packets/packet-acct.txt -p50 -c ${n_packets} ${fr_server}:1813 acct ${fr_secret} &
+ ${radperf} -q -s -f packets/packet-coa.txt -p50 -c ${n_packets} ${fr_server}:3799 coa ${fr_secret} &
+ echo " > Fork $rnd";
+ let "rnd+=1"
+ done
+
+ echo "[*] Waiting"
+ wait
+
+ let "inter+=1"
+
+ [ -n "$once" ] && break
+done