From: Alan T. DeKok Date: Mon, 23 Sep 2019 18:41:04 +0000 (-0400) Subject: tests for encode / decode of time_delta X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d5a49feb9f2a1f46ef7b496e42ef73187fcfd2a;p=thirdparty%2Ffreeradius-server.git tests for encode / decode of time_delta --- diff --git a/src/tests/unit/dictionary b/src/tests/unit/dictionary index 787571cf9ce..d7dd661240c 100644 --- a/src/tests/unit/dictionary +++ b/src/tests/unit/dictionary @@ -26,6 +26,8 @@ ATTRIBUTE Unit-Octets 253 octets ATTRIBUTE Unit-TLV 254 tlv ATTRIBUTE Unit-TLV-Milliseconds 254.1 date milliseconds +ATTRIBUTE Unit-TLV-Delta-MSec 254.2 time_delta milliseconds +ATTRIBUTE Unit-TLV-Delta-Sec 254.3 time_delta seconds # # Copied here for simplicity diff --git a/src/tests/unit/radius_unit.txt b/src/tests/unit/radius_unit.txt index 5bfad8f7713..18c4ee9f31c 100644 --- a/src/tests/unit/radius_unit.txt +++ b/src/tests/unit/radius_unit.txt @@ -65,3 +65,24 @@ data 37 06 00 0d 2f 00 # Can we parse RFC 3339 dates correctly? attribute Unit-TLV-Milliseconds = "2019-08-21T07:40:31.123-04:00" data Unit-TLV-Milliseconds = "2019-08-21T03:40:31.123Z" + +# +# Time delta in milliseconds. +# +attribute Unit-TLV-Delta-MSec = 5 +data Unit-TLV-Delta-MSec = 5 + +encode-pair - +data fe 08 02 06 00 00 00 05 + +decode-pair - +data Unit-TLV-Delta-MSec = 5 + +attribute Unit-TLV-Delta-Sec = 10 +data Unit-TLV-Delta-Sec = 10 + +encode-pair - +data fe 08 03 06 00 00 00 0a + +decode-pair - +data Unit-TLV-Delta-Sec = 10