]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
move more update tests to edit
authorAlan T. DeKok <aland@freeradius.org>
Mon, 23 Oct 2023 13:02:16 +0000 (09:02 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 23 Oct 2023 13:02:34 +0000 (09:02 -0400)
src/lib/unlang/compile.c
src/tests/keywords/all.mk
src/tests/keywords/update-group-error

index 0802e7b0534257df565c1a4a0e0a319659e17673..7f8ebcda6596767090b14511d4c16b759c19aadd 100644 (file)
@@ -1047,6 +1047,11 @@ static unlang_t *compile_update_to_edit(unlang_t *parent, unlang_compile_t *unla
                fr_token_t      op;
                char const      *attr, *value, *end;
 
+               if (cf_item_is_section(ci)) {
+                       cf_log_err(ci, "Cannot specify subsections for 'update'");
+                       return NULL;
+               }
+
                if (!cf_item_is_pair(ci)) continue;
 
                cp = cf_item_to_pair(ci);
index 080890dc85be8c611871de5f53ae1c376c21447a..771453c600dbbe9950c3e965b0c1bd1535d6b8ab 100644 (file)
@@ -57,18 +57,16 @@ endif
 #  All of the "update" tests which should also be run with "-S rewrite_update=yes"
 #
 #  update-attr-ref-null                &foo := &bar, where bar doesn't exist.  Now does nothing
-#  update-error-3              is now a run-time error instead of parse error
-#  update-group-error          error is on a different line
 #  update-null-value-assign    foo := "%{...}" should be an empty string
-#  update-remove-index         used to do???, now is parse-time error
+#  update-remove-index         Remove by index _and_ value.  Not implemented in edit code
 #  update-filter               lots of errors
 #
 
 #  Tests for the "update" keyword
-KEYWORD_UPDATE_TESTS := update-error-3 update-group-error update-null-value-assign update-remove-index update-filter vendor-specific-error
+KEYWORD_UPDATE_TESTS :=  update-null-value-assign update-remove-index update-filter vendor-specific-error
 
-# Tests for rewriting "udpate"
-KEYWORD_UPDATE_REWRITE_TESTS := update-all update-array update-delete update-remove-any update-group update-hex update-remove-value update-index update-list-error update-remove-list update-prepend unknown-update update-error update-error-2 update-exec-error update-list-null-rhs update-exec
+# Tests for rewriting "update"
+KEYWORD_UPDATE_REWRITE_TESTS := update-all update-array update-delete update-remove-any update-group update-hex update-remove-value update-index update-list-error update-remove-list update-prepend unknown-update update-error update-error-2 update-exec-error update-list-null-rhs update-exec update-error-3 update-group-error
 
 #
 #  Migration support.  Some of the tests don't run under the new
index 5ca4cc111606315b371b99e8fc2e1cb3063b4f6f..36d10bbc05581ebb047a163d7c2b5cb4cf9aa999 100644 (file)
@@ -2,14 +2,12 @@
 #  PRE: update
 #
 update reply {
-       &Tmp-String-0 := "foo"
+#      &Tmp-String-0 := "foo"
 
        #
        #  This is a string, so it's NOT allowed.
        #
-       #  @fixme - EDIT - the error is now on the first line
-       #
-       &Tmp-String-1 := {
-               Tmp-String-2 := "1.0" # ERROR
+       &Tmp-String-1 := { # ERROR
+               Tmp-String-2 := "1.0"
        }
 }