Commit Graph
172 Commits
Author SHA1 Message Date
Lucas ManningandgVisor bot cec42923e3 Clean up mount tests.
This change makes it simpler to write mount tests that examine the optional
field of mountinfo. It also cleans up the mounts in existing tests so they
don't pollute mountinfo after exit.

PiperOrigin-RevId: 561439839
2023-08-30 13:56:03 -07:00
Jeff MartinandgVisor bot 54a6be0000 Internal change.
PiperOrigin-RevId: 556842126
2023-08-14 10:45:30 -07:00
Nicolas LacasseandgVisor bot 6733665148 Implement PR_{S,G}ET_CHILD_SUBREAPER.
Closes #2323

PiperOrigin-RevId: 548205854
2023-07-14 13:19:25 -07:00
Nick BrownandgVisor bot fc43ee33cd Set kOLargeFile for RISC-V architecture
This is required to get these tests building on a Fuchsia + RISC-V
architecture. The constant's value was extracted from:
https://github.com/riscvarchive/riscv-musl/blob/3fe7e2c75df78eef42dcdc352a55757729f451e2/arch/riscv64/bits/fcntl.h#L16

PiperOrigin-RevId: 540340091
2023-06-14 12:03:54 -07:00
Alex KonradiandgVisor bot 65a32da6ce Add a test for receiving UDP packet with src port 0
Add a test that validates that when a UDP packet is received with a source port
value of 0, it is delivered to a listening socket.

PiperOrigin-RevId: 536773375
2023-05-31 11:31:05 -07:00
gVisor bot d034171d9c Merge pull request #8679 from avagin:cpp-warnings
PiperOrigin-RevId: 523157922
2023-04-10 10:59:51 -07:00
Andrei VaginandgVisor bot bcbd4f6bf6 test: use the init_module syscall to trigger save/restore
create_module isn't defined on arm64

PiperOrigin-RevId: 521866613
2023-04-04 14:32:09 -07:00
Etienne PerotandgVisor bot cd6f596d1a Expand test_app syscall to support syscall arguments.
PiperOrigin-RevId: 520677631
2023-03-30 10:29:30 -07:00
Alex KonradiandgVisor bot 4bc8ad7084 Use non-zero timeout for polling TCP connection
Allow poll to wait for a signal on the socket instead of requiring that
it be set immediately. This fixes flakiness caused by connections not
being established fast enough. For https://fxbug.dev/124433

PiperOrigin-RevId: 520212110
2023-03-28 20:36:14 -07:00
gVisor bot 8772480dfa Internal change.
PiperOrigin-RevId: 516846082
2023-03-15 09:28:15 -07:00
Andrei Vagin 3445db339d Fix all c++ compile time warnings 2023-03-09 19:01:00 -08:00
Adin ScannellandgVisor bot 2911d8c3b8 Add default_applicable_licenses rules to packages.
PiperOrigin-RevId: 513581243
2023-03-02 10:50:04 -08:00
Andrei VaginandgVisor bot a12c3a3f23 Open-sourcing the systrap platform.
The systrap platform like the ptrace platform uses stub processes to manage
the user address space. The difference is how they intercept system calls and
other events like memory faults, exceptions, etc.

In case of systrap, all events that have to be handled by the Sentry trigger
signals that are handled by a custom signal handler installed on stub
processes. The signal handler switches control to the Sentry.

Here are a few other optimizations:
* On x86, system calls can be replaced with a function call to remove overhead
  of signals.
* For fast interactions of sentry and stub processes, futex wait/wake can
  be a bottle neck, so we use a polling mode.

The platform is launched for the purpose of testing and gathering initial
feedback. It is not yet ready for use in production.

PiperOrigin-RevId: 511650064
2023-02-22 18:22:49 -08:00
Andrei VaginandgVisor bot 50381662d5 test: address comments from cl/504951567
PiperOrigin-RevId: 508289325
2023-02-09 00:01:46 -08:00
gVisor bot 78c085fa3e Merge pull request #7816 from jseba:proc_self_limits
PiperOrigin-RevId: 507076925
2023-02-03 23:04:45 -08:00
Alex KonradiandgVisor bot b75b5a7997 Internal change.
PiperOrigin-RevId: 506921220
2023-02-03 09:24:46 -08:00
Josh Seba 63bedb9104 Add simple unit test checking limits 2023-01-24 15:56:40 -08:00
Rahat MahmoodandgVisor bot b47ecb8223 Disable io_uring syscalls by default.
The current io_uring support is very limited and experimental. Disable
it by default, and add a flag to enable it for testing.

PiperOrigin-RevId: 500760451
2023-01-09 11:11:57 -08:00
Lucas ManningandgVisor bot 9343d1484d Remove FUSE feature flag and enable by default.
PiperOrigin-RevId: 493410677
2022-12-06 14:22:34 -08:00
gVisor bot f3d6bc24ba Internal change.
PiperOrigin-RevId: 493054944
2022-12-05 10:57:16 -08:00
Shambhavi SrivastavaandgVisor bot f75f60cf4d Adding more trace point integration tests for the following syscalls:
- chroot
 - dup
 - dup2
 - dup3
 - prlimit64
 - eventfd
 - eventfd2
 - bind
 - accept
 - accept4

Updates #4805

PiperOrigin-RevId: 489526376
2022-11-18 11:48:42 -08:00
Rahat MahmoodandgVisor bot c026c3c681 Disable S/R while rapidly polling control files in cgroups tests.
This resulted in too many S/Rs and prevents tasks from being scheduled
and accumulating CPU time.

PiperOrigin-RevId: 488748888
2022-11-15 13:51:45 -08:00
Ayush RanjanandgVisor bot 4e0477f352 Remove testing for 9P.
LISAFS is now default.
Updates #7911

PiperOrigin-RevId: 488442569
2022-11-14 12:48:20 -08:00
Sergey MadaminovandgVisor bot 7be97e8499 io_uring_enter: adding support for READV operation.
Handling NOP operations helped us to introduce facilities to process submission
requests. Now we can proceed to adding more meaningful operations. The logical
choice for the first one is the READV operation as it is a next operation after
NOP and it is also used for the cat-like application example based of IO_URING.

PiperOrigin-RevId: 487615618
2022-11-10 12:54:50 -08:00
Rahat MahmoodandgVisor bot 59209893ee iouring: Disallow zero, or less CQ entries than SQ entries
Reported-by: [email protected]
PiperOrigin-RevId: 485230763
2022-10-31 22:34:06 -07:00
Sergey MadaminovandgVisor bot 66309c0d80 io_uring_enter with NOP implementation for the IO_URING.
With io_uring_setup() and mmap() we can proceed with implementing a simplest
operation, namely, NOP. Once we make sure that we can send this command and
receive a response from the gVisor, we can move forward to read operation.

PiperOrigin-RevId: 485106019
2022-10-31 11:39:18 -07:00
Andrei VaginandgVisor bot 4a53d87377 Disable fasync for signalfd descriptors
In Linux, signalfd doesn't support fasync events.

Reported-by: [email protected]
PiperOrigin-RevId: 483861398
2022-10-25 21:46:13 -07:00
Lucas ManningandgVisor bot a2081cd848 Fix mount_util mountinfo parsing to account for multiple optional tags.
Before this change, the parsing fails with a PosixError saying the line
has too many entries.

PiperOrigin-RevId: 483777338
2022-10-25 14:33:15 -07:00
Derek MauroandgVisor bot 7480d7b79f Internal change.
PiperOrigin-RevId: 481202690
2022-10-14 12:11:32 -07:00
Jamie LiuandgVisor bot 2a3fb74ffe Fix flakes in tests that use munmap() to create deliberate MM holes.
PiperOrigin-RevId: 479623755
2022-10-07 11:09:09 -07:00
Sergey MadaminovandgVisor bot 485b68eb69 mmap() implementation for the IO_URING.
Once the user receives a file descriptor from `io_uring_setup()`, it will be
used for the subsequent `mmap()` calls. Thus, we need to add support for it in
our iouringfs.

PiperOrigin-RevId: 477318038
2022-09-27 17:44:25 -07:00
Sergey MadaminovandgVisor bot 50a8b30992 Pseudo-filesystem iouringfs for IO_URING.
Similar to Linux, we should add pseudo-filesystem iouringfs in gVisor to back
IO_URING's file descriptors. We start with stubbing `io_uring_setup(2)` so it
provides a file descriptor backed by anonfs.

PiperOrigin-RevId: 473384042
2022-09-09 18:09:29 -07:00
Alex KonradiandgVisor bot 8de434eb60 Internal change.
PiperOrigin-RevId: 470742476
2022-08-29 09:45:52 -07:00
Nicolas LacasseandgVisor bot ab8b222f96 Delete verityfs.
PiperOrigin-RevId: 454300799
2022-06-10 22:18:49 -07:00
Etienne PerotandgVisor bot 6401a42b4b Add VSYSCALL capability to platforms definitions.
This can be used to selectively disable tests where vsyscall
functionality is not expected to work on a per-platform basis.

PiperOrigin-RevId: 454250385
2022-06-10 15:11:11 -07:00
Etienne PerotandgVisor bot cd32bef37d Export GVISOR_PLATFORM_SUPPORT environment variable for tests.
This environment variable encodes what capabilities the platform
supports, and is consumed by `platform_util.cc` to determine
which syscall tests are appropriate to run.

PiperOrigin-RevId: 452870567
2022-06-03 17:04:01 -07:00
Arthur SfezandgVisor bot 02aba2b7e4 Allow martian packets on packet socket dgram tests
Before this change, this test fixture expected it to be enabled already
instead of updating the config.

The Teardown method also restore the initial configuration, so that
these tests do not permanently change the config of the machines that
run the tests.

PiperOrigin-RevId: 447814273
2022-05-10 13:38:26 -07:00
Rahat MahmoodandgVisor bot be6839c8af cgroupfs: Fix test race with task exit.
The PID controller isn't uncharged synchronously with task exit. The
test checks the PID is released after thread join, which races with
the task being reaped.

PiperOrigin-RevId: 444960688
2022-04-27 14:06:51 -07:00
Jamie LiuandgVisor bot 6c2b33e994 Automated rollback of changelist 443736918
PiperOrigin-RevId: 444415265
2022-04-25 17:38:38 -07:00
gVisor bot 53e3b94d65 Internal change.
PiperOrigin-RevId: 443736918
2022-04-22 12:56:48 -07:00
Shambhavi SrivastavaandgVisor bot 7146743791 Created tests for mounting tmpfs with size option enabled.
Tests include:
Allocating memory below and above range for single file.
Allocating memory above range for multiple file.

PiperOrigin-RevId: 438918539
2022-04-01 15:01:53 -07:00
Rahat MahmoodandgVisor bot bbd229dad7 cgroupfs: Directories should support setstat.
PiperOrigin-RevId: 438688088
2022-03-31 16:30:51 -07:00
Rahat MahmoodandgVisor bot 0d9bfe7669 cgroupfs: Return the correct cgroup path for tasks from procfs.
Previously we were returning the path to the control file used to
migrate a task, rather than the path to the cgroup directory.

PiperOrigin-RevId: 438676422
2022-03-31 15:33:04 -07:00
Rahat MahmoodandgVisor bot f4e68fa304 cgroupfs: Implement hierarchical accounting for cpuacct controller.
PiperOrigin-RevId: 438193226
2022-03-29 20:02:09 -07:00
gVisor bot b9b829a954 Internal change.
PiperOrigin-RevId: 437963000
2022-03-29 01:34:25 -07:00
Rahat MahmoodandgVisor bot cc99b36556 kernfs: Handle duplicate unlink on orphaned directories.
Also don't print kernfs inode internals on panic, when we can't
acquire the necessary locks.

Reported-by: [email protected]
Reported-by: [email protected]
PiperOrigin-RevId: 436869482
2022-03-23 17:26:14 -07:00
Ayush RanjanandgVisor bot 042dac5db2 Enable all tests for lisafs.
- Generates a lisafs variant of all syscall tests.
- Adds Makefile targets to run runtime tests with lisafs. We run runtime tests
  continuously (on every commit to master) and on presubmits iff the commit
  message contains "lisafs".
- Updates the docker tests target to run the integration tests with lisafs too.

Fixes #5466

PiperOrigin-RevId: 433782954
2022-03-10 10:09:05 -08:00
Rahat MahmoodandgVisor bot cba44f0e4f cgroupfs: Implement task migration
PiperOrigin-RevId: 430273113
2022-02-22 12:43:54 -08:00
Ayush RanjanandgVisor bot f6263c38df Remove VFS1 special handling in tests.
Also clean up usage of GVISOR_VFS environment variable.
Updates #1624

PiperOrigin-RevId: 429100450
2022-02-16 11:41:51 -08:00
Fabricio VoznikaandgVisor bot 0b5ead0aa1 Allow SetAttr and Allocate for deleted files
It's safe to call SetAttr and Allocate on fsgofer because the
file path is not used to open the file, if needed.

Fixes #3654

PiperOrigin-RevId: 407149393
2021-11-02 12:29:06 -07:00