Skip to content

Commit

Permalink
Check %dhcpv4.decode and encode with VSAs
Browse files Browse the repository at this point in the history
  • Loading branch information
ndptech committed Oct 3, 2024
1 parent 5d8a70a commit b9bcbfd
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/tests/keywords/xlat-dhcpv4
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b9bcbfd

Please sign in to comment.