From: Alan T. DeKok Date: Mon, 24 Oct 2022 19:43:35 +0000 (-0400) Subject: add "don't use new conditions" for LDAP tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7867e3754bcb6ed291366b6d9978dbfede84c68f;p=thirdparty%2Ffreeradius-server.git add "don't use new conditions" for LDAP tests so that when we "flip the switch" to always enable them, nothing should break --- diff --git a/src/tests/keywords/all.mk b/src/tests/keywords/all.mk index bca67649447..416da560347 100644 --- a/src/tests/keywords/all.mk +++ b/src/tests/keywords/all.mk @@ -45,6 +45,8 @@ test.keywords.help: TEST_KEYWORDS_HELP += test.keywords.${1} # ifeq "$(findstring ${1}, paircmp)" "" $(OUTPUT)/${1}: NEW_COND=-S parse_new_conditions=yes -S use_new_conditions=yes +else +$(OUTPUT)/${1}: NEW_COND=-S parse_new_conditions=no -S use_new_conditions=no endif endef diff --git a/src/tests/modules/all.mk b/src/tests/modules/all.mk index bd5ba01d5ec..eb9676ce25a 100644 --- a/src/tests/modules/all.mk +++ b/src/tests/modules/all.mk @@ -75,6 +75,11 @@ $(foreach x, $(FILES), $(eval $$(OUTPUT.$(TEST))/$x: $(patsubst %,$(BUILD_DIR)/l # $(foreach x, $(filter sql_%,$(FILES)), $(eval $$(OUTPUT.$(TEST))/$x: $(patsubst %,$(BUILD_DIR)/lib/rlm_sql.la,$(patsubst %/,%,$(firstword $(subst /, ,$(dir $x))))))) +# +# Migration support. Some of the tests don't run under the new +# conditions, so we don't run them under the new conditions. +# +$(foreach x, $(filter ldap%,$(FILES)), $(eval $$(OUTPUT.$(TEST))/$x: NEW_COND=-S parse_new_conditions=no -S use_new_conditions=no)) # # Files in the output dir depend on the unit tests @@ -96,11 +101,11 @@ $(OUTPUT)/%: $(DIR)/%.unlang $(TEST_BIN_DIR)/unit_test_module | build.raddb @echo "MODULE-TEST $(TEST)" ${Q}mkdir -p $(dir $@) ${Q}cp $(if $(wildcard $(basename $<).attrs),$(basename $<).attrs,src/tests/modules/default-input.attrs) $@.attrs - ${Q}if ! MODULE_TEST_DIR=$(dir $<) MODULE_TEST_UNLANG=$< TEST="$(TEST)" $(TEST_BIN)/unit_test_module -D share/dictionary -d src/tests/modules/ -i "$@.attrs" -f "$@.attrs" -r "$@" -xxx > "$@.log" 2>&1 || ! test -f "$@"; then \ + ${Q}if ! MODULE_TEST_DIR=$(dir $<) MODULE_TEST_UNLANG=$< TEST="$(TEST)" $(TEST_BIN)/unit_test_module $(NEW_COND) -D share/dictionary -d src/tests/modules/ -i "$@.attrs" -f "$@.attrs" -r "$@" -xxx > "$@.log" 2>&1 || ! test -f "$@"; then \ if ! grep ERROR $< 2>&1 > /dev/null; then \ cat "$@.log"; \ echo "# $@.log"; \ - echo "MODULE_TEST_DIR=$(dir $<) MODULE_TEST_UNLANG=$< $(TEST_BIN)/unit_test_module -D share/dictionary -d src/tests/modules/ -i \"$@.attrs\" -f \"$@.attrs\" -r \"$@\" -xx"; \ + echo "MODULE_TEST_DIR=$(dir $<) MODULE_TEST_UNLANG=$< $(TEST_BIN)/unit_test_module $(NEW_COND) -D share/dictionary -d src/tests/modules/ -i \"$@.attrs\" -f \"$@.attrs\" -r \"$@\" -xx"; \ exit 1; \ fi; \ FOUND=$$(grep -E 'Error : $<' $@.log | head -1 | sed 's/.*\[//;s/\].*//'); \