From: Nick Porter Date: Thu, 18 Dec 2025 17:19:23 +0000 (+0000) Subject: Add test of !~ for rlm_files conditions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90f531414ea5982fb88bcc4431f5be09761ced3b;p=thirdparty%2Ffreeradius-server.git Add test of !~ for rlm_files conditions --- diff --git a/src/tests/modules/files/authorize b/src/tests/modules/files/authorize index 8ecc37a3f61..abc16eed6c9 100644 --- a/src/tests/modules/files/authorize +++ b/src/tests/modules/files/authorize @@ -115,6 +115,9 @@ addcontrol Reply-Message += "success2" regex NAS-Identifier =~ /der/, Password.Cleartext := "testing123" Reply-Message := "wonderful" +regex NAS-Identifier !~ /der/, NAS-Identifier !~ /foo/, Password.Cleartext := "testing123" + Reply-Message := "totally amazing" + vendor Password.Cleartext := "we_are_so_smart" Cisco.AVPair := "1", Cisco.AVPair += "2" diff --git a/src/tests/modules/files/regex-not.attrs b/src/tests/modules/files/regex-not.attrs new file mode 100644 index 00000000000..ffb20da1a3d --- /dev/null +++ b/src/tests/modules/files/regex-not.attrs @@ -0,0 +1,13 @@ +# +# Input packet +# +Packet-Type = Access-Request +User-Name = "regex" +User-Password = "testing123" +NAS-Identifier = "special" + +# +# Expected answer +# +Packet-Type == Access-Accept +Reply-Message == "totally amazing" diff --git a/src/tests/modules/files/regex-not.unlang b/src/tests/modules/files/regex-not.unlang new file mode 100644 index 00000000000..027271b9b22 --- /dev/null +++ b/src/tests/modules/files/regex-not.unlang @@ -0,0 +1 @@ +files