github.com/cloudfoundry-attic/garden-linux@v0.333.2-candidate/network/devices/devices_suite_test.go (about)

     1  package devices_test
     2  
     3  import (
     4  	"net"
     5  
     6  	"github.com/docker/libcontainer/netlink"
     7  	. "github.com/onsi/ginkgo"
     8  	. "github.com/onsi/gomega"
     9  
    10  	"testing"
    11  )
    12  
    13  func TestDevices(t *testing.T) {
    14  	RegisterFailHandler(Fail)
    15  	RunSpecs(t, "Devices Suite")
    16  }
    17  
    18  func cleanup(intfName string) error {
    19  	if _, err := net.InterfaceByName(intfName); err == nil {
    20  		return netlink.NetworkLinkDel(intfName)
    21  	}
    22  	return nil
    23  }