mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Enable access, chroot, chown, and sync tests for FUSE.
PiperOrigin-RevId: 510699649
This commit is contained in:
committed by
gVisor bot
parent
ff32cb8b25
commit
0650bd1a5c
@@ -144,9 +144,6 @@ func (fd *fileDescription) Sync(ctx context.Context) error {
|
||||
inode := fd.inode()
|
||||
inode.attrMu.Lock()
|
||||
defer inode.attrMu.Unlock()
|
||||
if inode.filemode().IsDir() {
|
||||
return linuxerr.EPERM
|
||||
}
|
||||
conn := inode.fs.conn
|
||||
// no need to proceed if FUSE server doesn't implement Open.
|
||||
if conn.noOpen {
|
||||
|
||||
@@ -22,6 +22,7 @@ syscall_test(
|
||||
)
|
||||
|
||||
syscall_test(
|
||||
add_fusefs = True,
|
||||
add_overlay = True,
|
||||
test = "//test/syscalls/linux:access_test",
|
||||
)
|
||||
@@ -79,17 +80,20 @@ syscall_test(
|
||||
|
||||
syscall_test(
|
||||
size = "medium",
|
||||
add_fusefs = True,
|
||||
add_overlay = True,
|
||||
test = "//test/syscalls/linux:chown_test",
|
||||
use_tmpfs = True, # chown tests require gofer to be running as root.
|
||||
)
|
||||
|
||||
syscall_test(
|
||||
add_fusefs = True,
|
||||
add_overlay = True,
|
||||
test = "//test/syscalls/linux:chroot_test",
|
||||
)
|
||||
|
||||
syscall_test(
|
||||
add_fusefs = True,
|
||||
add_overlay = True,
|
||||
test = "//test/syscalls/linux:pivot_root_test",
|
||||
use_tmpfs = True,
|
||||
@@ -143,6 +147,7 @@ syscall_test(
|
||||
)
|
||||
|
||||
syscall_test(
|
||||
add_fusefs = True,
|
||||
add_overlay = True,
|
||||
test = "//test/syscalls/linux:dup_test",
|
||||
)
|
||||
@@ -224,6 +229,7 @@ syscall_test(
|
||||
)
|
||||
|
||||
syscall_test(
|
||||
add_fusefs = True,
|
||||
add_overlay = True,
|
||||
test = "//test/syscalls/linux:fsync_test",
|
||||
)
|
||||
@@ -973,11 +979,13 @@ syscall_test(
|
||||
)
|
||||
|
||||
syscall_test(
|
||||
add_fusefs = True,
|
||||
add_overlay = True,
|
||||
test = "//test/syscalls/linux:sync_test",
|
||||
)
|
||||
|
||||
syscall_test(
|
||||
add_fusefs = True,
|
||||
add_overlay = True,
|
||||
test = "//test/syscalls/linux:sync_file_range_test",
|
||||
)
|
||||
|
||||
@@ -310,6 +310,8 @@ TEST(ChrootTest, ProcMemSelfFdsNoEscapeProcOpen) {
|
||||
// expose the full file path via /proc/self/maps and instead honor the chroot.
|
||||
TEST(ChrootTest, ProcMemSelfMapsNoEscapeProcOpen) {
|
||||
SKIP_IF(!ASSERT_NO_ERRNO_AND_VALUE(HaveCapability(CAP_SYS_CHROOT)));
|
||||
// TODO(b/264306751): Remove once FUSE implements mmap.
|
||||
SKIP_IF(getenv("GVISOR_FUSE_TEST"));
|
||||
|
||||
// Get a FD to /proc before we enter the chroot.
|
||||
const FileDescriptor proc =
|
||||
|
||||
Reference in New Issue
Block a user