summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/bsdp/option_vendor_specific_information_test.go
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2023-12-04 10:33:34 +0000
committerinsomniac <insomniacslk@users.noreply.github.com>2023-12-06 07:48:09 +0100
commit8c70d406f6d24a17219a5f543174c1f3f3ad9e35 (patch)
tree7f9acc8e465b9b354dea197f1d77698370e648ab /dhcpv4/bsdp/option_vendor_specific_information_test.go
parentb0416c0f187a65a350b32d34fc31ea30f06c12ce (diff)
remove bsdp packageHEADmaster
Diffstat (limited to 'dhcpv4/bsdp/option_vendor_specific_information_test.go')
-rw-r--r--dhcpv4/bsdp/option_vendor_specific_information_test.go79
1 files changed, 0 insertions, 79 deletions
diff --git a/dhcpv4/bsdp/option_vendor_specific_information_test.go b/dhcpv4/bsdp/option_vendor_specific_information_test.go
deleted file mode 100644
index a6727f5..0000000
--- a/dhcpv4/bsdp/option_vendor_specific_information_test.go
+++ /dev/null
@@ -1,79 +0,0 @@
-package bsdp
-
-import (
- "net"
- "testing"
-
- "github.com/insomniacslk/dhcp/dhcpv4"
- "github.com/stretchr/testify/require"
-)
-
-func TestOptVendorSpecificInformationInterfaceMethods(t *testing.T) {
- o := OptVendorOptions(
- OptVersion(Version1_1),
- OptMessageType(MessageTypeList),
- )
- require.Equal(t, dhcpv4.OptionVendorSpecificInformation, o.Code, "Code")
-
- expectedBytes := []byte{
- 1, 1, 1, // List option
- 2, 2, 1, 1, // Version option
- }
- require.Equal(t, expectedBytes, o.Value.ToBytes(), "ToBytes")
-}
-
-func TestOptVendorSpecificInformationString(t *testing.T) {
- o := OptVendorOptions(
- OptMessageType(MessageTypeList),
- OptVersion(Version1_1),
- )
- expectedString := "Vendor Specific Information:\n BSDP Message Type: LIST\n BSDP Version: 1.1\n"
- require.Equal(t, expectedString, o.String())
-
- // Test more complicated string - sub options of sub options.
- o = OptVendorOptions(
- OptMessageType(MessageTypeList),
- OptBootImageList(
- BootImage{
- ID: BootImageID{
- IsInstall: false,
- ImageType: BootImageTypeMacOSX,
- Index: 1001,
- },
- Name: "bsdp-1",
- },
- BootImage{
- ID: BootImageID{
- IsInstall: true,
- ImageType: BootImageTypeMacOS9,
- Index: 9009,
- },
- Name: "bsdp-2",
- },
- ),
- OptMachineName("foo"),
- OptServerIdentifier(net.IP{1, 1, 1, 1}),
- OptServerPriority(1234),
- OptReplyPort(1235),
- OptDefaultBootImageID(BootImageID{
- IsInstall: true,
- ImageType: BootImageTypeMacOS9,
- Index: 9009,
- }),
- OptSelectedBootImageID(BootImageID{
- IsInstall: true,
- ImageType: BootImageTypeMacOS9,
- Index: 9009,
- }),
- )
- expectedString = "Vendor Specific Information:\n" +
- " BSDP Message Type: LIST\n" +
- " BSDP Server Identifier: 1.1.1.1\n" +
- " BSDP Server Priority: 1234\n" +
- " BSDP Reply Port: 1235\n" +
- " BSDP Default Boot Image ID: [9009] installable macOS 9 image\n" +
- " BSDP Selected Boot Image ID: [9009] installable macOS 9 image\n" +
- " BSDP Boot Image List: bsdp-1 [1001] uninstallable macOS image, bsdp-2 [9009] installable macOS 9 image\n" +
- " BSDP Machine Name: foo\n"
- require.Equal(t, expectedString, o.String())
-}