Skip to content

Commit 4322ec4

Browse files
committed
Add a test case for opt82 humanization
Signed-off-by: Michael Haro <[email protected]>
1 parent 175cf2a commit 4322ec4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dhcpv4/option_relay_agent_information_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ func TestOptRelayAgentInfo(t *testing.T) {
3636
opt := OptRelayAgentInfo(
3737
OptGeneric(GenericOptionCode(1), []byte("linux")),
3838
OptGeneric(GenericOptionCode(2), []byte("boot")),
39+
OptGeneric(GenericOptionCode(LinkSelectionSubOption), []byte{192, 0, 2, 1}),
3940
)
4041
wantBytes := []byte{
4142
1, 5, 'l', 'i', 'n', 'u', 'x',
4243
2, 4, 'b', 'o', 'o', 't',
44+
5, 4, 192, 0, 2, 1,
4345
}
44-
wantString := "Relay Agent Information:\n\n Agent Circuit ID Sub-option: linux ([108 105 110 117 120])\n Agent Remote ID Sub-option: boot ([98 111 111 116])\n"
46+
wantString := "Relay Agent Information:\n\n Agent Circuit ID Sub-option: linux ([108 105 110 117 120])\n Agent Remote ID Sub-option: boot ([98 111 111 116])\n Link Selection Sub-option: 192.0.2.1\n"
4547
require.Equal(t, wantBytes, opt.Value.ToBytes())
4648
require.Equal(t, OptionRelayAgentInformation, opt.Code)
4749
require.Equal(t, wantString, opt.String())

0 commit comments

Comments
 (0)