From: Alan T. DeKok Date: Fri, 31 Jan 2025 15:08:52 +0000 (-0500) Subject: remove require_enum_prefixi=yes from config in tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f865ba4da8e33f02cfb5c09a4bcacabcecd7789;p=thirdparty%2Ffreeradius-server.git remove require_enum_prefixi=yes from config in tests now that it's the default, we don't need to set it in the configs --- diff --git a/src/lib/server/main_config.c b/src/lib/server/main_config.c index b7e5b9ab7f5..f12ca9780f8 100644 --- a/src/lib/server/main_config.c +++ b/src/lib/server/main_config.c @@ -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 }; diff --git a/src/tests/keywords/all.mk b/src/tests/keywords/all.mk index 74deb1baa28..8decd268ce1 100644 --- a/src/tests/keywords/all.mk +++ b/src/tests/keywords/all.mk @@ -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' $^ diff --git a/src/tests/modules/all.mk b/src/tests/modules/all.mk index f50aaa95476..5c11ce639ac 100644 --- a/src/tests/modules/all.mk +++ b/src/tests/modules/all.mk @@ -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/\].*//'); \ diff --git a/src/tests/modules/unit_test_module.conf b/src/tests/modules/unit_test_module.conf index b2cd22dcbff..a77e87bb725 100644 --- a/src/tests/modules/unit_test_module.conf +++ b/src/tests/modules/unit_test_module.conf @@ -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 =" diff --git a/src/tests/unit/all.mk b/src/tests/unit/all.mk index dc5d5a538f7..f0d24e0dd38 100644 --- a/src/tests/unit/all.mk +++ b/src/tests/unit/all.mk @@ -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