From: Nick Porter Date: Fri, 12 Jan 2024 12:23:34 +0000 (+0000) Subject: Remove Tmp- attributes from unit tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08d97e287af57fcc00652b15c7b28fd21712f378;p=thirdparty%2Ffreeradius-server.git Remove Tmp- attributes from unit tests --- diff --git a/src/tests/unit/condition/base.txt b/src/tests/unit/condition/base.txt index 70aa7505e59..58192ae4d38 100644 --- a/src/tests/unit/condition/base.txt +++ b/src/tests/unit/condition/base.txt @@ -434,16 +434,16 @@ match (&Filter-Id == &Framed-IP-Address) condition (ipaddr)127.0.0.1 == &Filter-Id match (127.0.0.1 == &Filter-Id) -condition &Tmp-uint64-0 == &request.Foo-Stuff-Bar -match (&Tmp-uint64-0 == &request.Foo-Stuff-Bar) +condition &Acct-Input-Octets64 == &request.Foo-Stuff-Bar +match (&Acct-Input-Octets64 == &request.Foo-Stuff-Bar) -condition &Tmp-uint64-0 == &reply.Foo-Stuff-Bar -match (&Tmp-uint64-0 == &reply.Foo-Stuff-Bar) +condition &Acct-Input-Octets64 == &reply.Foo-Stuff-Bar +match (&Acct-Input-Octets64 == &reply.Foo-Stuff-Bar) # # Casting attributes of different size # -condition (ipaddr)&Tmp-uint64-0 == &Framed-IP-Address +condition (ipaddr)&Acct-Input-Octets64 == &Framed-IP-Address match ERROR offset 9: Cannot cast type 'uint64' to 'ipaddr' # @@ -455,8 +455,8 @@ condition (ipaddr)&PMIP6-Home-IPv4-HoA == &Framed-IP-Address match ((ipaddr)&PMIP6-Home-IPv4-HoA == &Framed-IP-Address) # but these are allowed -condition (ether)&Tmp-uint64-0 == "%interpreter('foo')" -match ((ether)&Tmp-uint64-0 == %cast(string, "%interpreter('foo')")) +condition (ether)&Acct-Input-Octets64 == "%interpreter('foo')" +match ((ether)&Acct-Input-Octets64 == %cast(string, "%interpreter('foo')")) condition (ipaddr)&Filter-Id == &Framed-IP-Address match ((ipaddr)&Filter-Id == &Framed-IP-Address) diff --git a/src/tests/unit/condition/groups.txt b/src/tests/unit/condition/groups.txt index 46181f5057e..1e878f74ebf 100644 --- a/src/tests/unit/condition/groups.txt +++ b/src/tests/unit/condition/groups.txt @@ -8,8 +8,8 @@ proto-dictionary dhcpv6 tmpl-rules allow_unresolved=no allow_unknown=no -condition &IA-NA.Options.Tmp-String-0 == 'foo' -match (&IA-NA.Options.Tmp-String-0 == 'foo') +condition &IA-NA.Options.Stripped-User-Name == 'foo' +match (&IA-NA.Options.Stripped-User-Name == 'foo') # Seen in the wild. Array subscript on child produced an error condition &IA-NA.Options.IA-Addr[0].IPv6-Address == :: diff --git a/src/tests/unit/condition/regex.ignore b/src/tests/unit/condition/regex.ignore index af669493026..e19df078b6f 100644 --- a/src/tests/unit/condition/regex.ignore +++ b/src/tests/unit/condition/regex.ignore @@ -62,16 +62,16 @@ match &User-Name =~ /^([^\\]*)\\(.*)$/ # # Non-integer types get cast to string. # -condition &Tmp-Integer-0 =~ /%{Tmp-Integer-0}/ -match &Tmp-Integer-0 =~ /%{Tmp-Integer-0}/ +condition &NAS-Port =~ /%{NAS-Port}/ +match &NAS-Port =~ /%{NAS-Port}/ # # Cannot add a bad cast # -condition &Tmp-String-0 =~ /foo/ +condition &Filter-Id =~ /foo/ match ERROR offset 10: Casts cannot be used with regular expressions -condition &Tmp-String-0 =~ /foo/ +condition &Filter-Id =~ /foo/ match ERROR offset 28: Casts cannot be used with regular expressions diff --git a/src/tests/unit/protocols/bfd/base.txt b/src/tests/unit/protocols/bfd/base.txt index 2e17177f49d..23ad47eeca3 100644 --- a/src/tests/unit/protocols/bfd/base.txt +++ b/src/tests/unit/protocols/bfd/base.txt @@ -21,11 +21,11 @@ match Packet-Type = Up, Packet = { version = 1, diagnostic = none, state = up, p # # The BFD packet is exactly the same, but we also have a 3 octet string "foo", which is encoded via the internal dictionary, after the packet. # -encode-proto Packet = { version = 1, diagnostic = none, state = up, poll = false, final = false, control-plane-independent = false, auth-present = false, demand = false, multipoint = false, detect-multi = 3, my-discriminator = 0xdeadbeef, your-discriminator = 0x21126809, desired-min-tx-interval = 31us, required-min-tx-interval = 127us, required-min-echo-interval = 255us }, Additional-Data = { Tmp-String-0 = "foo" } -match 20 c0 03 18 de ad be ef 21 12 68 09 00 00 00 1f 00 00 00 7f 00 00 00 ff 21 40 06 ae 03 66 6f 6f +encode-proto Packet = { version = 1, diagnostic = none, state = up, poll = false, final = false, control-plane-independent = false, auth-present = false, demand = false, multipoint = false, detect-multi = 3, my-discriminator = 0xdeadbeef, your-discriminator = 0x21126809, desired-min-tx-interval = 31us, required-min-tx-interval = 127us, required-min-echo-interval = 255us }, Additional-Data = { Stripped-User-Name = "foo" } +match 20 c0 03 18 de ad be ef 21 12 68 09 00 00 00 1f 00 00 00 7f 00 00 00 ff 21 40 03 e8 03 66 6f 6f decode-proto - -match Packet-Type = Up, Packet = { version = 1, diagnostic = none, state = up, poll = no, final = no, control-plane-independent = no, auth-present = no, demand = no, multipoint = no, detect-multi = 3, length = 24, my-discriminator = 3735928559, your-discriminator = 554854409, desired-min-tx-interval = 31, required-min-tx-interval = 127, required-min-echo-interval = 255 }, Additional-Data = { Tmp-String-0 = "foo" } +match Packet-Type = Up, Packet = { version = 1, diagnostic = none, state = up, poll = no, final = no, control-plane-independent = no, auth-present = no, demand = no, multipoint = no, detect-multi = 3, length = 24, my-discriminator = 3735928559, your-discriminator = 554854409, desired-min-tx-interval = 31, required-min-tx-interval = 127, required-min-echo-interval = 255 }, Additional-Data = { Stripped-User-Name = "foo" } count match 11 diff --git a/src/tests/unit/xlat/base.txt b/src/tests/unit/xlat/base.txt index 5d22b7585fb..2255a0b38d7 100644 --- a/src/tests/unit/xlat/base.txt +++ b/src/tests/unit/xlat/base.txt @@ -238,8 +238,8 @@ xlat_argv /bin/sh "foo bar" "%{User-Name} %{Filter-Id" match ERROR offset 44: Unexpected text after enum value. Expected operator # and text immediately after a variable expansion -xlat_argv echo hello %{Tmp-String-0}:1234 world -match [0]{ echo }, [1]{ hello }, [2]{ %{Tmp-String-0}:1234 }, [3]{ world } +xlat_argv echo hello %{Filter-Id}:1234 world +match [0]{ echo }, [1]{ hello }, [2]{ %{Filter-Id}:1234 }, [3]{ world } xlat %debug(5) match %debug(5) diff --git a/src/tests/unit/xlat/cond_base.txt b/src/tests/unit/xlat/cond_base.txt index 272087213cb..c7b3081dad0 100644 --- a/src/tests/unit/xlat/cond_base.txt +++ b/src/tests/unit/xlat/cond_base.txt @@ -441,16 +441,16 @@ match (&Filter-Id == &Framed-IP-Address) xlat_purify (ipaddr)127.0.0.1 == &Filter-Id match (127.0.0.1 == &Filter-Id) -xlat_purify &Tmp-uint64-0 == &request.Tmp-String-0 -match (&Tmp-uint64-0 == &request.Tmp-String-0) +xlat_purify &Acct-Input-Octets64 == &request.Callback-Id +match (&Acct-Input-Octets64 == &request.Callback-Id) -xlat_purify &Tmp-uint64-0 == &reply.Tmp-String-0 -match (&Tmp-uint64-0 == &reply.Tmp-String-0) +xlat_purify &Acct-Input-Octets64 == &reply.Callback-Id +match (&Acct-Input-Octets64 == &reply.Callback-Id) # # Casting attributes of different size # -xlat_purify (ipaddr)&Tmp-uint64-0 == &Framed-IP-Address +xlat_purify (ipaddr)&Acct-Input-Octets64 == &Framed-IP-Address match ERROR offset 9: Cannot cast type 'uint64' to 'ipaddr' # @@ -462,8 +462,8 @@ xlat_purify (ipaddr)&PMIP6-Home-IPv4-HoA == &Framed-IP-Address match ((ipaddr)&PMIP6-Home-IPv4-HoA == &Framed-IP-Address) # but these are allowed -xlat_purify (ether)&Tmp-uint64-0 == "%interpreter('foo')" -match ((ether)&Tmp-uint64-0 == %cast(string, "%interpreter('foo')")) +xlat_purify (ether)&Acct-Input-Octets64 == "%interpreter('foo')" +match ((ether)&Acct-Input-Octets64 == %cast(string, "%interpreter('foo')")) xlat_purify (ipaddr)&Filter-Id == &Framed-IP-Address match ((ipaddr)&Filter-Id == &Framed-IP-Address) @@ -498,8 +498,8 @@ xlat_purify &Acct-Input-Octets > &Session-Timeout match (&Acct-Input-Octets > &Session-Timeout) # Separate types aren't optimized -xlat_purify &Tmp-uint64-0 > &Session-Timeout -match (&Tmp-uint64-0 > &Session-Timeout) +xlat_purify &Acct-Input-Octets64 > &Session-Timeout +match (&Acct-Input-Octets64 > &Session-Timeout) # # Parse OIDs into known attributes, where possible. diff --git a/src/tests/unit/xlat/cond_regex.txt b/src/tests/unit/xlat/cond_regex.txt index 03d08dee8d4..64ca851a305 100644 --- a/src/tests/unit/xlat/cond_regex.txt +++ b/src/tests/unit/xlat/cond_regex.txt @@ -53,18 +53,18 @@ match (&User-Name =~ /@|\\/) xlat_purify &User-Name =~ /^([^\\]*)\\(.*)$/ match (&User-Name =~ /^([^\\]*)\\(.*)$/) -xlat_purify &Tmp-Integer-0 =~ /%{Tmp-Integer-1} foo/ -match (&Tmp-Integer-0 =~ /%{Tmp-Integer-1} foo/) +xlat_purify &NAS-Port =~ /%{Login-TCP-Port} foo/ +match (&NAS-Port =~ /%{Login-TCP-Port} foo/) # # If they're dumb enough to add a cast, then it will be just cast again # to "string" before the regular expression is evaluated. # -xlat_purify (integer)&Tmp-String-0 =~ /foo/ -match ((uint32)&Tmp-String-0 =~ /foo/) +xlat_purify (integer)&Filter-Id =~ /foo/ +match ((uint32)&Filter-Id =~ /foo/) -xlat_purify &Tmp-String-0 =~ /foo/ -match ERROR offset 18: Expected regular expression +xlat_purify &Filter-Id =~ /foo/ +match ERROR offset 15: Expected regular expression xlat_expr %{33} match ERROR offset 3: Invalid regex reference. Must be in range 0-32