Skip to content

Initial baseline load-generator -> 5 home server tests.#5723

Open
marc-casavant wants to merge 59 commits intoFreeRADIUS:masterfrom
marc-casavant:loadgen-5hs-tests
Open

Initial baseline load-generator -> 5 home server tests.#5723
marc-casavant wants to merge 59 commits intoFreeRADIUS:masterfrom
marc-casavant:loadgen-5hs-tests

Conversation

@marc-casavant
Copy link
Contributor

The following new files include all files required to run a short and longer (5 minutes) running tests running on a baseline load-generator -> 5 home server multi-server environment. Files include FreeRADIUS server related config files, a docker-compose environment and testcase configurations.

These new tests require the freeradius-multi-server repo to be available on the same system running the tests.

@@ -0,0 +1,224 @@
# -*- text -*-
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth removing everything you don't need from this file (and others). i.e. there isn't value in having all of the document and comments in the test framework.

Plus, if the comments are duplicated here, they can get out of sync with the main configuration files. so it's best to just simplify these examples.

The only comments in the configuration files here should be explanations as to why this particular configuration was chosen.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Would we want to keep empty sections in the config file as placeholders?

In ../homeserver/radiusd.conf for example, we do not need to configure "thread pool". We could however refer to the config section:

thread pool {

}

transport = step
step {

# - filename (required)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar here, delete the default comments. add a comment explaining why this configuration has the given value.


send Access-Request {
stats
ok
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the ok here in every section? It shouldn't be needed.

If the server authenticates the user, then everything should just work.

if (!Event-Timestamp) {
Event-Timestamp := %time.request() - %{Acct-Delay-Time || 0}
}
acct_unique
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is likely not needed. It's main use is when writing to SQL, and we're not doing that.

# # requests to the upstream RADIUS server(s).
#
# if (!Event-Timestamp) {
# Event-Timestamp := %time.request() - %{Acct-Delay-Time || 0}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is only needed for crappy NAS equipment. It's better to just do:

Event.Timestamp := %timerequest()

since the timestamp changes every second, and therefore can't be put into a static packet.

secret = testing123
require_message_authenticator = auto
imit_proxy_state = auto
limit {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the "limit" section is for TCP, and isn't needed for UDP packets. You can delete it.

ipaddr = $ENV{TEST_SUBNET}
secret = testing123
require_message_authenticator = auto
imit_proxy_state = auto
Copy link
Member

@alandekok alandekok Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*l*imit_proxy_state

escape_filenames = no
}

pool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a pool configuration for files? You might need to check the linelog source code.

If the default linelog module comments aren't clear, we can update them to explain this issue.

}
}

dictionary {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're not using this, just delete it.


send Access-Challenge {
attr_filter.access_challenge
handled
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can delete this line. It's only needed for esoteric corner cases where the server is creating a challenge/response thing itself via unlang

attr_filter.access_reject
eap
remove_reply_message_if_eap
delay_reject
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this. We don't need to delay rejects in the CI tests.

}

recv Accounting-Request {
acct_unique
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this, as per other comments

}

accounting Start {
-sql
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're not using SQL, so just delete all -sql things, and leave the sections empty.

escape_filenames = no
}

pool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the pool configuration is likely not needed.

free_delay = 10
}
}
Access-Request {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a large block of text which is copied multiple times.

perhaps create a directory common/, and then put the large common blocks there. the configurations can then do $INCLUDE common/foo.conf

I'm a big fan of "don't repeat yourself". If the same thing shows up 2-3 times, find a way to re-use a common block.

response_window = 15
zombie_period = 10
revive_interval = 3600
status_check {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the status check configs can likely go into a common block, too. Perhaps even more of the radius configuration block, too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use templates :)

$INCLUDE global.d/
}

migrate {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this section. It's long out of date.

https://github.com/marc-casavant/freeradius-server/tree/dev-docker-build-from-src
```bash
freeradius-server % docker build --no-cache -t freeradius-dev-ubuntu24 -f scripts/docker/dev/build/ubuntu24/Dockerfile .
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get the crossbuild images to work on MacOS. Either get arm versions of libkqueue, or submit a CI task for the libkqueue repo to build the .deb files from x86 and arm.

### Multi-server test run

```bash
DATA_PATH=$HOME/sandbox/freeradius-server/src/tests/multi-server/environments/configs make test-framework-custom-config-path -- -x -vvvv --compose $HOME/sandbox/freeradius-server/src/tests/multi-server/environments/docker-compose/env-loadgen-5hs.yml --test $HOME/sandbox/freeradius-server/src/tests/multi-server/test-5hs-autoaccept.yml --use-files --listener-dir $HOME/freeradius-listener-logs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be integrated into the FreeRADIUS make framework. Add an all.mk that adds a tests.multi target, with correct prereqs to build the docker images using crossbuild.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get Ethan to publish the multi-server test packages to PyPi.

Copy link
Member

@arr2036 arr2036 Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any use of $HOME should be substituted for paths in build/tests/multi.


freeradius-multi-server % source .venv/bin/activate

(.venv) freeradius-multi-server % TEST_LOGGER_CONFIG=linelog_file DATA_PATH=$HOME/sandbox/freeradius-server/src/tests/multi-server/environments/configs LISTENER_DIR=$HOME/freeradius-listener-logs docker compose -p custom_test-env-loadgen-5hs -f $HOME/sandbox/freeradius-server/src/tests/multi-server/environments/docker-compose/env-loadgen-5hs.yml up
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This be should be created automatically in build/tests/multi so we can reinitialise the state easily.

certdir = ${confdir}/certs
cadir = ${confdir}/certs
run_dir = ${localstatedir}/run/${name}
db_dir = ${localstatedir}/lib/${name}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost all the paths can be removed


libdir = /usr/lib/freeradius

pidfile = ${run_dir}/${name}.pid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need a PID file

destination = null
colourise = no
timestamp = yes
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log debug {} specifically or from the request {} section ... up to log debug {}?

}

security {
user = freerad
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to set a user or group here, it can just run as root.


thread pool {

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty sections

type = Access-Request
type = Status-Server
transport = udp
require_message_authenticator = auto
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rs which are defaults


rm -f /etc/raddb/sites-enabled/default
ln -sf /etc/raddb/sites-available/hs-auto-accept /etc/raddb/sites-enabled/hs-auto-accept
ln -sf /etc/raddb/mods-available/linelog_test_framework /etc/raddb/mods-enabled/linelog_test_framework
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can all be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the soft link to enable the radius module since it is not needed. However, the soft link to enable the linelog_test_framework config is required since it is a custom linelog configuration pulled in from the test framework.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general all these homeserver entries should be removed except one, and that should be added into the middle of a Jinja loop. This lets you parameterise the environment too, so it's N backends instead of 5.

…logs. Also using env variables to make it easy to change the OS used for the docker build.
…o steps to help debug missing [Passed] and [Failed] expected labels.
…line with the compose file name used for a test.
…t easier to know where they are used during Jinja template rendering.
…runners and self-hosted runners. Turning off self-hosted option for sanity check.
…ackages are now pre-installed on the runner.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants