]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove require_enum_prefixi=yes from config in tests
authorAlan T. DeKok <aland@freeradius.org>
Fri, 31 Jan 2025 15:08:52 +0000 (10:08 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 31 Jan 2025 15:08:52 +0000 (10:08 -0500)
now that it's the default, we don't need to set it in the configs

src/lib/server/main_config.c
src/tests/keywords/all.mk
src/tests/modules/all.mk
src/tests/modules/unit_test_module.conf
src/tests/unit/all.mk

index b7e5b9ab7f58dee11a989467093f82f1c5a40a37..f12ca9780f88242d4b839ccebe00889ad48cf59a 100644 (file)
@@ -192,7 +192,7 @@ extern bool tmpl_require_enum_prefix;
 static const conf_parser_t migrate_config[] = {
        { FR_CONF_OFFSET_FLAGS("rewrite_update", CONF_FLAG_HIDDEN, main_config_t, rewrite_update) },
        { FR_CONF_OFFSET_FLAGS("forbid_update", CONF_FLAG_HIDDEN, main_config_t, forbid_update) },
-       { FR_CONF_OFFSET_FLAGS("require_enum_prefix", CONF_FLAG_HIDDEN, main_config_t, require_enum_prefix), .dflt = "no" },
+       { FR_CONF_OFFSET_FLAGS("require_enum_prefix", CONF_FLAG_HIDDEN, main_config_t, require_enum_prefix), .dflt = "yes" },
 
        CONF_PARSER_TERMINATOR
 };
index 74deb1baa28076d29740d437ac5b7f2046d38cdb..8decd268ce1ed77508f58195b6ac2d64b902d8e9 100644 (file)
@@ -151,10 +151,8 @@ KEYWORD_LIBS       := $(addsuffix .la,$(addprefix rlm_,$(KEYWORD_MODULES))) rlm_csv.la
 #
 #      (make -k test.keywords 2>&1) | grep 'KEYWORD=' | sed 's/KEYWORD=//;s/ .*$//'
 #
-#  @todo - set "-S require_enum_prefix=yes" here, so that the flag is set _before_ we read the config files.
-#
 $(OUTPUT)/%: $(DIR)/% $(TEST_BIN_DIR)/unit_test_module | $(KEYWORD_RADDB) $(KEYWORD_LIBS) build.raddb rlm_test.la rlm_csv.la rlm_unpack.la
-       $(eval CMD:=KEYWORD=$(notdir $@) $(TEST_BIN)/unit_test_module $(NEW_COND) $(UNIT_TEST_KEYWORD_ARGS.$(subst -,_,$(notdir $@))) -D share/dictionary -d src/tests/keywords/ -i "$@.attrs" -f "$@.attrs" -r "$@" -S require_enum_prefix=yes -xx )
+       $(eval CMD:=KEYWORD=$(notdir $@) $(TEST_BIN)/unit_test_module $(NEW_COND) $(UNIT_TEST_KEYWORD_ARGS.$(subst -,_,$(notdir $@))) -D share/dictionary -d src/tests/keywords/ -i "$@.attrs" -f "$@.attrs" -r "$@" -xx )
        @echo "KEYWORD-TEST $(notdir $@)"
        ${Q}if ! $(CMD) > "$@.log" 2>&1 || ! test -f "$@"; then \
                if ! grep ERROR $< 2>&1 > /dev/null; then \
@@ -182,7 +180,3 @@ $(TEST):
 
 $(TEST).help:
        @echo make $(TEST_KEYWORDS_HELP)
-
-.phony: test.keywords.tmpl_require_enum_prefix
-test.keywords.tmpl_require_enum_prefix: $(addprefix src/tests/keywords/,$(FILES))
-       @perl -p -i -e 's/&([0-9a-zA-Z])/$$1/g' $^
index f50aaa954763f5db56515f0578d17d7afdb7431b..5c11ce639ace4453937fe41ae95b53c8057b48e9 100644 (file)
@@ -103,7 +103,7 @@ $(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 -S require_enum_prefix=yes > "$@.log" 2>&1 || ! test -f "$@"; then \
+       ${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 \
                if ! grep ERROR $< 2>&1 > /dev/null; then \
                        if grep 'LeakSanitizer has encountered a fatal error' $@.log 2>&1 > /dev/null; then \
                                echo "MODULE-TEST $(TEST) - ignoring LeakSanitizer fatal error."; \
@@ -111,7 +111,7 @@ $(OUTPUT)/%: $(DIR)/%.unlang $(TEST_BIN_DIR)/unit_test_module | build.raddb
                        fi; \
                        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 \"$@\" -S require_enum_prefix=yes -xx"; \
+                       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"; \
                        exit 1; \
                fi; \
                FOUND=$$(grep -E 'Error : $<' $@.log | head -1 | sed 's/.*\[//;s/\].*//'); \
index b2cd22dcbffd58d429e40dc15e233d41096241d4..a77e87bb72594b237ed38b5ce28738a8af67fd84 100644 (file)
@@ -12,13 +12,6 @@ security {
        allow_vulnerable_openssl = yes
 }
 
-#
-#  Migration flags
-#
-migrate {
-       require_enum_prefix = yes
-}
-
 delete_from_radacct = "DELETE FROM radacct WHERE AcctSessionId ="
 delete_from_radcheck = "DELETE FROM radcheck WHERE username ="
 delete_from_radreply = "DELETE FROM radreply WHERE username ="
index dc5d5a538f7712d6eb6272f09f0ee1f7c10f59b5..f0d24e0dd384534838c92bd1bbbc264e660e5f0f 100644 (file)
@@ -44,8 +44,6 @@ $(FILES.$(TEST)): export TZ = GMT
 #
 PROTOCOLS := $(subst $(DIR)/protocols/,,$(wildcard $(DIR)/protocols/*))
 define UNIT_TEST_PROTOCOLS
-$(addprefix $(OUTPUT)/,$(filter protocols/${1}/%.txt,$(FILES))): REQUIRE_ENUM_PREFIX=-S require_enum_prefix=yes
-
 $(addprefix $(OUTPUT)/,$(filter protocols/${1}/%.txt,$(FILES))): $(wildcard $(top_srcdir)/share/dictionary/${1}/dictionary*) $(BUILD_DIR)/lib/local/libfreeradius-${1}.la $(BUILD_DIR)/lib/libfreeradius-${1}.la
 
 ifeq "${1}" "eap"
@@ -82,17 +80,16 @@ $(BUILD_DIR)/tests/unit/xlat/purify.txt $(filter $(BUILD_DIR)/tests/unit/xlat/co
 #  with the "actual" output.  But only for the "match" command.  Everything is including comments and blank
 #  lines is copied verbatim.
 #
-REQUIRE_ENUM_PREFIX=-S require_enum_prefix=yes
-
 #REWRITE_FLAGS = -w $(BUILD_DIR)/tmp
+
 #
 #  And the actual script to run each test.
 #
 $(OUTPUT)/%: $(DIR)/% $(TEST_BIN_DIR)/unit_test_attribute
        $(eval DIR:=${top_srcdir}/src/tests/unit)
        @echo "UNIT-TEST $(lastword $(subst /, ,$(dir $@))) $(basename $(notdir $@))"
-       ${Q}if ! $(TEST_BIN)/unit_test_attribute $(PURIFY) $(REWRITE_FLAGS) -F ./src/tests/fuzzer-corpus -D ./share/dictionary -d $(DIR) -r "$@" $(REQUIRE_ENUM_PREFIX) $<; then \
-               echo "TZ=GMT $(TEST_BIN)/unit_test_attribute $(PURIFY) -F ./src/tests/fuzzer-corpus -D ./share/dictionary -d $(DIR) -r \"$@\" $(REQUIRE_ENUM_PREFIX) $<"; \
+       ${Q}if ! $(TEST_BIN)/unit_test_attribute $(PURIFY) $(REWRITE_FLAGS) -F ./src/tests/fuzzer-corpus -D ./share/dictionary -d $(DIR) -r "$@" $<; then \
+               echo "TZ=GMT $(TEST_BIN)/unit_test_attribute $(PURIFY) -F ./src/tests/fuzzer-corpus -D ./share/dictionary -d $(DIR) -r \"$@\" $<"; \
                rm -f $(BUILD_DIR)/tests/test.unit; \
                exit 1; \
        fi