Skip to content

Commit

Permalink
update tests, too
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Sep 5, 2023
1 parent b5407c3 commit 8fef9f8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
14 changes: 7 additions & 7 deletions src/tests/unit/protocols/dhcpv4/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ encode-pair Relay-Agent-Information.Circuit-Id = 0xabcdef, Relay-Agent-Informati
match 52 0d 01 03 ab cd ef 02 06 01 02 03 04 05 06

decode-pair -
match Relay-Agent-Information.Circuit-Id = 0xabcdef, Relay-Agent-Information.Remote-Id = 0x010203040506
match Relay-Agent-Information = { Circuit-Id = 0xabcdef, Remote-Id = 0x010203040506 }

#
# And then again as nested pairs
Expand Down Expand Up @@ -42,7 +42,7 @@ match ANDSF-IPv6-Address = fe80::1, ANDSF-IPv6-Address = fe80::2, ANDSF-IPv6-Add
# A long one... with a weird specific vendor ID.
#
decode-pair 3501013d0701001ceaadac1e37070103060f2c2e2f3c094d5346545f495054565232011c4c41424f4c54322065746820312f312f30312f30312f31302f312f3209120000197f0d050b4c4142373336304f4c5432
match Message-Type = Discover, Client-Identifier = 0x01001ceaadac1e, Parameter-Request-List = Subnet-Mask, Parameter-Request-List = Router-Address, Parameter-Request-List = Domain-Name-Server, Parameter-Request-List = Domain-Name, Parameter-Request-List = NETBIOS-Name-Servers, Parameter-Request-List = NETBIOS-Node-Type, Parameter-Request-List = NETBIOS, Vendor-Class-Identifier = 0x4d5346545f49505456, Relay-Agent-Information.Circuit-Id = 0x4c41424f4c54322065746820312f312f30312f30312f31302f312f32, Relay-Agent-Information.Vendor-Specific-Information = 0x0000197f0d050b4c4142373336304f4c5432
match Message-Type = Discover, Client-Identifier = 0x01001ceaadac1e, Parameter-Request-List = Subnet-Mask, Parameter-Request-List = Router-Address, Parameter-Request-List = Domain-Name-Server, Parameter-Request-List = Domain-Name, Parameter-Request-List = NETBIOS-Name-Servers, Parameter-Request-List = NETBIOS-Node-Type, Parameter-Request-List = NETBIOS, Vendor-Class-Identifier = 0x4d5346545f49505456, Relay-Agent-Information = { Circuit-Id = 0x4c41424f4c54322065746820312f312f30312f30312f31302f312f32, Vendor-Specific-Information = 0x0000197f0d050b4c4142373336304f4c5432 }

#
# Two sub-options 82, that cannot fit in a single option.
Expand All @@ -57,7 +57,7 @@ match 52 ff 01 e1 6f 68 20 68 61 69 20 74 68 69 73 20 69 73 20 61 6e 20 61 67 65
# The fields are "octets", and therefore decode as hex.
#
decode-pair -
match Relay-Agent-Information.Circuit-Id = 0x6f6820686169207468697320697320616e206167656e742c20686f772061726520796f7520646f696e672044484350207365727665723f20746869732069732061207265616c6c79206c6f6e67206167656e7420636972637569742069642c2077686963682077696c6c206f6363757079206d6f7374206f6620746865206d6178696d756d2073697a6520666f7220616e206f7074696f6e20736f207468617420746865206e65787420737562206f7074696f6e2077696c6c206e6f742066697420616e642061206e6577206f7074696f6e2077696c6c206265206e6565646564, Relay-Agent-Information.Remote-Id = 0x747279696e6720746f20616464206120737562206f7074696f6e206167656e742072656d6f7465206964
match Relay-Agent-Information = { Circuit-Id = 0x6f6820686169207468697320697320616e206167656e742c20686f772061726520796f7520646f696e672044484350207365727665723f20746869732069732061207265616c6c79206c6f6e67206167656e7420636972637569742069642c2077686963682077696c6c206f6363757079206d6f7374206f6620746865206d6178696d756d2073697a6520666f7220616e206f7074696f6e20736f207468617420746865206e65787420737562206f7074696f6e2077696c6c206e6f742066697420616e642061206e6577206f7074696f6e2077696c6c206265206e6565646564, Remote-Id = 0x747279696e6720746f20616464206120737562206f7074696f6e206167656e742072656d6f7465206964 }

# An empty octets option
encode-pair Merit-Dump-File = ''
Expand Down Expand Up @@ -98,10 +98,10 @@ match Domain-Name = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# These next two tests will be broken until we start printing qualified attribute names
decode-pair 52 07 01 03 ab cd ef 03 00
match Relay-Agent-Information.Circuit-Id = 0xabcdef, raw.Relay-Agent-Information.3 = 0x
match Relay-Agent-Information = { Circuit-Id = 0xabcdef, raw.3 = 0x }

decode-pair 52 08 01 03 ab cd ef 03 01 ad
match Relay-Agent-Information.Circuit-Id = 0xabcdef, raw.Relay-Agent-Information.3 = 0xad
match Relay-Agent-Information = { Circuit-Id = 0xabcdef, raw.3 = 0xad }

#
# And option 82 with full suboptions
Expand All @@ -110,13 +110,13 @@ encode-pair Relay-Agent-Information.Circuit-Id = "123456789a123456789b123456789c
match 52 ff 01 fd 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 62 31 32 33 34 35 36 37 38 39 63 31 32 33 34 35 36 37 38 39 64 31 32 33 34 35 36 37 38 39 65 31 32 33 34 35 36 37 38 39 66 31 32 33 34 35 36 37 38 39 67 31 32 33 34 35 36 37 38 39 68 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 31 32 33 34 35 36 37 38 39 61 78 79 7a

decode-pair -
match Relay-Agent-Information.Circuit-Id = 0x3132333435363738396131323334353637383962313233343536373839633132333435363738396431323334353637383965313233343536373839663132333435363738396731323334353637383968313233343536373839613132333435363738396131323334353637383961313233343536373839613132333435363738396131323334353637383961313233343536373839613132333435363738396131323334353637383961313233343536373839613132333435363738396131323334353637383961313233343536373839613132333435363738396131323334353637383961313233343536373839613132333435363738396178797a
match Relay-Agent-Information = { Circuit-Id = 0x3132333435363738396131323334353637383962313233343536373839633132333435363738396431323334353637383965313233343536373839663132333435363738396731323334353637383968313233343536373839613132333435363738396131323334353637383961313233343536373839613132333435363738396131323334353637383961313233343536373839613132333435363738396131323334353637383961313233343536373839613132333435363738396131323334353637383961313233343536373839613132333435363738396131323334353637383961313233343536373839613132333435363738396178797a }

#
# from src/tests/keywords/xlat-dhcpv4
#
decode-pair 52 0d 01 03 ab cd ef 02 06 01 02 03 04 05 06
match Relay-Agent-Information.Circuit-Id = 0xabcdef, Relay-Agent-Information.Remote-Id = 0x010203040506
match Relay-Agent-Information = { Circuit-Id = 0xabcdef, Remote-Id = 0x010203040506 }

count
match 49
2 changes: 1 addition & 1 deletion src/tests/unit/protocols/dhcpv4/dhcp-auth.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ proto-dictionary dhcpv4
# options = [message-type=offer subnet_mask=255.255.255.0 server_id=172.22.178.234 lease_time=43200 router=10.10.8.254 name_server=143.209.4.1,143.209.5.1 tftp_server_name=b'172.22.178.234' 120=b'\x01\xac\x16\xb2\xea' client_id='\x00nathan1clientid' 90=b'\x01\x01\x00\xc8x\xc4RV@ \x811234\x8f\xe0\xcc\xe2\xee\x85\x96\xab\xb2X\x17\xc4\x80\xb2\xfd0' relay_agent_information=b'\x01\x14 PON 1/1/07/01:1.0.1' end]
#
decode-proto 02 01 06 01 77 71 cf 85 00 0a 00 00 00 00 00 00 0a 0a 08 eb ac 16 b2 ea 0a 0a 08 f0 00 0e 86 11 c0 75 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 35 01 02 01 04 ff ff ff 00 36 04 ac 16 b2 ea 33 04 00 00 a8 c0 03 04 0a 0a 08 fe 06 08 8f d1 04 01 8f d1 05 01 42 0e 31 37 32 2e 32 32 2e 31 37 38 2e 32 33 34 78 05 01 ac 16 b2 ea 3d 10 00 6e 61 74 68 61 6e 31 63 6c 69 65 6e 74 69 64 5a 1f 01 01 00 c8 78 c4 52 56 40 20 81 31 32 33 34 8f e0 cc e2 ee 85 96 ab b2 58 17 c4 80 b2 fd 30 52 16 01 14 20 50 4f 4e 20 31 2f 31 2f 30 37 2f 30 31 3a 31 2e 30 2e 31 ff
match Opcode = Server-Message, Hardware-Type = Ethernet, Hardware-Address-Length = 6, Hop-Count = 1, Transaction-Id = 2003947397, Number-of-Seconds = 10, Flags = 0, Client-IP-Address = 0.0.0.0, Your-IP-Address = 10.10.8.235, Server-IP-Address = 172.22.178.234, Gateway-IP-Address = 10.10.8.240, Client-Hardware-Address = 00:0e:86:11:c0:75, Message-Type = Offer, Subnet-Mask = 255.255.255.0, Server-Identifier = 172.22.178.234, IP-Address-Lease-Time = 43200, Router-Address = 10.10.8.254, Domain-Name-Server = 143.209.4.1, Domain-Name-Server = 143.209.5.1, TFTP-Server-Name = "172.22.178.234", raw.SIP-Servers-Option = 0x01ac16b2ea, Client-Identifier = 0x006e617468616e31636c69656e746964, Authentication = { protocol = delayed-authentication, algorithm = HMAC-SHA1-keyed-hash, RDM = 0, replay-detection = 14445511662704271489, raw.algorithm.HMAC-SHA1-keyed-hash = 0x313233348fe0cce2ee8596abb25817c480b2fd30 }, Relay-Agent-Information.Circuit-Id = 0x20504f4e20312f312f30372f30313a312e302e31, Network-Subnet = 10.10.8.240/32
match Opcode = Server-Message, Hardware-Type = Ethernet, Hardware-Address-Length = 6, Hop-Count = 1, Transaction-Id = 2003947397, Number-of-Seconds = 10, Flags = 0, Client-IP-Address = 0.0.0.0, Your-IP-Address = 10.10.8.235, Server-IP-Address = 172.22.178.234, Gateway-IP-Address = 10.10.8.240, Client-Hardware-Address = 00:0e:86:11:c0:75, Message-Type = Offer, Subnet-Mask = 255.255.255.0, Server-Identifier = 172.22.178.234, IP-Address-Lease-Time = 43200, Router-Address = 10.10.8.254, Domain-Name-Server = 143.209.4.1, Domain-Name-Server = 143.209.5.1, TFTP-Server-Name = "172.22.178.234", raw.SIP-Servers-Option = 0x01ac16b2ea, Client-Identifier = 0x006e617468616e31636c69656e746964, Authentication = { protocol = delayed-authentication, algorithm = HMAC-SHA1-keyed-hash, RDM = 0, replay-detection = 14445511662704271489, raw.algorithm.HMAC-SHA1-keyed-hash = 0x313233348fe0cce2ee8596abb25817c480b2fd30 }, Relay-Agent-Information = { Circuit-Id = 0x20504f4e20312f312f30372f30313a312e302e31 }, Network-Subnet = 10.10.8.240/32

count
match 4
Expand Down
2 changes: 1 addition & 1 deletion src/tests/unit/protocols/dhcpv4/rfc3495.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ encode-pair CCC = { Ticket-Granting-Server-Utilization = yes, Provisioning-Serve
match 7a 1a 07 01 01 03 15 00 0d 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 01 04 c0 a8 00 01

decode-pair -
match CCC.Ticket-Granting-Server-Utilization = yes, CCC.Provisioning-Server.FQDN = "example.com", CCC.Provisioning-Server.Address = 192.168.0.1
match CCC = { Ticket-Granting-Server-Utilization = yes, Provisioning-Server = { FQDN = "example.com", Address = 192.168.0.1 } }

count
match 7
3 changes: 2 additions & 1 deletion src/tests/unit/protocols/dhcpv4/rfc4776.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ encode-pair GeoConf-Civic = { what = 2, country_code = "US", elements = { A1 = "
match 63 2c 02 55 53 01 02 49 41 02 04 50 6f 6c 6b 03 0a 44 65 73 20 4d 6f 69 6e 65 73 22 09 49 6e 67 65 72 73 6f 6c 6c 12 06 41 76 65 6e 75 65

decode-pair -
match GeoConf-Civic = { what = 2, country_code = "US", elements.A1 = "IA", elements.A2 = "Polk", elements.A3 = "Des Moines", elements.Primary-Road-Name = "Ingersoll", elements.Street-Suffix-Or-Type = "Avenue" }
match GeoConf-Civic = { what = 2, country_code = "US", elements = { A1 = "IA", A2 = "Polk", A3 = "Des Moines", Primary-Road-Name = "Ingersoll", Street-Suffix-Or-Type = "Avenue" } }


count
match 7
2 changes: 1 addition & 1 deletion src/tests/unit/protocols/dhcpv4/rfc5678.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ encode-pair MoS-IPv4-FQDN = { MoS-IPv4-FQDN-IS = "mydomain1.com", MoS-IPv4-FQDN-
match 8c 33 01 31 09 6d 79 64 6f 6d 61 69 6e 31 03 63 6f 6d 00 09 6d 79 64 6f 6d 61 69 6e 32 03 6c 61 6e 00 04 63 6f 72 70 09 6d 79 64 6f 6d 61 69 6e 33 02 63 6f 00

decode-pair -
match MoS-IPv4-FQDN.MoS-IPv4-FQDN-IS = "mydomain1.com", MoS-IPv4-FQDN.MoS-IPv4-FQDN-IS = "mydomain2.lan", MoS-IPv4-FQDN.MoS-IPv4-FQDN-IS = "corp.mydomain3.co"
match MoS-IPv4-FQDN = { MoS-IPv4-FQDN-IS = "mydomain1.com", MoS-IPv4-FQDN-IS = "mydomain2.lan", MoS-IPv4-FQDN-IS = "corp.mydomain3.co" }

count
match 7
4 changes: 2 additions & 2 deletions src/tests/unit/protocols/dhcpv4/vendor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ encode-pair V-I-Vendor-Specific.Cisco.Indirect-Image-Filename = "aa.txt"
match 7d 0d 00 00 00 09 08 05 06 61 61 2e 74 78 74

decode-pair -
match V-I-Vendor-Specific.Cisco.Indirect-Image-Filename = "aa.txt"
match V-I-Vendor-Specific.Cisco = { Indirect-Image-Filename = "aa.txt" }

decode-pair 7d 1a 00 00 00 09 08 05 06 61 61 2e 74 78 74 00 00 00 09 08 05 06 62 62 2e 74 78 74
match V-I-Vendor-Specific.Cisco.Indirect-Image-Filename = "aa.txt", V-I-Vendor-Specific.Cisco.Indirect-Image-Filename = "bb.txt"
match V-I-Vendor-Specific.Cisco = { Indirect-Image-Filename = "aa.txt" }, V-I-Vendor-Specific.Cisco = { Indirect-Image-Filename = "bb.txt" }

encode-pair V-I-Vendor-Specific.Cisco.Indirect-Image-Filename = "aa.txt", V-I-Vendor-Specific.Cisco.Indirect-Image-Filename = "bb.txt"
match 7d 15 00 00 00 09 10 05 06 61 61 2e 74 78 74 05 06 62 62 2e 74 78 74
Expand Down

0 comments on commit 8fef9f8

Please sign in to comment.