11package bridge
22
33import (
4- "bytes"
54 "fmt"
65 "net"
76 "regexp"
@@ -13,7 +12,6 @@ import (
1312 "github.com/docker/libnetwork/netlabel"
1413 "github.com/docker/libnetwork/testutils"
1514 "github.com/docker/libnetwork/types"
16- "github.com/vishvananda/netlink"
1715)
1816
1917func getIPv4Data (t * testing.T ) []driverapi.IPAMData {
@@ -497,50 +495,6 @@ func testQueryEndpointInfo(t *testing.T, ulPxyEnabled bool) {
497495 }
498496}
499497
500- func TestCreateLinkWithOptions (t * testing.T ) {
501- defer testutils .SetupTestOSContext (t )()
502- d := newDriver ()
503-
504- if err := d .configure (nil ); err != nil {
505- t .Fatalf ("Failed to setup driver config: %v" , err )
506- }
507-
508- netconfig := & networkConfiguration {BridgeName : DefaultBridgeName }
509- netOptions := make (map [string ]interface {})
510- netOptions [netlabel .GenericData ] = netconfig
511-
512- ipdList := getIPv4Data (t )
513- err := d .CreateNetwork ("net1" , netOptions , ipdList , nil )
514- if err != nil {
515- t .Fatalf ("Failed to create bridge: %v" , err )
516- }
517-
518- mac := net .HardwareAddr ([]byte {0x1e , 0x67 , 0x66 , 0x44 , 0x55 , 0x66 })
519- epOptions := make (map [string ]interface {})
520- epOptions [netlabel .MacAddress ] = mac
521-
522- te := newTestEndpoint (ipdList [0 ].Pool , 11 )
523- err = d .CreateEndpoint ("net1" , "ep" , te .Interface (), epOptions )
524- if err != nil {
525- t .Fatalf ("Failed to create an endpoint: %s" , err .Error ())
526- }
527-
528- err = d .Join ("net1" , "ep" , "sbox" , te , nil )
529- if err != nil {
530- t .Fatalf ("Failed to join the endpoint: %v" , err )
531- }
532-
533- ifaceName := te .iface .srcName
534- veth , err := netlink .LinkByName (ifaceName )
535- if err != nil {
536- t .Fatal (err )
537- }
538-
539- if ! bytes .Equal (mac , veth .Attrs ().HardwareAddr ) {
540- t .Fatalf ("Failed to parse and program endpoint configuration" )
541- }
542- }
543-
544498func getExposedPorts () []types.TransportPort {
545499 return []types.TransportPort {
546500 types.TransportPort {Proto : types .TCP , Port : uint16 (5000 )},
0 commit comments