1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Run libnetwork test case only when it's specifically enabled

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
This commit is contained in:
Jana Radhakrishnan 2015-04-09 20:48:13 +00:00
parent 724948d6ed
commit d1a6ee35ea

View file

@ -1,8 +1,8 @@
package libnetwork_test
import (
"flag"
"net"
"os"
"testing"
log "github.com/Sirupsen/logrus"
@ -12,16 +12,15 @@ import (
)
var bridgeName = "docker0"
func TestMain(m *testing.M) {
// Cleanup any existing docker0 bridge if needed. Ignore errors
bridge := &netlink.Bridge{LinkAttrs: netlink.LinkAttrs{Name: bridgeName}}
netlink.LinkDel(bridge)
os.Exit(m.Run())
}
var enableBridgeTest = flag.Bool("enable-bridge-test", false, "")
func TestSimplebridge(t *testing.T) {
if *enableBridgeTest == false {
t.Skip()
}
bridge := &netlink.Bridge{LinkAttrs: netlink.LinkAttrs{Name: bridgeName}}
netlink.LinkDel(bridge)
ip, subnet, err := net.ParseCIDR("192.168.100.1/24")
if err != nil {