From: Alan T. DeKok Date: Thu, 7 Sep 2023 17:20:17 +0000 (-0400) Subject: tests for nested types X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7520feb2b482eba1c07fcad4cb5e0ab79f0f010d;p=thirdparty%2Ffreeradius-server.git tests for nested types --- diff --git a/src/tests/unit/protocols/radius/time_delta.txt b/src/tests/unit/protocols/radius/time_delta.txt index dcf3a843dbc..0186414cbd1 100644 --- a/src/tests/unit/protocols/radius/time_delta.txt +++ b/src/tests/unit/protocols/radius/time_delta.txt @@ -5,11 +5,13 @@ proto radius proto-dictionary radius fuzzer-out radius +migrate pair_legacy_nested = true + # # Time delta in milliseconds. # pair Unit-TLV.Delta-MSec = 5 -match Unit-TLV.Delta-MSec = 5 +match Unit-TLV = { Delta-MSec = 5 } encode-pair - match fe 08 02 06 00 00 00 05 @@ -18,7 +20,7 @@ decode-pair - match Unit-TLV = { Delta-MSec = 5 } pair Unit-TLV.Delta-Sec = 10 -match Unit-TLV.Delta-Sec = 10 +match Unit-TLV = { Delta-Sec = 10 } encode-pair - match fe 08 03 06 00 00 00 0a @@ -53,7 +55,7 @@ decode-pair - match Unit-TLV = { Delta-MSec-int32 = -32768 } pair Unit-TLV.Delta-MSec-int32 = -32768 -match Unit-TLV.Delta-MSec-int32 = -32768 +match Unit-TLV = { Delta-MSec-int32 = -32768 } encode-pair Unit-TLV.Delta-MSec-int16 = -32768 match fe 06 06 04 80 00 @@ -62,7 +64,7 @@ decode-pair - match Unit-TLV = { Delta-MSec-int16 = -32768 } pair Unit-TLV.Delta-MSec-int16 = -32768 -match Unit-TLV.Delta-MSec-int16 = -32768 +match Unit-TLV = { Delta-MSec-int16 = -32768 } # Regression test for broken signed promotion encode-pair Unit-TLV.Delta-MSec-int32 = -32768 @@ -72,7 +74,7 @@ decode-pair - match Unit-TLV = { Delta-MSec-int32 = -32768 } pair Unit-TLV.Delta-MSec-int32 = -32768 -match Unit-TLV.Delta-MSec-int32 = -32768 +match Unit-TLV = { Delta-MSec-int32 = -32768 } # # Min/Max values & overflows @@ -80,10 +82,10 @@ match Unit-TLV.Delta-MSec-int32 = -32768 # Internal format is int64_t pair Unit-TLV.Delta-MSec-uint16 = 9223372036853 -match Unit-TLV.Delta-MSec-uint16 = 9223372036853 +match Unit-TLV = { Delta-MSec-uint16 = 9223372036853 } pair Unit-TLV.Delta-MSec-uint32 = 9223372036853 -match Unit-TLV.Delta-MSec-uint32 = 9223372036853 +match Unit-TLV = { Delta-MSec-uint32 = 9223372036853 } # therefore, the encode should limit to the data type. encode-pair Unit-TLV.Delta-MSec-uint16 = 9223372036853 @@ -119,4 +121,4 @@ decode-pair - match Unit-TLV = { Delta-MSec-int32 = 2147483647 } count -match 65 +match 66 diff --git a/src/tests/unit/protocols/radius/unit.txt b/src/tests/unit/protocols/radius/unit.txt index 2fd92daaed8..ebdf2532827 100644 --- a/src/tests/unit/protocols/radius/unit.txt +++ b/src/tests/unit/protocols/radius/unit.txt @@ -3,6 +3,8 @@ proto radius proto-dictionary radius fuzzer-out radius +migrate pair_legacy_nested = true + # # And using the dictionaries # @@ -10,7 +12,7 @@ encode-pair Extended-Attribute-6.Extended-Vendor-Specific-6.FreeRADIUS.Unit-EVS- match f6 0d 1a 00 00 00 2c 50 01 00 00 00 01 f6 0d 1a 00 00 00 2c 50 01 00 00 00 02 pair Extended-Attribute-1.Unit-Ext-241-Integer = 6809 -match Extended-Attribute-1.Unit-Ext-241-Integer = 6809 +match Extended-Attribute-1 = { Unit-Ext-241-Integer = 6809 } encode-pair Extended-Attribute-1.Unit-Ext-241-Integer = 6809 match f1 07 f1 00 00 1a 99 @@ -75,7 +77,7 @@ match 37 06 00 0d 2f 00 # Can we parse RFC 3339 dates correctly? pair Unit-TLV.Milliseconds = "2019-08-21T07:40:31.123-04:00" -match Unit-TLV.Milliseconds = "2019-08-21T03:40:31.123Z" +match Unit-TLV = { Milliseconds = "2019-08-21T03:40:31.123Z" } count -match 35 +match 36