]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add "don't use new conditions" for LDAP tests
authorAlan T. DeKok <aland@freeradius.org>
Mon, 24 Oct 2022 19:43:35 +0000 (15:43 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 24 Oct 2022 19:43:35 +0000 (15:43 -0400)
so that when we "flip the switch" to always enable them, nothing
should break

src/tests/keywords/all.mk
src/tests/modules/all.mk

index bca6764944785bf19e74d6cdbe3d3ea8bfd2d7c1..416da560347486a3495a405f51d3c6acca6f6e10 100644 (file)
@@ -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
index bd5ba01d5ec71770a197a1e20f722479f846a72f..eb9676ce25a7725acef7e10651821b09420bbae1 100644 (file)
@@ -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/\].*//'); \