From: Alan T. DeKok Date: Thu, 7 May 2020 13:39:30 +0000 (-0400) Subject: tests which use radiusd / radmin / radclient depend on the binaries, too X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc9beee7e6310ff26f0b0169d5e6fb076e343952;p=thirdparty%2Ffreeradius-server.git tests which use radiusd / radmin / radclient depend on the binaries, too --- diff --git a/src/tests/digest/all.mk b/src/tests/digest/all.mk index 95a9f81092d..e13fd1e08d7 100644 --- a/src/tests/digest/all.mk +++ b/src/tests/digest/all.mk @@ -20,6 +20,7 @@ DIGEST_GDB_LOG := $(DIGEST_BUILD_DIR)/gdb.log # # Generic rules to start / stop the radius service. # +CLIENT := radclient include src/tests/radiusd.mk $(eval $(call RADIUSD_SERVICE,digest,$(OUTPUT))) diff --git a/src/tests/radclient/all.mk b/src/tests/radclient/all.mk index 46a7ec1095d..f58cbc24761 100644 --- a/src/tests/radclient/all.mk +++ b/src/tests/radclient/all.mk @@ -25,6 +25,7 @@ RADCLIENT_CLIENT_PORT = 1234 # # Generic rules to start / stop the radius service. # +CLIENT := radclient include src/tests/radiusd.mk $(eval $(call RADIUSD_SERVICE,tapioca,$(OUTPUT))) diff --git a/src/tests/radiusd.mk b/src/tests/radiusd.mk index 4fc8d8bb47e..7b245f1d031 100644 --- a/src/tests/radiusd.mk +++ b/src/tests/radiusd.mk @@ -75,4 +75,13 @@ ${2}/radiusd.pid: ${2} .PHONY: $(TEST).radiusd_start $(TEST).radiusd_start: ${2}/radiusd.pid + +# +# If this test framework needs radiusd to be started / stopped, then ensure that +# the output files depend on the radiusd binary. +# +ifneq "$(FILES.$(TEST))" "" +$(foreach x, $(FILES.$(TEST)), $(eval $(OUTPUT.$(TEST))/$x: $(TESTBINDIR)/radiusd $(TESTBINDIR)/$(CLIENT))) +endif + endef diff --git a/src/tests/radmin/all.mk b/src/tests/radmin/all.mk index f9813dbd70a..a3bbb2f4d9f 100644 --- a/src/tests/radmin/all.mk +++ b/src/tests/radmin/all.mk @@ -20,7 +20,6 @@ $(eval $(call TEST_BOOTSTRAP)) # # Config settings # -RADMIN_BIN := $(TESTBINDIR)/radmin RADMIN_RADIUS_LOG := $(OUTPUT)/radiusd.log RADMIN_GDB_LOG := $(OUTPUT)/gdb.log RADMIN_SOCKET_FILE := $(OUTPUT)/control-socket.sock @@ -29,6 +28,7 @@ RADMIN_CONFIG_PATH := $(DIR)/config # # Generic rules to start / stop the radius service. # +CLIENT := radmin include src/tests/radiusd.mk $(eval $(call RADIUSD_SERVICE,control-socket,$(OUTPUT))) @@ -52,26 +52,26 @@ $(OUTPUT)/depends.mk: $(addprefix $(DIR)/,$(FILES)) | $(OUTPUT) # # Run the radmin commands against the radiusd. # -$(OUTPUT)/%: $(DIR)/% ${BUILD_DIR}/bin/radmin | test.radmin.radiusd_kill test.radmin.radiusd_start +$(OUTPUT)/%: $(DIR)/% | test.radmin.radiusd_kill test.radmin.radiusd_start @echo "RADMIN-TEST $(notdir $@)" ${Q} [ -f $(dir $@)/radiusd.pid ] || exit 1 $(eval EXPECTED := $(patsubst %.txt,%.out,$<)) $(eval FOUND := $(patsubst %.txt,%.out,$@)) $(eval TARGET := $(patsubst %.txt,%,$(notdir $@))) - ${Q}if ! $(RADMIN_BIN) -q -f $(RADMIN_SOCKET_FILE) < $< > $(FOUND) 2>&1; then\ + ${Q}if ! $(TESTBIN)/radmin -q -f $(RADMIN_SOCKET_FILE) < $< > $(FOUND) 2>&1; then\ echo "--------------------------------------------------"; \ tail -n 20 "$(RADMIN_RADIUS_LOG)"; \ echo "Last entries in server log ($(RADMIN_RADIUS_LOG)):"; \ echo "--------------------------------------------------"; \ echo "RADIUSD: $(RADIUSD_RUN)"; \ - echo "RADMIN : $(RADMIN_BIN) -q -f $(RADMIN_SOCKET_FILE) < $< > $(FOUND)"; \ + echo "RADMIN : $(TESTBIN)/radmin -q -f $(RADMIN_SOCKET_FILE) < $< > $(FOUND)"; \ $(MAKE) --no-print-directory test.radmin.radiusd_kill; \ exit 1; \ fi; \ if ! cmp -s $(FOUND) $(EXPECTED); then \ echo "RADMIN FAILED $@"; \ echo "RADIUSD: $(RADIUSD_RUN)"; \ - echo "RADMIN : $(RADMIN_BIN) -q -f $(RADMIN_SOCKET_FILE) < $< > $(FOUND)"; \ + echo "RADMIN : $(TESTBIN)/radmin -q -f $(RADMIN_SOCKET_FILE) < $< > $(FOUND)"; \ echo "ERROR: File $(FOUND) is not the same as $(EXPECTED)"; \ echo "If you did some update on the radmin code, please be sure to update the unit tests."; \ echo "e.g: $(EXPECTED)"; \