]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Check %dhcpv4.decode and encode with VSAs
authorNick Porter <nick@portercomputing.co.uk>
Thu, 3 Oct 2024 13:50:53 +0000 (14:50 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 3 Oct 2024 13:51:34 +0000 (14:51 +0100)
src/tests/keywords/xlat-dhcpv4

index 69a21a60e104b30076124b69a439e101095be2a5..31e5c128364a0202fc338f901f51b8fbfa5ae095 100644 (file)
@@ -27,4 +27,27 @@ if !(test_octets == 0x520d0103abcdef0206010203040506) {
        test_fail
 }
 
+#
+#  Check decoding and encoding of VSAs
+#
+test_octets := 0x7d1900002458140101010204c0a80101050968656c6c6f2e62696e
+if !(%dhcpv4.decode(%{test_octets}) == 1) {
+       test_fail
+}
+
+if (V-I-Vendor-Specific.CTS.Firmware-File-Name != 'hello.bin') {
+       test_fail
+}
+
+test_octets := %dhcpv4.encode(V-I-Vendor-Specific)
+
+if (test_octets != 0x7d1900002458140101010204c0a80101050968656c6c6f2e62696e) {
+       test_fail
+}
+
+test_octets := %dhcpv4.encode(V-I-Vendor-Specific.CTS.[*])
+if (test_octets != 0x7d1900002458140101010204c0a80101050968656c6c6f2e62696e) {
+       test_fail
+}
+
 success