From: Nick Porter Date: Thu, 3 Oct 2024 13:50:53 +0000 (+0100) Subject: Check %dhcpv4.decode and encode with VSAs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9bcbfd25d001dee32d2c1123f7ed3afb7f87ed1;p=thirdparty%2Ffreeradius-server.git Check %dhcpv4.decode and encode with VSAs --- diff --git a/src/tests/keywords/xlat-dhcpv4 b/src/tests/keywords/xlat-dhcpv4 index 69a21a60e10..31e5c128364 100644 --- a/src/tests/keywords/xlat-dhcpv4 +++ b/src/tests/keywords/xlat-dhcpv4 @@ -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