From 6fd2d4e77258de3c0eb060a92ccb489351bcd142 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 9 Oct 2022 17:55:42 +0200 Subject: [PATCH] integration: remove uses of pkg/system.Stat() Signed-off-by: Sebastiaan van Stijn --- integration/container/mounts_linux_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/integration/container/mounts_linux_test.go b/integration/container/mounts_linux_test.go index 3c7aabda24..07bae777ea 100644 --- a/integration/container/mounts_linux_test.go +++ b/integration/container/mounts_linux_test.go @@ -3,7 +3,9 @@ package container // import "github.com/docker/docker/integration/container" import ( "context" "fmt" + "os" "path/filepath" + "syscall" "testing" "time" @@ -14,7 +16,6 @@ import ( "github.com/docker/docker/api/types/versions" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" - "github.com/docker/docker/pkg/system" "github.com/moby/sys/mount" "github.com/moby/sys/mountinfo" "gotest.tools/v3/assert" @@ -80,9 +81,10 @@ func TestContainerNetworkMountsNoChown(t *testing.T) { // daemon. In all other volume/bind mount situations we have taken this // same line--we don't chown host file content. // See GitHub PR 34224 for details. - statT, err := system.Stat(tmpNWFileMount) + info, err := os.Stat(tmpNWFileMount) assert.NilError(t, err) - assert.Check(t, is.Equal(uint32(0), statT.UID()), "bind mounted network file should not change ownership from root") + fi := info.Sys().(*syscall.Stat_t) + assert.Check(t, is.Equal(fi.Uid, uint32(0)), "bind mounted network file should not change ownership from root") } func TestMountDaemonRoot(t *testing.T) {