(t *testing.T)
| 267 | } |
| 268 | |
| 269 | func TestMakeMsgReplyWithHttpClientArch(t *testing.T) { |
| 270 | expectedClientID := []byte("clientid") |
| 271 | expectedServerID := []byte("serverid") |
| 272 | transactionID := [3]byte{'1', '2', '3'} |
| 273 | expectedIP := net.ParseIP("2001:db8:f00f:cafe::1") |
| 274 | expectedBootFileURL := []byte("http://bootfileurl") |
| 275 | identityAssociation := &IdentityAssociation{IPAddress: expectedIP, InterfaceID: []byte("id-1")} |
| 276 | |
| 277 | builder := MakePacketBuilder(90, 100) |
| 278 | |
| 279 | msg := builder.makeMsgReply(transactionID, expectedServerID, expectedClientID, 0x10, |
| 280 | []*IdentityAssociation{identityAssociation}, make([][]byte, 0), expectedBootFileURL, []net.IP{}, nil) |
| 281 | |
| 282 | vendorClassOption := msg.Options[OptVendorClass] |
| 283 | if vendorClassOption == nil { |
| 284 | t.Fatalf("Vendor class option should be present") |
| 285 | } |
| 286 | |
| 287 | bootfileURLOption := msg.Options.BootFileURL() |
| 288 | if bootfileURLOption == nil { |
| 289 | t.Fatalf("Bootfile URL option should be present") |
| 290 | } |
| 291 | if string(expectedBootFileURL) != string(bootfileURLOption) { |
| 292 | t.Fatalf("Expected bootfile URL %v, got %v", expectedBootFileURL, bootfileURLOption) |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | func TestMakeMsgReplyWithNoAddrsAvailable(t *testing.T) { |
| 297 | expectedClientID := []byte("clientid") |
nothing calls this directly
no test coverage detected