Commit Graph

1089 Commits

Author SHA1 Message Date
Zach Koopmans c3fc69022a Fix Nginx Startup and Size Benchmarks.
Changes in Nginx Benchmarks in network_tests also affect Startup/Size
Nginx Benchmarks. Make sure the commands line up.

PiperOrigin-RevId: 333543697
2020-09-24 10:32:01 -07:00
Bhasker Hariharan 5d50c91c4d Change segment/pending queue to use receive buffer limits.
segment_queue today has its own standalone limit of MaxUnprocessedSegments but
this can be a problem in UnlockUser() we do not release the lock till there are
segments to be processed. What can happen is as handleSegments dequeues packets
more keep getting queued and we will never release the lock. This can keep
happening even if the receive buffer is full because nothing can read() till we
release the lock.

Further having a separate limit for pending segments makes it harder to track
memory usage etc. Unifying the limits makes it easier to reason about memory in
use and makes the overall buffer behaviour more consistent.

PiperOrigin-RevId: 333508122
2020-09-24 07:15:06 -07:00
Andrei Vagin 0a232a5e8c test/syscall/mknod: Don't use a hard-coded file name
PiperOrigin-RevId: 333461380
2020-09-24 00:48:35 -07:00
Dean Deng 03898a087d Clean up inotify tests.
Mostly simplifies SKIP_IF statements and adds some more documentation.
Also, mknod is now supported by gofer fs, so remove SKIP_IFs related to this.

PiperOrigin-RevId: 333449932
2020-09-23 23:02:04 -07:00
Ayush Ranjan fc1bf0d756 Remove unused scripts.
PiperOrigin-RevId: 333408633
2020-09-23 17:38:02 -07:00
Zeling Feng c3c66ea428 Clean up flag.* usage in packetimpact's runner.RegisterFlags
PiperOrigin-RevId: 333400865
2020-09-23 16:51:34 -07:00
Ghanan Gowripalan 059d90b9f1 Receive ACK when deleting address in syscall tests
PiperOrigin-RevId: 332961666
2020-09-21 16:34:44 -07:00
Zach Koopmans 06dbd5b7bc Fix socket_ipv4_udp_unbound_test_native in opensource.
Calls to recv sometimes fail with EAGAIN, so call select beforehand.

PiperOrigin-RevId: 332943156
2020-09-21 15:06:05 -07:00
Zach Koopmans a129204cf5 Fix proc_net_test_native for native tests.
"DefaultValueEqZero" is only valid if the test is in a
sandbox. Our CI VMs often have "/proc/sys/net/ipv4/ip_forward" set
to 1.

PiperOrigin-RevId: 332910859
2020-09-21 12:46:21 -07:00
Dean Deng d72022373f Add ftruncate test for writeable fd but no write permissions.
PiperOrigin-RevId: 332907453
2020-09-21 12:30:53 -07:00
Zach Koopmans 5ce5882951 Fix flakes in UdpSocketTest
`recv` calls with MSG_DONTWAIT can fail with EAGAIN randomly
in tests. Fix this by calling `select` on sockets with a timeout
prior to attempting a `recv`.

PiperOrigin-RevId: 332873735
2020-09-21 10:05:45 -07:00
gVisor bot ca30874720 Merge pull request #3651 from ianlewis:ip-forwarding
PiperOrigin-RevId: 332760843
2020-09-20 18:17:20 -07:00
Jamie Liu 916751039c Disable vdso_clock_gettime on KVM.
Unfortunately, I think TSC misalignment means that we can't really expect any
consistent correspondence between a TSC-based VDSO and the sentry's view of
time on the KVM platform.

PiperOrigin-RevId: 332576147
2020-09-18 20:53:55 -07:00
Nicolas Lacasse 6c9989cb8c Deflake stat_test with save/restore enabled.
PiperOrigin-RevId: 332546659
2020-09-18 16:13:07 -07:00
Jamie Liu c23e39f419 Implement fsimpl/overlay.filesystem.RenameAt.
Updates #1199

PiperOrigin-RevId: 332539197
2020-09-18 15:29:26 -07:00
Jamie Liu b8ba0893ec Disable PHP test ext/standard/tests/streams/proc_open_bug60120.phpt.
PiperOrigin-RevId: 332521647
2020-09-18 14:00:19 -07:00
Jamie Liu ca4ecf481d Use a tmpfs file for shared anonymous and /dev/zero mmap on VFS2.
This is more consistent with Linux (see comment on MM.NewSharedAnonMappable()).
We don't do the same thing on VFS1 for reasons documented by the updated
comment.

PiperOrigin-RevId: 332514849
2020-09-18 13:25:35 -07:00
Kevin Krakauer f911b43f05 Remove SKIP_IF for now-supported features.
Updates #3549.

PiperOrigin-RevId: 332501660
2020-09-18 12:20:36 -07:00
Mithun Iyer fcf8d7c6dd Enqueue TCP sends arriving in SYN_SENT state.
TCP needs to enqueue any send requests arriving when the connection is in
SYN_SENT state. The data should be sent out soon after completion of the
connection handshake.

Fixes #3995

PiperOrigin-RevId: 332482041
2020-09-18 10:49:21 -07:00
Kevin Krakauer 0b8d306e64 ip6tables: filter table support
`ip6tables -t filter` is now usable. NAT support will come in a future CL.

#3549

PiperOrigin-RevId: 332381801
2020-09-17 21:54:48 -07:00
Nayana Bidari d34bda0273 {Set,Get} SO_LINGER on all endpoints.
SO_LINGER is a socket level option and should be stored on all endpoints even
though it is used to linger only for TCP endpoints.

PiperOrigin-RevId: 332369252
2020-09-17 20:00:33 -07:00
Ayush Ranjan 23fcbd8722 [testing] Use container address to talk to server running inside container.
Docker does not have IPv6 port forwarding as tracked by the following issue:
https://github.com/moby/moby/issues/11518

So when running bazel itself inside a docker container, we can not use the host
port bindings to communicate with sockets inside the container. This was causing
integration tests and image tests to fail when run through our Makefile targets.

PiperOrigin-RevId: 332355051
2020-09-17 17:58:08 -07:00
Dean Deng 319d1b8ba0 Complete vfs2 implementation of fallocate.
This change includes overlay, special regular gofer files, and hostfs.

Fixes #3589.

PiperOrigin-RevId: 332330860
2020-09-17 15:38:44 -07:00
gVisor bot 8070cc3386 Merge pull request #3979 from jinmouil:feature/fuse-fix
PiperOrigin-RevId: 332328860
2020-09-17 15:28:36 -07:00
Jinmou Li 15f50c8da6 Fix kernfs unlinkat and rmdirat incorrect resolved path name 2020-09-17 21:07:12 +00:00
Jamie Liu f0b1bd434e Deflake vdso_clock_gettime test.
PiperOrigin-RevId: 332281930
2020-09-17 11:59:55 -07:00
Jamie Liu 51a2fe8eb4 Disable nodejs12.4 test async-hooks/test-statwatcher.
PiperOrigin-RevId: 332281912
2020-09-17 11:53:10 -07:00
gVisor bot ae59e52979 Merge pull request #3934 from avagin:feature/fuse
PiperOrigin-RevId: 332122081
2020-09-16 17:12:57 -07:00
Zeling Feng 64aae6bbd6 Cleanup device name confusion in packetimpact testbench
There are two device names on the test net.
- The sniffer/injector device which is always a linux device. Only the
testbench library is interested in this device.
- The device which is on the DUT. It happens to be the same device as
the former if DUT is linux. An individual test might be interested in
this device if the test cares about the device name.

PiperOrigin-RevId: 332112968
2020-09-16 16:26:10 -07:00
Nayana Bidari b6d165fe98 Automated rollback of changelist 329526153
PiperOrigin-RevId: 332097286
2020-09-16 15:06:55 -07:00
Ayush Ranjan 0356c7ef32 [runtime tests] Add documentation.
Added a README describing what these tests are, how they work and how to run
them locally. Also reorganized the exclude files into a directory.

PiperOrigin-RevId: 332079697
2020-09-16 13:48:26 -07:00
Jinmou Li 26879c32b8 FUSE readdir test fix ino initialization 2020-09-16 12:22:17 -07:00
Andrei Vagin 5bf05ad3ce test/fuse: use the getdents syscall instead of opendir/readdir
opendir() is a libc wrapper. Different libc-s can implement it
differently.
2020-09-16 12:22:17 -07:00
Andrei Vagin 99fca1bf9a test/fuse: clean up 2020-09-16 12:22:17 -07:00
Andrei Vagin 92a020c798 fuse: fix a compile time error
readdir_test.cc:134:24: error: variable length arrays are a C99 feature [-Werror,-Wvla-extension]
  char readdir_payload[readdir_payload_size];
2020-09-16 12:22:17 -07:00
Andrei Vagin f148242aba Revert "fuse: add benchmarking support for FUSE"
test/fuse/benchmark/read_benchmark.cc:34: Failure
Expected: (fuse_prefix) != (nullptr), actual: NULL vs (nullptr)
external/com_google_benchmark/src/benchmark_runner.cc:120: RunInThread:
Check `st.iterations() >= st.max_iterations' failed. Benchmark returned
before State::KeepRunning() returned false!
--- FAIL: Benchmarks_BM_Read/262144/real_time (0.29s)
    runner.go:502: test "Benchmarks.BM_Read/262144/real_time" failed
    with error exit status 134, want nil
FAIL
2020-09-16 12:22:17 -07:00
Ghanan Gowripalan 87c5c0ad25 Receive broadcast packets on interested endpoints
When a broadcast packet is received by the stack, the packet should be
delivered to each endpoint that may be interested in the packet. This
includes all any address and specified broadcast address listeners.

Test: integration_test.TestReuseAddrAndBroadcast
PiperOrigin-RevId: 332060652
2020-09-16 12:20:45 -07:00
Boyuan He 2051260e82 Implement FUSE_UNLINK
Fixes #3696
2020-09-16 12:19:30 -07:00
Craig Chi bf8efe8cdf Implement FUSE_SETATTR
This commit implements FUSE_SETATTR command. When a system call modifies
the metadata of a regular file or a folder by chown(2), chmod(2),
truncate(2), utime(2), or utimes(2), they should be translated to
corresponding FUSE_SETATTR command and sent to the FUSE server.

Fixes #3332
2020-09-16 12:19:30 -07:00
Craig Chi 4181e8c974 Add fh support for revise attr and fstat(2) test
According to Linux 4.4's FUSE behavior, the flags and fh attributes in
FUSE_GETATTR are only used in read, write, and lseek. fstat(2) doesn't
use them either. Add tests to ensure the requests sent from FUSE module
are consistent with Linux's.

Updates #3655
2020-09-16 12:19:30 -07:00
Craig Chi 1146ab6bac Add fuse_fd_util library to include common fuse fd test functions 2020-09-16 12:19:30 -07:00
Craig Chi e63abd82dd Add default attr in fuse_util
fuse_util provides utilities for fuse testing. Add a function to return
a stub fuse_attr struct with specified mode and nodeid.
2020-09-16 12:19:30 -07:00
Jinmou Li 98faed55e6 Implement FUSE_WRITE
This commit adds basic write(2) support for FUSE.
2020-09-16 12:19:30 -07:00
Craig Chi 18f1e1c91b Implement FUSE_CREATE
FUSE_CREATE is called when issuing creat(2) or open(2) with O_CREAT. It
creates a new file on the FUSE filesystem.

Fixes #3825
2020-09-16 12:19:30 -07:00
Boyuan He & Ridwan Sharif cb9a2a1ad4 fuse: add benchmarking support for FUSE
This change adds the following:
-  Add support for containerizing syscall tests for FUSE
-  Mount tmpfs in the container so we can run benchmarks against it
-  Run the server in a background process
-  benchmarks for fuse syscall

Co-authored-by: Ridwan Sharif <ridwanmsharif@google.com>
2020-09-16 12:19:30 -07:00
Ridwan Sharif 4a5857d644 fuse: Implement IterDirents for directory file description
Fixes #3255.

This change adds support for IterDirents. You can now use `ls` in
the FUSE sandbox.

Co-authored-by: Craig Chi <craigchi@google.com>
2020-09-16 12:19:30 -07:00
Ridwan Sharif bc07df8887 Implement FUSE_RMDIR
Fixes #3587

Co-authored-by: Craig Chi <craigchi@google.com>
2020-09-16 12:19:30 -07:00
Jinmou Li 713400d6b0 Implement FUSE_READ
Fixes #3206
2020-09-16 12:19:30 -07:00
Boyuan He 4d26c9929d Implement FUSE_MKDIR
Fixes #3392
2020-09-16 12:19:30 -07:00
Boyuan He 733d013f97 Implement FUSE_READLINK
Fixes #3316
2020-09-16 12:19:30 -07:00