summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/option_domain_search_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv4/option_domain_search_test.go')
-rw-r--r--dhcpv4/option_domain_search_test.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/dhcpv4/option_domain_search_test.go b/dhcpv4/option_domain_search_test.go
deleted file mode 100644
index 508797c..0000000
--- a/dhcpv4/option_domain_search_test.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package dhcpv4
-
-import (
- "testing"
-
- "github.com/insomniacslk/dhcp/rfc1035label"
- "github.com/stretchr/testify/require"
-)
-
-func TestGetDomainSearch(t *testing.T) {
- data := []byte{
- 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'c', 'o', 'm', 0,
- 6, 's', 'u', 'b', 'n', 'e', 't', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'o', 'r', 'g', 0,
- }
- m, _ := New(WithGeneric(OptionDNSDomainSearchList, data))
- labels := m.DomainSearch()
- require.NotNil(t, labels)
- require.Equal(t, 2, len(labels.Labels))
- require.Equal(t, data, labels.ToBytes())
- require.Equal(t, labels.Labels[0], "example.com")
- require.Equal(t, labels.Labels[1], "subnet.example.org")
-}
-
-func TestOptDomainSearchToBytes(t *testing.T) {
- expected := []byte{
- 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'c', 'o', 'm', 0,
- 6, 's', 'u', 'b', 'n', 'e', 't', 7, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 3, 'o', 'r', 'g', 0,
- }
- opt := OptDomainSearch(&rfc1035label.Labels{
- Labels: []string{
- "example.com",
- "subnet.example.org",
- },
- })
- require.Equal(t, opt.Value.ToBytes(), expected)
-}