Commit Graph

3694 Commits

Author SHA1 Message Date
Ting-Yu Wang 5593320bee Update README on cross-building images.
PiperOrigin-RevId: 321887956
2020-07-17 17:44:53 -07:00
Ayush Ranjan 40acd22bc8 Runtime tests are enormous
PiperOrigin-RevId: 321885126
2020-07-17 17:19:34 -07:00
Zach Koopmans e3c2bd51a1 Move main methods for benchmark packages main package file.
PiperOrigin-RevId: 321875119
2020-07-17 16:23:10 -07:00
Ayush Ranjan 03c30ec634 Runtime tests: Download language runtime image
PiperOrigin-RevId: 321839398
2020-07-17 13:07:55 -07:00
Jay Zhuang 40826b0557 DUT logs in test failure messages in packetimpact
DUT logs will include logs from the posix server and gVisor, which
provides a way to instrument the DUT during test failures.

PiperOrigin-RevId: 321816647
2020-07-17 11:18:40 -07:00
Ayush Ranjan c0ee95198a Automated rollback of changelist 321647645
PiperOrigin-RevId: 321808673
2020-07-17 10:45:25 -07:00
Jay Zhuang 7e226c8076 Test UDP packets with mcast source addr are discarded
PiperOrigin-RevId: 321790802
2020-07-17 09:14:17 -07:00
Bhasker Hariharan dcf6ddc277 Add support to return protocol in recvmsg for AF_PACKET.
Updates #173

PiperOrigin-RevId: 321690756
2020-07-16 18:40:32 -07:00
Ayush Ranjan e6894cb99f Port runtime tests to use go_test
PiperOrigin-RevId: 321647645
2020-07-16 14:37:13 -07:00
Ghanan Gowripalan c66991ad7d Add ethernet broadcast address constant
PiperOrigin-RevId: 321620517
2020-07-16 12:26:41 -07:00
gVisor bot 0a745cb343 Merge pull request #3236 from craig08:fuse-kernfs-inode-stat-add-ctx
PiperOrigin-RevId: 321496734
2020-07-15 21:22:44 -07:00
Zach Koopmans 5c8c0d65b9 Port httpd benchmark
PiperOrigin-RevId: 321478001
2020-07-15 18:21:51 -07:00
Kevin Krakauer e92f38ff0c iptables: remove check for NetworkHeader
This is no longer necessary, as we always set NetworkHeader before calling
iptables.Check.

PiperOrigin-RevId: 321461978
2020-07-15 16:35:59 -07:00
gVisor bot bdbab2702a Merge pull request #3022 from prattmic:runsc_do_pdeathsig
PiperOrigin-RevId: 321449877
2020-07-15 15:21:32 -07:00
Ting-Yu Wang db653bb34b fdbased: Vectorized write for packet; relax writev syscall filter.
Now it calls pkt.Data.ToView() when writing the packet. This may require
copying when the packet is large, which puts the worse case in an even worse
situation.

This sent out in a separate preparation change as it requires syscall filter
changes. This change will be followed by the change for the adoption of the new
PacketHeader API.

PiperOrigin-RevId: 321447003
2020-07-15 15:05:32 -07:00
Bhasker Hariharan 857d03f258 Add support for SO_ERROR to packet sockets.
Packet sockets also seem to allow double binding and do not return an error on
linux. This was tested by running the syscall test in a linux namespace as root
and the current test DoubleBind fails@HEAD.

Passes after this change.

Updates #173

PiperOrigin-RevId: 321445137
2020-07-15 14:56:39 -07:00
Bhasker Hariharan fef90c61c6 Fix minor bugs in a couple of interface IOCTLs.
gVisor incorrectly returns the wrong ARP type for SIOGIFHWADDR. This breaks
tcpdump as it tries to interpret the packets incorrectly.

Similarly, SIOCETHTOOL is used by tcpdump to query interface properties which
fails with an EINVAL since we don't implement it. For now change it to return
EOPNOTSUPP to indicate that we don't support the query rather than return
EINVAL.

NOTE: ARPHRD types for link endpoints are distinct from NIC capabilities
and NIC flags. In Linux all 3 exist eg. ARPHRD types are stored in dev->type
field while NIC capabilities are more like the device features which can be
queried using SIOCETHTOOL but not modified and NIC Flags are fields that can
be modified from user space. eg. NIC status (UP/DOWN/MULTICAST/BROADCAST) etc.

Updates #2746

PiperOrigin-RevId: 321436525
2020-07-15 14:15:44 -07:00
Ting-Yu Wang 1d11c40378 Fix errors not getting caught when building vm image.
`set -e` does not catch errors in bash command substituions like
`echo $(bad cmd)` so bazel thinks it succeeded and cached the result.

PiperOrigin-RevId: 321412327
2020-07-15 12:20:23 -07:00
Michael Pratt 1481673178 Apply pdeathsig to gofer for runsc run/do
Much like the boot process, apply pdeathsig to the gofer for cases where
the sandbox lifecycle is attached to the parent (runsc run/do).

This isn't strictly necessary, as the gofer normally exits once the
sentry disappears, but this makes that extra reliable.
2020-07-15 15:15:11 -04:00
gVisor bot 8939fae0af Merge pull request #3165 from ridwanmsharif:ridwanmsharif/fuse-off-by-default
PiperOrigin-RevId: 321411758
2020-07-15 12:14:42 -07:00
gVisor bot fc48ace73a Merge pull request #3242 from btw616:fix/issue-3241
PiperOrigin-RevId: 321403149
2020-07-15 11:34:07 -07:00
Tiwei Bie 505bebae43 hostinet: fix fd leak in fdnotifier for VFS2
When we failed to create the new socket after adding the fd to
fdnotifier, we should remove the fd from fdnotifier, because we
are going to close the fd directly.

Fixes: #3241

Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
2020-07-15 22:20:02 +08:00
Dean Deng 1b9965e06a Update special file option name in comment.
PiperOrigin-RevId: 321269281
2020-07-14 17:31:48 -07:00
Craig Chi 8494a0325d Include context in kernfs.Inode.Stat method
To implement stat(2) in FUSE, we have to embed credentials and pid in request
header. The information should be extracted from the context passed to VFS
layer. Therefore `Stat()` signature in `kernfs.Inode` interface should include
context as first argument. Some other fs implementations need to be modified as
well, such as devpts, host, pipefs, and proc.

Fixes #3235
2020-07-14 15:56:41 -07:00
Kevin Krakauer 8a0082f5f3 remove IPv6 docker
Will re-submit when ICMP dest unreachable is handled correctly and it can be
turned back on.

PiperOrigin-RevId: 321227330
2020-07-14 13:49:15 -07:00
Zeling Feng 221e1da947 Test IPv6 fragment reassembly
A packetimpact test for: "A node must be able to accept a fragmented packet
that, after reassembly, is as large as 1500 octets."

PiperOrigin-RevId: 321210729
2020-07-14 12:29:34 -07:00
Fabricio Voznika 1bfb556ccd Prepare boot.Loader to support multi-container TTY
- Combine process creation code that is shared between
  root and subcontainer processes
- Move root container information into a struct for
  clarity

Updates #2714

PiperOrigin-RevId: 321204798
2020-07-14 12:02:03 -07:00
Jay Zhuang 822fc99ecd Add support for UDP IPv6
Also ironed out all the bugs found on the IPv6 code path that affects socket
bind, send and receive.

PiperOrigin-RevId: 321202653
2020-07-14 11:49:51 -07:00
Ting-Yu Wang 87c33be9af Enable experimental features in docker.
PiperOrigin-RevId: 321062975
2020-07-13 17:02:32 -07:00
gVisor bot c5d827d110 Merge pull request #3200 from lubinszARM:pr_kvm_ut_1
PiperOrigin-RevId: 321060717
2020-07-13 16:49:20 -07:00
gVisor bot c81ac8ec3b Merge pull request #2672 from amscanne:shim-integrated
PiperOrigin-RevId: 321053634
2020-07-13 16:10:58 -07:00
Fabricio Voznika 59a5479409 Disable debug time adjustment logging
When --debug is enabled, the following log messages are
printed every second filling up the log:

D0430 18:04:42.823775  129561 parameters.go:238] Clock(Monotonic): error: 46 ns, adjusted frequency from 3591713733 Hz to 3591714196 Hz
D0430 18:04:42.823870  129561 parameters.go:238] Clock(Realtime): error: 36 ns, adjusted frequency from 3591714003 Hz to 3591714169 Hz
D0430 18:04:42.823892  129561 timekeeper.go:209] Updating VDSO parameters: {monotonicReady:1 monotonicBaseCycles:15758797714254696 monotonicBaseRef:29000233837 monotonicFrequency:3591714196 realtimeReady:1 realtimeBaseCycles:15758797714610880 realtimeBaseRef:1588269882823867374 realtimeFrequency:3591714169}

Info and warning messages for larger changes are kept the same.

PiperOrigin-RevId: 321048523
2020-07-13 15:42:53 -07:00
Ian Lewis 74df310ac0 Don't run issue reviver on forks.
Add a conditional to avoid running the issue reviver on forks. It will
always cause errors since bug references in the source code don't match
issue IDs in forked repos.

PiperOrigin-RevId: 321042060
2020-07-13 15:07:00 -07:00
Ting-Yu Wang a287309d9f Fix recvMMsgDispatcher not slicing link header correctly.
PiperOrigin-RevId: 321035635
2020-07-13 14:36:38 -07:00
Ayush Ranjan 28c635e5d4 Fix runtime test target
PiperOrigin-RevId: 321029113
2020-07-13 14:07:41 -07:00
Dean Deng cf0826653c Clean up inotify comments.
PiperOrigin-RevId: 321028238
2020-07-13 14:02:07 -07:00
Kevin Krakauer 3fe9be138c iptables: remove useless ip6tables VM rules
This rule isn't restored when the Kokoro VM is restarted, so it's not doing
anything. And the problem it was meant to solved is instead addressed by
https://github.com/google/gvisor/pull/3207.

PiperOrigin-RevId: 321026846
2020-07-13 13:54:54 -07:00
Ayush Ranjan 6994f4d591 [vfs2] Make gofer metadata atomics consistent
For accessing metadata fields:
- If metadataMu is locked, we can access without atomics
- If metadataMu is unlocked, we should use atomics

For mutating metadata fields:
- Always lock metadataMu and use atomics.

There were some instances of inconsistencies which have been fixed.

PiperOrigin-RevId: 321022895
2020-07-13 13:35:32 -07:00
Zach Koopmans b8d3d09bd1 Initial golang Benchmarks
PiperOrigin-RevId: 321021071
2020-07-13 13:29:30 -07:00
gVisor bot 505b4f5e5f Merge pull request #3136 from lubinszARM:pr_sys64_1
PiperOrigin-RevId: 321020733
2020-07-13 13:24:01 -07:00
Fabricio Voznika b7e8ce93de Add ReadAllFd to test util
PiperOrigin-RevId: 321008185
2020-07-13 12:23:18 -07:00
Kevin Krakauer 43c209f48e garbage collect connections
As in Linux, we must periodically clean up unused connections.

PiperOrigin-RevId: 321003353
2020-07-13 12:00:46 -07:00
Jay Zhuang 76b392bc26 Create packetimpact test for UDP broadcast
PiperOrigin-RevId: 321000340
2020-07-13 11:49:06 -07:00
Adin Scannell 60dc5a4479 Automated rollback of changelist 320972241
PiperOrigin-RevId: 320999851
2020-07-13 11:43:28 -07:00
Jay Zhuang bafef1cf3a Print testbench log on packetimpact failures
These logs include flags passed to packetimpact tests (the Go tests), and test
failure messages.

PiperOrigin-RevId: 320989521
2020-07-13 10:58:21 -07:00
Adin Scannell 7ff4649b3c Use host networking for build container.
This will allow the use of default credentials.

PiperOrigin-RevId: 320972241
2020-07-13 09:39:06 -07:00
Ghanan Gowripalan 9c32fd3f4d Do not copy sleep.Waker
sleep.Waker's fields are modified as values.

PiperOrigin-RevId: 320873451
2020-07-12 17:22:08 -07:00
Ayush Ranjan 69f2059e5d Runtime test batch executor
Earlier we were docker exec-ing each test at a time. However invoking the test
framework has a fixed overhead which made it infeasible to make the runtime
tests run as presubmits. This change now executes tests in batches of 50 (can
be altered). This really speeds up testing process.

With this change, the following tests can be run in reasonable times:
- Go
- Nodejs
- Php
- Python

PiperOrigin-RevId: 320763916
2020-07-11 08:18:35 -07:00
Bhasker Hariharan 216dcebc06 Stub out SO_DETACH_FILTER.
Updates #2746

PiperOrigin-RevId: 320757963
2020-07-11 06:22:47 -07:00
Bin Lu feb867bb83 Split the kvm ut test cases to correspond to different platforms
Split the kvm ut test cases to pass unit-tests on Arm64.
    I will add the tls and full-context test cases for Arm64 later.

Signed-off-by: Bin Lu <bin.lu@arm.com>
2020-07-10 03:13:13 -04:00