Skip to content

Commit bcf05c2

Browse files
committed
multi-server: use fixed subnet and remove env-setup.sh
Set TEST_SUBNET via compose environment with a fixed 172.28.0.0/16 subnet (overridable via test_subnet param). Remove env-setup.sh which ran apt-get install on every container startup.
1 parent 040d1ed commit bcf05c2

File tree

3 files changed

+7
-46
lines changed

3 files changed

+7
-46
lines changed

.github/workflows/ci-multi-server-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
DOCKER_TLS_CERTDIR: ""
2525
# Bypass the squid proxy for internal registry access.
2626
NO_PROXY: "*.networkradius.com,127.0.0.1"
27+
# Fix the network pool so TEST_SUBNET is predictable.
28+
DOCKER_OPTS: "--default-address-pool base=172.16.0.0/12,size=24"
2729
# Mount the host's internal CA so dind trusts
2830
# docker.internal.networkradius.com for image pulls.
2931
#

src/tests/multi-server/environments/proxy-multihop.yml.j2

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ x-common-config: &id001
1212
- SYS_PTRACE
1313
environment:
1414
TEST_PROJECT_NAME: ${COMPOSE_PROJECT_NAME}
15+
TEST_SUBNET: {{ test_subnet | default('172.16.0.0/12') }}
1516
services:
1617
{% for i in range(1, (compose_num_of_home_servers + 1)) %}
1718
homeserver{{ i }}:
1819
image: freeradius-build:latest
1920
volumes:
2021
- ${DATA_PATH}/freeradius/homeserver/radiusd.conf:/etc/raddb/radiusd.conf
21-
- ${DATA_PATH}/freeradius/env-setup.sh:/tmp/env-setup.sh
2222
- ${LISTENER_DIR}/:/var/run/multi-server/
2323
restart: unless-stopped
2424
healthcheck:
@@ -27,17 +27,7 @@ services:
2727
timeout: 5s
2828
retries: 10
2929
start_period: 30s
30-
entrypoint:
31-
- bash
32-
- -lc
33-
- |
34-
set -euo pipefail
35-
36-
# Detect the Docker network subnet and export TEST_SUBNET.
37-
# FreeRADIUS client sections use $ENV{TEST_SUBNET} to allow
38-
# traffic from other containers on the compose network.
39-
source /tmp/env-setup.sh
40-
exec freeradius -f -l stdout
30+
command: ["freeradius", "-f", "-l", "stdout"]
4131
<<: *id001
4232
{% endfor %}
4333
{% for i in range(1, (compose_num_of_proxy_servers + 1)) %}
@@ -50,7 +40,6 @@ services:
5040
{% endfor %}
5141
volumes:
5242
- ${DATA_PATH}/freeradius/proxy/radiusd.conf:/etc/raddb/radiusd.conf
53-
- ${DATA_PATH}/freeradius/env-setup.sh:/tmp/env-setup.sh
5443
- ${LISTENER_DIR}/:/var/run/multi-server/
5544
restart: unless-stopped
5645
healthcheck:
@@ -59,17 +48,7 @@ services:
5948
timeout: 5s
6049
retries: 10
6150
start_period: 30s
62-
entrypoint:
63-
- bash
64-
- -lc
65-
- |
66-
set -euo pipefail
67-
68-
# Detect the Docker network subnet and export TEST_SUBNET.
69-
# FreeRADIUS client sections use $ENV{TEST_SUBNET} to allow
70-
# traffic from other containers on the compose network.
71-
source /tmp/env-setup.sh
72-
exec freeradius -f -l stdout
51+
command: ["freeradius", "-f", "-l", "stdout"]
7352
<<: *id001
7453
{% endfor %}
7554
load-generator:
@@ -90,17 +69,12 @@ services:
9069
# load-generator server config
9170
- ${DATA_PATH}/freeradius/load-generator/radiusd.conf:/etc/raddb/radiusd.conf
9271

93-
- ${DATA_PATH}/freeradius/env-setup.sh:/tmp/env-setup.sh
9472
- ${DATA_PATH}/freeradius/load-generator/load-generator-packets/:/etc/raddb/load-generator-packets/
9573
- ${LISTENER_DIR}/:/var/run/multi-server/
9674
entrypoint:
9775
- bash
9876
- -lc
9977
- |
100-
set -euo pipefail
101-
102-
source /tmp/env-setup.sh
103-
10478
# Keep the container alive. The test framework starts FreeRADIUS
10579
# and runs commands via 'docker exec' so it can control timing.
10680
sleep infinity

src/tests/multi-server/environments/proxy.yml.j2

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ x-common-config: &id001
1818
- SYS_PTRACE
1919
environment:
2020
TEST_PROJECT_NAME: ${COMPOSE_PROJECT_NAME}
21+
TEST_SUBNET: {{ test_subnet | default('172.16.0.0/12') }}
2122
services:
2223
{% for i in range(1, (compose_num_of_home_servers + 1)) %}
2324
homeserver{{ i }}:
2425
image: freeradius-build:latest
2526
volumes:
2627
- ${DATA_PATH}/freeradius/homeserver/radiusd.conf:/etc/raddb/radiusd.conf
27-
- ${DATA_PATH}/freeradius/env-setup.sh:/tmp/env-setup.sh
2828
- ${LISTENER_DIR}/:/var/run/multi-server/
2929
restart: unless-stopped
3030
healthcheck:
@@ -33,17 +33,7 @@ services:
3333
timeout: 5s
3434
retries: 10
3535
start_period: 30s
36-
entrypoint:
37-
- bash
38-
- -lc
39-
- |
40-
set -euo pipefail
41-
42-
# Detect the Docker network subnet and export TEST_SUBNET.
43-
# FreeRADIUS client sections use $ENV{TEST_SUBNET} to allow
44-
# traffic from other containers on the compose network.
45-
source /tmp/env-setup.sh
46-
exec freeradius -f -l stdout
36+
command: ["freeradius", "-f", "-l", "stdout"]
4737
<<: *id001
4838
{% endfor %}
4939
load-generator:
@@ -64,17 +54,12 @@ services:
6454
# load-generator server config
6555
- ${DATA_PATH}/freeradius/load-generator/radiusd.conf:/etc/raddb/radiusd.conf
6656

67-
- ${DATA_PATH}/freeradius/env-setup.sh:/tmp/env-setup.sh
6857
- ${DATA_PATH}/freeradius/load-generator/load-generator-packets/:/etc/raddb/load-generator-packets/
6958
- ${LISTENER_DIR}/:/var/run/multi-server/
7059
entrypoint:
7160
- bash
7261
- -lc
7362
- |
74-
set -euo pipefail
75-
76-
source /tmp/env-setup.sh
77-
7863
# Keep the container alive. The test framework starts FreeRADIUS
7964
# and runs commands via 'docker exec' so it can control timing.
8065
sleep infinity

0 commit comments

Comments
 (0)