1
0
mirror of https://github.com/moby/moby.git synced 2025-10-24 09:13:09 +03:00

[project] change syscall to /x/sys/unix|windows

Changes most references of syscall to golang.org/x/sys/
Ones aren't changes include, Errno, Signal and SysProcAttr
as they haven't been implemented in /x/sys/.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>

[s390x] switch utsname from unsigned to signed

per 33267e036f
char in s390x in the /x/sys/unix package is now signed, so
change the buildtags

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
This commit is contained in:
Christopher Jones
2017-05-23 10:22:32 -04:00
parent 6978a6e25a
commit 069fdc8a08
93 changed files with 499 additions and 474 deletions

View File

@@ -12,7 +12,6 @@ import (
"os"
"path/filepath"
"strings"
"syscall"
"time"
"github.com/docker/docker/api/types"
@@ -30,6 +29,7 @@ import (
"github.com/docker/libnetwork/netlabel"
"github.com/go-check/check"
"github.com/vishvananda/netlink"
"golang.org/x/sys/unix"
)
const dummyNetworkDriver = "dummy-network-driver"
@@ -1810,12 +1810,12 @@ func (s *DockerNetworkSuite) TestConntrackFlowsLeak(c *check.C) {
cli.DockerCmd(c, "run", "-d", "--name", "client", "--net=host", "appropriate/nc", "sh", "-c", cmd)
// Get all the flows using netlink
flows, err := netlink.ConntrackTableList(netlink.ConntrackTable, syscall.AF_INET)
flows, err := netlink.ConntrackTableList(netlink.ConntrackTable, unix.AF_INET)
c.Assert(err, check.IsNil)
var flowMatch int
for _, flow := range flows {
// count only the flows that we are interested in, skipping others that can be laying around the host
if flow.Forward.Protocol == syscall.IPPROTO_UDP &&
if flow.Forward.Protocol == unix.IPPROTO_UDP &&
flow.Forward.DstIP.Equal(net.ParseIP("192.168.10.1")) &&
flow.Forward.DstPort == 8080 {
flowMatch++
@@ -1828,11 +1828,11 @@ func (s *DockerNetworkSuite) TestConntrackFlowsLeak(c *check.C) {
cli.DockerCmd(c, "rm", "-fv", "server")
// Fetch again all the flows and validate that there is no server flow in the conntrack laying around
flows, err = netlink.ConntrackTableList(netlink.ConntrackTable, syscall.AF_INET)
flows, err = netlink.ConntrackTableList(netlink.ConntrackTable, unix.AF_INET)
c.Assert(err, check.IsNil)
flowMatch = 0
for _, flow := range flows {
if flow.Forward.Protocol == syscall.IPPROTO_UDP &&
if flow.Forward.Protocol == unix.IPPROTO_UDP &&
flow.Forward.DstIP.Equal(net.ParseIP("192.168.10.1")) &&
flow.Forward.DstPort == 8080 {
flowMatch++