Enable Windows CI (Appveyor)
authorGabriel Rosenhouse <grosenhouse@pivotal.io>
Wed, 1 Nov 2017 05:58:50 +0000 (22:58 -0700)
committerGabriel Rosenhouse <grosenhouse@pivotal.io>
Fri, 10 Nov 2017 16:09:29 +0000 (08:09 -0800)
- start list of linux_only plugins; ignore them when testing on Windows
- Isolate linux-only code by filename suffix
- Remove stub (NotImplemented) functions
- other misc. fixes for Windows compatibility

21 files changed:
.appveyor.yml [new file with mode: 0644]
pkg/ip/addr_linux.go [moved from pkg/ip/addr.go with 100% similarity]
pkg/ip/ipforward_linux.go [moved from pkg/ip/ipforward.go with 100% similarity]
pkg/ip/ipmasq_linux.go [moved from pkg/ip/ipmasq.go with 100% similarity]
pkg/ip/link_linux.go [moved from pkg/ip/link.go with 100% similarity]
pkg/ip/link_linux_test.go [moved from pkg/ip/link_test.go with 100% similarity]
pkg/ip/route.go [deleted file]
pkg/ip/route_linux.go
pkg/ip/route_unspecified.go [deleted file]
pkg/ipam/ipam.go
pkg/ipam/ipam_linux.go [new file with mode: 0644]
pkg/ipam/ipam_linux_test.go [moved from pkg/ipam/ipam_test.go with 99% similarity]
pkg/ns/ns.go [deleted file]
pkg/ns/ns_linux.go
pkg/ns/ns_linux_test.go [moved from pkg/ns/ns_test.go with 100% similarity]
pkg/ns/ns_unspecified.go [deleted file]
pkg/testutils/echosvr/echosvr_test.go
plugins/ipam/host-local/backend/disk/lock.go
plugins/linux_only.txt [new file with mode: 0644]
plugins/meta/flannel/flannel_linux_test.go [moved from plugins/meta/flannel/flannel_test.go with 100% similarity]
plugins/sample/sample_linux_test.go [moved from plugins/sample/sample_test.go with 100% similarity]

diff --git a/.appveyor.yml b/.appveyor.yml
new file mode 100644 (file)
index 0000000..ea06455
--- /dev/null
@@ -0,0 +1,28 @@
+clone_folder: c:\gopath\src\github.com\containernetworking\plugins
+
+environment:
+  GOPATH: c:\gopath
+
+install:
+  - echo %PATH%
+  - echo %GOPATH%
+  - set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
+  - go version
+  - go env
+
+build: off
+
+test_script:
+  - ps: |
+      go list ./... | Select-String -Pattern (Get-Content "./plugins/linux_only.txt") -NotMatch > "to_test.txt"
+      echo "Will test:"
+      Get-Content "to_test.txt"
+      foreach ($pkg in Get-Content "to_test.txt") {
+        if ($pkg) {
+          echo $pkg
+          go test -v $pkg
+          if ($LastExitCode -ne 0) {
+            throw "test failed"
+          }
+        }
+      }
similarity index 100%
rename from pkg/ip/addr.go
rename to pkg/ip/addr_linux.go
similarity index 100%
rename from pkg/ip/ipmasq.go
rename to pkg/ip/ipmasq_linux.go
similarity index 100%
rename from pkg/ip/link.go
rename to pkg/ip/link_linux.go
diff --git a/pkg/ip/route.go b/pkg/ip/route.go
deleted file mode 100644 (file)
index 1325a47..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2015 CNI authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package ip
-
-import (
-       "net"
-
-       "github.com/vishvananda/netlink"
-)
-
-// AddDefaultRoute sets the default route on the given gateway.
-func AddDefaultRoute(gw net.IP, dev netlink.Link) error {
-       _, defNet, _ := net.ParseCIDR("0.0.0.0/0")
-       return AddRoute(defNet, gw, dev)
-}
index 8b11807..f5c0d08 100644 (file)
@@ -39,3 +39,9 @@ func AddHostRoute(ipn *net.IPNet, gw net.IP, dev netlink.Link) error {
                Gw:        gw,
        })
 }
+
+// AddDefaultRoute sets the default route on the given gateway.
+func AddDefaultRoute(gw net.IP, dev netlink.Link) error {
+       _, defNet, _ := net.ParseCIDR("0.0.0.0/0")
+       return AddRoute(defNet, gw, dev)
+}
diff --git a/pkg/ip/route_unspecified.go b/pkg/ip/route_unspecified.go
deleted file mode 100644 (file)
index 7e79fde..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2015-2017 CNI authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// +build !linux
-
-package ip
-
-import (
-       "net"
-
-       "github.com/containernetworking/cni/pkg/types"
-       "github.com/vishvananda/netlink"
-)
-
-// AddRoute adds a universally-scoped route to a device.
-func AddRoute(ipn *net.IPNet, gw net.IP, dev netlink.Link) error {
-       return types.NotImplementedError
-}
-
-// AddHostRoute adds a host-scoped route to a device.
-func AddHostRoute(ipn *net.IPNet, gw net.IP, dev netlink.Link) error {
-       return types.NotImplementedError
-}
index aa72e5c..904b255 100644 (file)
 package ipam
 
 import (
-       "fmt"
-       "net"
-       "os"
-
        "github.com/containernetworking/cni/pkg/invoke"
        "github.com/containernetworking/cni/pkg/types"
-       "github.com/containernetworking/cni/pkg/types/current"
-       "github.com/containernetworking/plugins/pkg/ip"
-
-       "github.com/vishvananda/netlink"
 )
 
 func ExecAdd(plugin string, netconf []byte) (types.Result, error) {
@@ -34,66 +26,3 @@ func ExecAdd(plugin string, netconf []byte) (types.Result, error) {
 func ExecDel(plugin string, netconf []byte) error {
        return invoke.DelegateDel(plugin, netconf)
 }
-
-// ConfigureIface takes the result of IPAM plugin and
-// applies to the ifName interface
-func ConfigureIface(ifName string, res *current.Result) error {
-       if len(res.Interfaces) == 0 {
-               return fmt.Errorf("no interfaces to configure")
-       }
-
-       link, err := netlink.LinkByName(ifName)
-       if err != nil {
-               return fmt.Errorf("failed to lookup %q: %v", ifName, err)
-       }
-
-       if err := netlink.LinkSetUp(link); err != nil {
-               return fmt.Errorf("failed to set %q UP: %v", ifName, err)
-       }
-
-       var v4gw, v6gw net.IP
-       for _, ipc := range res.IPs {
-               if ipc.Interface == nil {
-                       continue
-               }
-               intIdx := *ipc.Interface
-               if intIdx < 0 || intIdx >= len(res.Interfaces) || res.Interfaces[intIdx].Name != ifName {
-                       // IP address is for a different interface
-                       return fmt.Errorf("failed to add IP addr %v to %q: invalid interface index", ipc, ifName)
-               }
-
-               addr := &netlink.Addr{IPNet: &ipc.Address, Label: ""}
-               if err = netlink.AddrAdd(link, addr); err != nil {
-                       return fmt.Errorf("failed to add IP addr %v to %q: %v", ipc, ifName, err)
-               }
-
-               gwIsV4 := ipc.Gateway.To4() != nil
-               if gwIsV4 && v4gw == nil {
-                       v4gw = ipc.Gateway
-               } else if !gwIsV4 && v6gw == nil {
-                       v6gw = ipc.Gateway
-               }
-       }
-
-       ip.SettleAddresses(ifName, 10)
-
-       for _, r := range res.Routes {
-               routeIsV4 := r.Dst.IP.To4() != nil
-               gw := r.GW
-               if gw == nil {
-                       if routeIsV4 && v4gw != nil {
-                               gw = v4gw
-                       } else if !routeIsV4 && v6gw != nil {
-                               gw = v6gw
-                       }
-               }
-               if err = ip.AddRoute(&r.Dst, gw, link); err != nil {
-                       // we skip over duplicate routes as we assume the first one wins
-                       if !os.IsExist(err) {
-                               return fmt.Errorf("failed to add route '%v via %v dev %v': %v", r.Dst, gw, ifName, err)
-                       }
-               }
-       }
-
-       return nil
-}
diff --git a/pkg/ipam/ipam_linux.go b/pkg/ipam/ipam_linux.go
new file mode 100644 (file)
index 0000000..6c8ef20
--- /dev/null
@@ -0,0 +1,89 @@
+// Copyright 2015 CNI authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ipam
+
+import (
+       "fmt"
+       "net"
+       "os"
+
+       "github.com/containernetworking/cni/pkg/types/current"
+       "github.com/containernetworking/plugins/pkg/ip"
+
+       "github.com/vishvananda/netlink"
+)
+
+// ConfigureIface takes the result of IPAM plugin and
+// applies to the ifName interface
+func ConfigureIface(ifName string, res *current.Result) error {
+       if len(res.Interfaces) == 0 {
+               return fmt.Errorf("no interfaces to configure")
+       }
+
+       link, err := netlink.LinkByName(ifName)
+       if err != nil {
+               return fmt.Errorf("failed to lookup %q: %v", ifName, err)
+       }
+
+       if err := netlink.LinkSetUp(link); err != nil {
+               return fmt.Errorf("failed to set %q UP: %v", ifName, err)
+       }
+
+       var v4gw, v6gw net.IP
+       for _, ipc := range res.IPs {
+               if ipc.Interface == nil {
+                       continue
+               }
+               intIdx := *ipc.Interface
+               if intIdx < 0 || intIdx >= len(res.Interfaces) || res.Interfaces[intIdx].Name != ifName {
+                       // IP address is for a different interface
+                       return fmt.Errorf("failed to add IP addr %v to %q: invalid interface index", ipc, ifName)
+               }
+
+               addr := &netlink.Addr{IPNet: &ipc.Address, Label: ""}
+               if err = netlink.AddrAdd(link, addr); err != nil {
+                       return fmt.Errorf("failed to add IP addr %v to %q: %v", ipc, ifName, err)
+               }
+
+               gwIsV4 := ipc.Gateway.To4() != nil
+               if gwIsV4 && v4gw == nil {
+                       v4gw = ipc.Gateway
+               } else if !gwIsV4 && v6gw == nil {
+                       v6gw = ipc.Gateway
+               }
+       }
+
+       ip.SettleAddresses(ifName, 10)
+
+       for _, r := range res.Routes {
+               routeIsV4 := r.Dst.IP.To4() != nil
+               gw := r.GW
+               if gw == nil {
+                       if routeIsV4 && v4gw != nil {
+                               gw = v4gw
+                       } else if !routeIsV4 && v6gw != nil {
+                               gw = v6gw
+                       }
+               }
+               if err = ip.AddRoute(&r.Dst, gw, link); err != nil {
+                       // we skip over duplicate routes as we assume the first one wins
+                       if !os.IsExist(err) {
+                               return fmt.Errorf("failed to add route '%v via %v dev %v': %v", r.Dst, gw, ifName, err)
+                       }
+               }
+       }
+
+       return nil
+}
similarity index 99%
rename from pkg/ipam/ipam_test.go
rename to pkg/ipam/ipam_linux_test.go
index cf85117..9de3fa0 100644 (file)
@@ -39,7 +39,7 @@ func ipNetEqual(a, b *net.IPNet) bool {
        return a.IP.Equal(b.IP)
 }
 
-var _ = Describe("IPAM Operations", func() {
+var _ = Describe("ConfigureIface", func() {
        var originalNS ns.NetNS
        var ipv4, ipv6, routev4, routev6 *net.IPNet
        var ipgw4, ipgw6, routegwv4, routegwv6 net.IP
diff --git a/pkg/ns/ns.go b/pkg/ns/ns.go
deleted file mode 100644 (file)
index c212f48..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-// Copyright 2015 CNI authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package ns
-
-import (
-       "fmt"
-       "os"
-       "runtime"
-       "sync"
-       "syscall"
-)
-
-type NetNS interface {
-       // Executes the passed closure in this object's network namespace,
-       // attempting to restore the original namespace before returning.
-       // However, since each OS thread can have a different network namespace,
-       // and Go's thread scheduling is highly variable, callers cannot
-       // guarantee any specific namespace is set unless operations that
-       // require that namespace are wrapped with Do().  Also, no code called
-       // from Do() should call runtime.UnlockOSThread(), or the risk
-       // of executing code in an incorrect namespace will be greater.  See
-       // https://github.com/golang/go/wiki/LockOSThread for further details.
-       Do(toRun func(NetNS) error) error
-
-       // Sets the current network namespace to this object's network namespace.
-       // Note that since Go's thread scheduling is highly variable, callers
-       // cannot guarantee the requested namespace will be the current namespace
-       // after this function is called; to ensure this wrap operations that
-       // require the namespace with Do() instead.
-       Set() error
-
-       // Returns the filesystem path representing this object's network namespace
-       Path() string
-
-       // Returns a file descriptor representing this object's network namespace
-       Fd() uintptr
-
-       // Cleans up this instance of the network namespace; if this instance
-       // is the last user the namespace will be destroyed
-       Close() error
-}
-
-type netNS struct {
-       file    *os.File
-       mounted bool
-       closed  bool
-}
-
-// netNS implements the NetNS interface
-var _ NetNS = &netNS{}
-
-const (
-       // https://github.com/torvalds/linux/blob/master/include/uapi/linux/magic.h
-       NSFS_MAGIC   = 0x6e736673
-       PROCFS_MAGIC = 0x9fa0
-)
-
-type NSPathNotExistErr struct{ msg string }
-
-func (e NSPathNotExistErr) Error() string { return e.msg }
-
-type NSPathNotNSErr struct{ msg string }
-
-func (e NSPathNotNSErr) Error() string { return e.msg }
-
-func IsNSorErr(nspath string) error {
-       stat := syscall.Statfs_t{}
-       if err := syscall.Statfs(nspath, &stat); err != nil {
-               if os.IsNotExist(err) {
-                       err = NSPathNotExistErr{msg: fmt.Sprintf("failed to Statfs %q: %v", nspath, err)}
-               } else {
-                       err = fmt.Errorf("failed to Statfs %q: %v", nspath, err)
-               }
-               return err
-       }
-
-       switch stat.Type {
-       case PROCFS_MAGIC, NSFS_MAGIC:
-               return nil
-       default:
-               return NSPathNotNSErr{msg: fmt.Sprintf("unknown FS magic on %q: %x", nspath, stat.Type)}
-       }
-}
-
-// Returns an object representing the namespace referred to by @path
-func GetNS(nspath string) (NetNS, error) {
-       err := IsNSorErr(nspath)
-       if err != nil {
-               return nil, err
-       }
-
-       fd, err := os.Open(nspath)
-       if err != nil {
-               return nil, err
-       }
-
-       return &netNS{file: fd}, nil
-}
-
-func (ns *netNS) Path() string {
-       return ns.file.Name()
-}
-
-func (ns *netNS) Fd() uintptr {
-       return ns.file.Fd()
-}
-
-func (ns *netNS) errorIfClosed() error {
-       if ns.closed {
-               return fmt.Errorf("%q has already been closed", ns.file.Name())
-       }
-       return nil
-}
-
-func (ns *netNS) Do(toRun func(NetNS) error) error {
-       if err := ns.errorIfClosed(); err != nil {
-               return err
-       }
-
-       containedCall := func(hostNS NetNS) error {
-               threadNS, err := GetCurrentNS()
-               if err != nil {
-                       return fmt.Errorf("failed to open current netns: %v", err)
-               }
-               defer threadNS.Close()
-
-               // switch to target namespace
-               if err = ns.Set(); err != nil {
-                       return fmt.Errorf("error switching to ns %v: %v", ns.file.Name(), err)
-               }
-               defer threadNS.Set() // switch back
-
-               return toRun(hostNS)
-       }
-
-       // save a handle to current network namespace
-       hostNS, err := GetCurrentNS()
-       if err != nil {
-               return fmt.Errorf("Failed to open current namespace: %v", err)
-       }
-       defer hostNS.Close()
-
-       var wg sync.WaitGroup
-       wg.Add(1)
-
-       var innerError error
-       go func() {
-               defer wg.Done()
-               runtime.LockOSThread()
-               innerError = containedCall(hostNS)
-       }()
-       wg.Wait()
-
-       return innerError
-}
-
-// WithNetNSPath executes the passed closure under the given network
-// namespace, restoring the original namespace afterwards.
-func WithNetNSPath(nspath string, toRun func(NetNS) error) error {
-       ns, err := GetNS(nspath)
-       if err != nil {
-               return err
-       }
-       defer ns.Close()
-       return ns.Do(toRun)
-}
index 8949d21..4ce9894 100644 (file)
@@ -21,6 +21,7 @@ import (
        "path"
        "runtime"
        "sync"
+       "syscall"
 
        "golang.org/x/sys/unix"
 )
@@ -147,3 +148,158 @@ func (ns *netNS) Set() error {
 
        return nil
 }
+
+type NetNS interface {
+       // Executes the passed closure in this object's network namespace,
+       // attempting to restore the original namespace before returning.
+       // However, since each OS thread can have a different network namespace,
+       // and Go's thread scheduling is highly variable, callers cannot
+       // guarantee any specific namespace is set unless operations that
+       // require that namespace are wrapped with Do().  Also, no code called
+       // from Do() should call runtime.UnlockOSThread(), or the risk
+       // of executing code in an incorrect namespace will be greater.  See
+       // https://github.com/golang/go/wiki/LockOSThread for further details.
+       Do(toRun func(NetNS) error) error
+
+       // Sets the current network namespace to this object's network namespace.
+       // Note that since Go's thread scheduling is highly variable, callers
+       // cannot guarantee the requested namespace will be the current namespace
+       // after this function is called; to ensure this wrap operations that
+       // require the namespace with Do() instead.
+       Set() error
+
+       // Returns the filesystem path representing this object's network namespace
+       Path() string
+
+       // Returns a file descriptor representing this object's network namespace
+       Fd() uintptr
+
+       // Cleans up this instance of the network namespace; if this instance
+       // is the last user the namespace will be destroyed
+       Close() error
+}
+
+type netNS struct {
+       file    *os.File
+       mounted bool
+       closed  bool
+}
+
+// netNS implements the NetNS interface
+var _ NetNS = &netNS{}
+
+const (
+       // https://github.com/torvalds/linux/blob/master/include/uapi/linux/magic.h
+       NSFS_MAGIC   = 0x6e736673
+       PROCFS_MAGIC = 0x9fa0
+)
+
+type NSPathNotExistErr struct{ msg string }
+
+func (e NSPathNotExistErr) Error() string { return e.msg }
+
+type NSPathNotNSErr struct{ msg string }
+
+func (e NSPathNotNSErr) Error() string { return e.msg }
+
+func IsNSorErr(nspath string) error {
+       stat := syscall.Statfs_t{}
+       if err := syscall.Statfs(nspath, &stat); err != nil {
+               if os.IsNotExist(err) {
+                       err = NSPathNotExistErr{msg: fmt.Sprintf("failed to Statfs %q: %v", nspath, err)}
+               } else {
+                       err = fmt.Errorf("failed to Statfs %q: %v", nspath, err)
+               }
+               return err
+       }
+
+       switch stat.Type {
+       case PROCFS_MAGIC, NSFS_MAGIC:
+               return nil
+       default:
+               return NSPathNotNSErr{msg: fmt.Sprintf("unknown FS magic on %q: %x", nspath, stat.Type)}
+       }
+}
+
+// Returns an object representing the namespace referred to by @path
+func GetNS(nspath string) (NetNS, error) {
+       err := IsNSorErr(nspath)
+       if err != nil {
+               return nil, err
+       }
+
+       fd, err := os.Open(nspath)
+       if err != nil {
+               return nil, err
+       }
+
+       return &netNS{file: fd}, nil
+}
+
+func (ns *netNS) Path() string {
+       return ns.file.Name()
+}
+
+func (ns *netNS) Fd() uintptr {
+       return ns.file.Fd()
+}
+
+func (ns *netNS) errorIfClosed() error {
+       if ns.closed {
+               return fmt.Errorf("%q has already been closed", ns.file.Name())
+       }
+       return nil
+}
+
+func (ns *netNS) Do(toRun func(NetNS) error) error {
+       if err := ns.errorIfClosed(); err != nil {
+               return err
+       }
+
+       containedCall := func(hostNS NetNS) error {
+               threadNS, err := GetCurrentNS()
+               if err != nil {
+                       return fmt.Errorf("failed to open current netns: %v", err)
+               }
+               defer threadNS.Close()
+
+               // switch to target namespace
+               if err = ns.Set(); err != nil {
+                       return fmt.Errorf("error switching to ns %v: %v", ns.file.Name(), err)
+               }
+               defer threadNS.Set() // switch back
+
+               return toRun(hostNS)
+       }
+
+       // save a handle to current network namespace
+       hostNS, err := GetCurrentNS()
+       if err != nil {
+               return fmt.Errorf("Failed to open current namespace: %v", err)
+       }
+       defer hostNS.Close()
+
+       var wg sync.WaitGroup
+       wg.Add(1)
+
+       var innerError error
+       go func() {
+               defer wg.Done()
+               runtime.LockOSThread()
+               innerError = containedCall(hostNS)
+       }()
+       wg.Wait()
+
+       return innerError
+}
+
+// WithNetNSPath executes the passed closure under the given network
+// namespace, restoring the original namespace afterwards.
+func WithNetNSPath(nspath string, toRun func(NetNS) error) error {
+       ns, err := GetNS(nspath)
+       if err != nil {
+               return err
+       }
+       defer ns.Close()
+       return ns.Do(toRun)
+}
similarity index 100%
rename from pkg/ns/ns_test.go
rename to pkg/ns/ns_linux_test.go
diff --git a/pkg/ns/ns_unspecified.go b/pkg/ns/ns_unspecified.go
deleted file mode 100644 (file)
index 41b4468..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2015-2017 CNI authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// +build !linux
-
-package ns
-
-import "github.com/containernetworking/cni/pkg/types"
-
-// Returns an object representing the current OS thread's network namespace
-func GetCurrentNS() (NetNS, error) {
-       return nil, types.NotImplementedError
-}
-
-func NewNS() (NetNS, error) {
-       return nil, types.NotImplementedError
-}
-
-func (ns *netNS) Close() error {
-       return types.NotImplementedError
-}
-
-func (ns *netNS) Set() error {
-       return types.NotImplementedError
-}
index 6a4c3bf..901febd 100644 (file)
@@ -37,7 +37,7 @@ var _ = Describe("Echosvr", func() {
        })
 
        AfterEach(func() {
-               session.Terminate().Wait()
+               session.Kill().Wait()
        })
 
        It("starts and doesn't terminate immediately", func() {
index 7241482..bd4fce2 100644 (file)
@@ -1,3 +1,4 @@
+// +build !windows
 // Copyright 2015 CNI authors
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/plugins/linux_only.txt b/plugins/linux_only.txt
new file mode 100644 (file)
index 0000000..f4904b3
--- /dev/null
@@ -0,0 +1,11 @@
+plugins/host-device
+plugins/ipam/dhcp
+plugins/ipam/host-local
+plugins/main/bridge
+plugins/main/ipvlan
+plugins/main/loopback
+plugins/main/macvlan
+plugins/main/ptp
+plugins/main/vlan
+plugins/meta/portmap
+plugins/meta/tuning