mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Skip running the UDS lisafs test for runsc/fsgofer.
In some test environments, the `TEST_TMPDIR` path is too long. So creating a socket file inside that via bind(2) fails with EINVAL. bind(2) requires paths to be shorter than 108. PiperOrigin-RevId: 609110892
This commit is contained in:
@@ -46,6 +46,9 @@ type Tester interface {
|
||||
// SetUserGroupIDSupported returns true if the backing server supports
|
||||
// changing UID/GID for files.
|
||||
SetUserGroupIDSupported() bool
|
||||
|
||||
// BindSupported returns true if the backing server supports BindAt.
|
||||
BindSupported() bool
|
||||
}
|
||||
|
||||
// RunAllLocalFSTests runs all local FS tests as subtests.
|
||||
@@ -606,6 +609,9 @@ func testMknod(ctx context.Context, t *testing.T, tester Tester, root lisafs.Cli
|
||||
}
|
||||
|
||||
func testUDS(ctx context.Context, t *testing.T, tester Tester, root lisafs.ClientFD) {
|
||||
if !tester.BindSupported() {
|
||||
t.Skipf("server does not support BindAt RPC")
|
||||
}
|
||||
const name = "sock"
|
||||
file, socket, stat := bind(ctx, t, root, name, unix.SOCK_STREAM)
|
||||
defer closeFD(ctx, t, file)
|
||||
|
||||
@@ -34,6 +34,5 @@ go_test(
|
||||
"//pkg/lisafs",
|
||||
"//pkg/lisafs/testsuite",
|
||||
"//pkg/log",
|
||||
"//runsc/config",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -20,7 +20,6 @@ import (
|
||||
"gvisor.dev/gvisor/pkg/lisafs"
|
||||
"gvisor.dev/gvisor/pkg/lisafs/testsuite"
|
||||
"gvisor.dev/gvisor/pkg/log"
|
||||
"gvisor.dev/gvisor/runsc/config"
|
||||
"gvisor.dev/gvisor/runsc/fsgofer"
|
||||
)
|
||||
|
||||
@@ -39,7 +38,7 @@ type tester struct{}
|
||||
|
||||
// NewServer implements testsuite.Tester.NewServer.
|
||||
func (tester) NewServer(t *testing.T) *lisafs.Server {
|
||||
return &fsgofer.NewLisafsServer(fsgofer.Config{HostUDS: config.HostUDSCreate}).Server
|
||||
return &fsgofer.NewLisafsServer(fsgofer.Config{}).Server
|
||||
}
|
||||
|
||||
// LinkSupported implements testsuite.Tester.LinkSupported.
|
||||
@@ -52,6 +51,13 @@ func (tester) SetUserGroupIDSupported() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// BindSupported implements testsuite.Tester.BindSupported.
|
||||
func (tester) BindSupported() bool {
|
||||
// In some test environments, the mount path is really large and bind(2)
|
||||
// fails with EINVAL if the path length >= 108.
|
||||
return false
|
||||
}
|
||||
|
||||
func TestFSGofer(t *testing.T) {
|
||||
testsuite.RunAllLocalFSTests(t, tester{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user