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 {
@@ -506,50 +504,6 @@ func testQueryEndpointInfo(t *testing.T, ulPxyEnabled bool) {
506504 }
507505}
508506
509- func TestCreateLinkWithOptions (t * testing.T ) {
510- defer testutils .SetupTestOSContext (t )()
511- d := newDriver ()
512-
513- if err := d .configure (nil ); err != nil {
514- t .Fatalf ("Failed to setup driver config: %v" , err )
515- }
516-
517- netconfig := & networkConfiguration {BridgeName : DefaultBridgeName }
518- netOptions := make (map [string ]interface {})
519- netOptions [netlabel .GenericData ] = netconfig
520-
521- ipdList := getIPv4Data (t )
522- err := d .CreateNetwork ("net1" , netOptions , ipdList , nil )
523- if err != nil {
524- t .Fatalf ("Failed to create bridge: %v" , err )
525- }
526-
527- mac := net .HardwareAddr ([]byte {0x1e , 0x67 , 0x66 , 0x44 , 0x55 , 0x66 })
528- epOptions := make (map [string ]interface {})
529- epOptions [netlabel .MacAddress ] = mac
530-
531- te := newTestEndpoint (ipdList [0 ].Pool , 11 )
532- err = d .CreateEndpoint ("net1" , "ep" , te .Interface (), epOptions )
533- if err != nil {
534- t .Fatalf ("Failed to create an endpoint: %s" , err .Error ())
535- }
536-
537- err = d .Join ("net1" , "ep" , "sbox" , te , nil )
538- if err != nil {
539- t .Fatalf ("Failed to join the endpoint: %v" , err )
540- }
541-
542- ifaceName := te .iface .srcName
543- veth , err := netlink .LinkByName (ifaceName )
544- if err != nil {
545- t .Fatal (err )
546- }
547-
548- if ! bytes .Equal (mac , veth .Attrs ().HardwareAddr ) {
549- t .Fatalf ("Failed to parse and program endpoint configuration" )
550- }
551- }
552-
553507func getExposedPorts () []types.TransportPort {
554508 return []types.TransportPort {
555509 {Proto : types .TCP , Port : uint16 (5000 )},
0 commit comments