diff options
author | Christopher Koch <c@chrisko.ch> | 2019-01-15 21:11:07 +0000 |
---|---|---|
committer | Chris K <c@chrisko.ch> | 2019-01-19 14:44:00 -0800 |
commit | 0b587bcfd1b0e8808e57d77fb4028adbd54bfd25 (patch) | |
tree | b9431e29f54157978762db67d36c1b19a7f3b3ef /dhcpv4/option_server_identifier_test.go | |
parent | feb8958aff848a6d7363fea2e29a2ac071685055 (diff) |
dhcpv4: consolidate all IP options into one file.
Diffstat (limited to 'dhcpv4/option_server_identifier_test.go')
-rw-r--r-- | dhcpv4/option_server_identifier_test.go | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/dhcpv4/option_server_identifier_test.go b/dhcpv4/option_server_identifier_test.go deleted file mode 100644 index e250ad7..0000000 --- a/dhcpv4/option_server_identifier_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package dhcpv4 - -import ( - "net" - "testing" - - "github.com/stretchr/testify/require" -) - -func TestOptServerIdentifierInterfaceMethods(t *testing.T) { - ip := net.IP{192, 168, 0, 1} - o := OptServerIdentifier{ServerID: ip} - - require.Equal(t, OptionServerIdentifier, o.Code(), "Code") - - expectedBytes := []byte{192, 168, 0, 1} - require.Equal(t, expectedBytes, o.ToBytes(), "ToBytes") - - require.Equal(t, "Server Identifier -> 192.168.0.1", o.String(), "String") -} - -func TestParseOptServerIdentifier(t *testing.T) { - var ( - o *OptServerIdentifier - err error - ) - o, err = ParseOptServerIdentifier([]byte{}) - require.Error(t, err, "empty byte stream") - - o, err = ParseOptServerIdentifier([]byte{192, 168, 0}) - require.Error(t, err, "wrong IP length") - - o, err = ParseOptServerIdentifier([]byte{192, 168, 0, 1}) - require.NoError(t, err) - require.Equal(t, net.IP{192, 168, 0, 1}, o.ServerID) -} |