Browse code

integration: remove uses of pkg/system.Stat()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2022/10/10 00:55:42
Showing 1 changed files
... ...
@@ -3,7 +3,9 @@ package container // import "github.com/docker/docker/integration/container"
3 3
 import (
4 4
 	"context"
5 5
 	"fmt"
6
+	"os"
6 7
 	"path/filepath"
8
+	"syscall"
7 9
 	"testing"
8 10
 	"time"
9 11
 
... ...
@@ -14,7 +16,6 @@ import (
14 14
 	"github.com/docker/docker/api/types/versions"
15 15
 	"github.com/docker/docker/client"
16 16
 	"github.com/docker/docker/integration/internal/container"
17
-	"github.com/docker/docker/pkg/system"
18 17
 	"github.com/moby/sys/mount"
19 18
 	"github.com/moby/sys/mountinfo"
20 19
 	"gotest.tools/v3/assert"
... ...
@@ -80,9 +81,10 @@ func TestContainerNetworkMountsNoChown(t *testing.T) {
80 80
 	// daemon. In all other volume/bind mount situations we have taken this
81 81
 	// same line--we don't chown host file content.
82 82
 	// See GitHub PR 34224 for details.
83
-	statT, err := system.Stat(tmpNWFileMount)
83
+	info, err := os.Stat(tmpNWFileMount)
84 84
 	assert.NilError(t, err)
85
-	assert.Check(t, is.Equal(uint32(0), statT.UID()), "bind mounted network file should not change ownership from root")
85
+	fi := info.Sys().(*syscall.Stat_t)
86
+	assert.Check(t, is.Equal(fi.Uid, uint32(0)), "bind mounted network file should not change ownership from root")
86 87
 }
87 88
 
88 89
 func TestMountDaemonRoot(t *testing.T) {