Skip to content

Commit a8f7e00

Browse files
marc-casavantCopilot
andcommitted
WIP: updated automation of starting valgrind profiling when running prof-accept test
Co-authored-by: Copilot <copilot@github.com>
1 parent 4789e6c commit a8f7e00

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/tests/multi-server/all.mk

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,22 @@ freeradius-prof.image:
238238

239239
$(TEST_MULTI_SERVER_PROF_TESTS): freeradius-prof.image
240240

241+
#
242+
# Copy the valgrind profiling helper script into each prof test's output dir
243+
# so it is available alongside the rendered test configs.
244+
#
245+
PROFILING_SCRIPT_SRC := $(DIR)/scripts/profiling/start_valgrind_profiling.sh
246+
247+
define TEST_MULTI_SERVER_PROF_SCRIPT
248+
$(OUTPUT)/${1}/${2}/start_valgrind_profiling.sh: $(PROFILING_SCRIPT_SRC)
249+
$${Q}mkdir -p $$(@D)
250+
$${Q}cp $$< $$@
251+
252+
test.multi-server.${1}.${2}: $(OUTPUT)/${1}/${2}/start_valgrind_profiling.sh
253+
endef
254+
255+
$(foreach s,$(filter prof-%,$(TEST_MULTI_SERVER_SUITES)),$(foreach p,$(TEST_MULTI_SERVER_PARAM_FILES.$(s)),$(eval $(call TEST_MULTI_SERVER_PROF_SCRIPT,$(s),$(subst .,_,$(patsubst %.test.yml,%,$(notdir $(p))))))))
256+
241257
#
242258
# Ensure the ldap image is present before running prof-ldap tests.
243259
# Builds it automatically via docker.openldap.prof if not found.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ services:
2121
- ${DATA_PATH}/freeradius/profiling-server/proto_load_config.env:/etc/freeradius/proto_load_config.env
2222
- ${DATA_PATH}/freeradius/profiling-server/load-generator-packets/:/etc/freeradius/load-generator-packets/
2323
- ${DATA_PATH}/freeradius/profiling-server/stats/load-generator-stats.csv:/etc/freeradius/stats/load-generator-stats.csv
24+
# Profiling scripts
25+
- ${DATA_PATH}/start_valgrind_profiling.sh:/etc/freeradius/start_valgrind_profiling.sh
2426
# Profiling results directory
2527
- ${DATA_PATH}/prof-results/:/etc/prof-results/
2628
# Listener directory

src/tests/multi-server/tests/prof-accept/template.yml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ states:
4545
# --branch-sim=yes \
4646
# freeradius -f -l stdout -S resources.talloc_skip_cleanup=yes
4747

48+
source /etc/freeradius/start_valgrind_profiling.sh
49+
4850
detach: true
4951
verify:
5052
timeout: {{ test_verify_timeout }}

0 commit comments

Comments
 (0)