Skip to content

Commit 8a3744f

Browse files
committed
WIP: initial profiling test with files and pap modules
1 parent 7da8f5c commit 8a3744f

11 files changed

Lines changed: 284 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
pap {
3+
password_attribute = User-Password
4+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
User-Name = "testuser"
2+
User-Password = "testpass"
3+
Calling-Station-ID = "F1-F2-F3-F4-F5-F6"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
testuser Password.Cleartext := "testpass"
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name = profiling-server
2+
3+
raddbdir = /etc/freeradius
4+
confdir = ${raddbdir}
5+
modconfdir = ${confdir}/mods-config
6+
logdir = /var/log/freeradius
7+
radacctdir = ${logdir}/radacct
8+
9+
security {
10+
allow_core_dumps = yes
11+
}
12+
13+
modules {
14+
15+
# Common files module configuration
16+
{% include "freeradius/common/mods-available/files" %}
17+
18+
# Common pap module configuration
19+
{% include "freeradius/common/mods-available/pap" %}
20+
21+
# Common always module configuration, required for the control policy
22+
{% include "freeradius/common/mods-available/always" %}
23+
24+
}
25+
26+
policy {
27+
28+
# Common control policy configuration, needed for accept action
29+
{% include "freeradius/common/policy.d/control" %}
30+
31+
}
32+
33+
server profiling-server {
34+
35+
namespace = radius
36+
37+
listen load {
38+
handler = load
39+
type = Access-Request
40+
transport = step
41+
42+
step {
43+
44+
# Default packet config to use by proto_load module
45+
filename = ${confdir}/load-generator-packets/packet.conf
46+
47+
# Saving proto_load statistics disabled by default, can be enabled for debugging purposes.
48+
csv = ${confdir}/stats/load-generator-stats.csv
49+
50+
max_attributes = 64
51+
52+
#
53+
# The load profile is configured via environment variables set
54+
# in the testcase configuration files.
55+
#
56+
start_pps = $ENV{TEST_LOADGEN_START_PPS}
57+
max_pps = $ENV{TEST_LOADGEN_MAX_PPS}
58+
duration = $ENV{TEST_LOADGEN_DURATION}
59+
step = $ENV{TEST_LOADGEN_STEP}
60+
max_backlog = $ENV{TEST_LOADGEN_MAX_BACKLOG}
61+
parallel = $ENV{TEST_LOADGEN_PARALLEL}
62+
num_messages = $ENV{TEST_LOADGEN_NUM_MESSAGES}
63+
repeat = no
64+
}
65+
}
66+
67+
listen authentication {
68+
type = Access-Request
69+
transport = udp
70+
require_message_authenticator = auto
71+
limit_proxy_state = auto
72+
73+
limit {
74+
max_clients = 256
75+
max_connections = 256
76+
idle_timeout = 60.0
77+
dynamic_timeout = 600.0
78+
nak_lifetime = 30.0
79+
cleanup_delay = 5.0
80+
}
81+
82+
udp {
83+
ipaddr = *
84+
port = 1812
85+
networks {
86+
allow = 127/8
87+
allow = 192.0.2/24
88+
}
89+
}
90+
91+
tcp {
92+
ipaddr = *
93+
port = 1812
94+
networks {
95+
allow = 127/8
96+
allow = 192.0.2/24
97+
}
98+
}
99+
}
100+
101+
listen authentication {
102+
type = Access-Request
103+
transport = tcp
104+
105+
tcp {
106+
ipaddr = *
107+
port = 1812
108+
networks {
109+
allow = 127/8
110+
allow = 192.0.2/24
111+
}
112+
}
113+
}
114+
115+
client localhost {
116+
shortname = client-localhost
117+
ipaddr = *
118+
secret = testing123
119+
}
120+
121+
recv Access-Request {
122+
files
123+
# pap module always listed last
124+
pap
125+
}
126+
127+
authenticate pap {
128+
pap
129+
}
130+
131+
send Access-Accept {
132+
133+
}
134+
135+
send Access-Reject {
136+
137+
}
138+
139+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"time","last_packet","rtt","rttvar","pps","pps_accepted","sent","received","backlog","max_backlog","<usec","us","10us","100us","ms","10ms","100ms","s","blocked"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#
2+
# virtual server templates placeholder
3+
#
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# ---------------------------------------------------------------
2+
# Docker Compose Test Environment:
3+
#
4+
# A single server instance for profiling
5+
#
6+
# ---------------------------------------------------------------
7+
x-common-config: &id001
8+
cap_add:
9+
- NET_ADMIN
10+
- SYS_PTRACE
11+
environment:
12+
TEST_PROJECT_NAME: ${COMPOSE_PROJECT_NAME}
13+
TEST_SUBNET: {{ test_subnet | default('172.16.0.0/12') }}
14+
services:
15+
profiling-server:
16+
image: freeradius-prof:latest
17+
volumes:
18+
# profiling-server server config
19+
- ${DATA_PATH}/freeradius/profiling-server-pap-auth/radiusd.conf:/etc/freeradius/radiusd.conf
20+
# files module configuration
21+
- ${DATA_PATH}/freeradius/profiling-server-pap-auth/mods-config/files/authorize:/etc/freeradius/mods-config/files/authorize
22+
# proto_load packet configuration and statistics output
23+
- ${DATA_PATH}/freeradius/profiling-server-pap-auth/load-generator-packets/:/etc/freeradius/load-generator-packets/
24+
- ${DATA_PATH}/freeradius/profiling-server-pap-auth/stats/load-generator-stats.csv:/etc/freeradius/stats/load-generator-stats.csv
25+
# Profiling results directory
26+
- ${DATA_PATH}/prof-results/:/etc/prof-results/
27+
# Listener directory
28+
- ${LISTENER_DIR}/:/var/run/multi-server/
29+
entrypoint:
30+
- bash
31+
- -lc
32+
- |
33+
# Keep the container alive. The test framework starts FreeRADIUS
34+
# and runs commands via 'docker exec' so it can control timing.
35+
#
36+
# Start the server after configuring environment variables from test case's template.yml.j2 file.
37+
sleep infinity
38+
<<: *id001
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Topology - N/A for profiling test
2+
3+
# Routing - N/A for profiling test
4+
5+
# Load generator configuration
6+
loadgen:
7+
start_pps: 500
8+
max_pps: 500
9+
duration: 300
10+
step: 500
11+
parallel: 1
12+
max_backlog: 1000
13+
repeat: "no"
14+
15+
# Test framework
16+
test_timeout: 350
17+
test_verify_timeout: 340
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../environments/profiling-pap-auth.yml.j2
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Topology - N/A for profiling test
2+
3+
# Routing - N/A for profiling test
4+
5+
# Load generator configuration
6+
loadgen:
7+
start_pps: 500
8+
max_pps: 1000
9+
duration: 5
10+
step: 500
11+
parallel: 1
12+
max_backlog: 1000
13+
repeat: "no"
14+
15+
# Test framework
16+
test_timeout: 50
17+
test_verify_timeout: 40

0 commit comments

Comments
 (0)