From: Alan T. DeKok Date: Wed, 1 Feb 2023 02:56:08 +0000 (-0500) Subject: fix "success" policy to use new edit sections X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7583f9a8fc3e91597efad24f916bae9f49950d53;p=thirdparty%2Ffreeradius-server.git fix "success" policy to use new edit sections we don't need to do "if" checks for parent, we can just use the "=" operator, and let that fail-safe. We also revert the "subrequest" test to the previous version. The next step is to figure out why changing the xlat expansions broke the "success" policy. But we can check that tomorrow, once the CI tests pass again. --- diff --git a/src/tests/keywords/policy.conf b/src/tests/keywords/policy.conf index 38fda3baa35..06b075d7cc8 100644 --- a/src/tests/keywords/policy.conf +++ b/src/tests/keywords/policy.conf @@ -53,17 +53,8 @@ with.dots { # Set the test to successful, but only if there are no failures. # success { - if (!&reply.Result-Status) { - &reply += { - &Result-Status = "success" - } - } - - if (&parent.request && !&parent.reply.Result-Status) { - &parent.reply += { - &Result-Status = "success" - } - } + &parent.reply.Result-Status = "success" + &reply.Result-Status = "success" ok } diff --git a/src/tests/keywords/subrequest b/src/tests/keywords/subrequest index a764acc4813..83e2675dad2 100644 --- a/src/tests/keywords/subrequest +++ b/src/tests/keywords/subrequest @@ -1,5 +1,6 @@ subrequest Access-Request { &parent.control.User-Name := 'bob' + success } if (!&control.User-Name) { @@ -9,5 +10,3 @@ if (!&control.User-Name) { if (!(&control.User-Name == 'bob')) { test_fail } - -success