summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/utils_test.go
blob: d72246621dc60ea3296e7f21cdef1eb18479bcf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package dhcpv4

import (
	"testing"

	"github.com/stretchr/testify/require"
)

func TestIsRequetsed(t *testing.T) {
	pkt, err := New()
	require.NoError(t, err)
	require.False(t, IsRequested(pkt, OptionDomainNameServer))

	optprl := OptParameterRequestList{RequestedOpts: []OptionCode{OptionDomainNameServer}}
	pkt.AddOption(&optprl)
	require.True(t, IsRequested(pkt, OptionDomainNameServer))
}