summaryrefslogtreecommitdiffhomepage
path: root/test
AgeCommit message (Collapse)Author
2021-06-11Fix //test/syscalls:exec_test_nativeZach Koopmans
Later kernels add empty arguments to argv, throwing off return values for the exec_basic_workload.cc binary. This is result of a bug introduced by ccbb18b67323b "exec/binfmt_script: Don't modify bprm->buf and then return - ENOEXEC". Before this change, an empty interpreter string was reported if the first non-space/non-tab character after "#!" was '\0' (end of file, previously- overwritten trailing space or tab, or previously-overwritten first newline). After this change, an empty interpreter string is reported if all characters after "#!" are spaces or tabs, or the first non-space non-tab character is at i_end, which is the position of the first newline after "#!". However, if there is no newline after "#!" (as in ExecTest.InterpreterScriptNoPath), then i_end = buf_end (= bprm->buf + sizeof(bprm->buf) - 1, the last possible byte in the buffer) and neither condition holds. Change white space for script inputs to take into account the above bug. Co-authored-by: Andrei Vagin <avagin@gmail.com> PiperOrigin-RevId: 378997171
2021-06-11Temorary skip test cases that fail on LinuxAndrei Vagin
PiperOrigin-RevId: 378974239
2021-06-11[benchmarks] Fix redis benchmark.Zach Koopmans
Intermittenly, the connection between the client redis_benchmark container can be flaky with the server, even if the server has been up for a long time. If this happens, just re-run a client until we get a result. Also, don't start a new server for each operation. Also also, modify Makefile run-benchmark call to accept RUNTIME=runc correctly. PiperOrigin-RevId: 378918886
2021-06-10Try to avoid accept, incoming ACK raceMithun Iyer
This test checks if an incoming ACK is dropped by the listener when the accept queue is full. The ACK receive handling could race with the test invoking accept on the DUT, causing the test to be flaky. Add a wait time before invoking accept on the DUT to give cycles for the incoming ACK to be handled/dropped by the listener. PiperOrigin-RevId: 378770225
2021-06-10Disable all tests dependent on cloud_gvisor::testing::FuseTest.Jamie Liu
PiperOrigin-RevId: 378753134
2021-06-10Add /proc/sys/vm/max_map_countFabricio Voznika
Set it to int32 max because gVisor doesn't have a limit. Fixes #2337 PiperOrigin-RevId: 378722230
2021-06-10Merge pull request #6103 from sudo-sturbia:semaphore-errgVisor bot
PiperOrigin-RevId: 378607458
2021-06-09Rename go files that contain "main" function to main.go.Nicolas Lacasse
This is a good Go convention that we should follow. PiperOrigin-RevId: 378538679
2021-06-09Remove unnecessary TODO bug.Nicolas Lacasse
The bug id was not adding anything relevant here PiperOrigin-RevId: 378485983
2021-06-07test: use std::vector instead of allocating memory with callocAndrei Vagin
A memory that is allocated with calloc has to be freed. PiperOrigin-RevId: 378001409
2021-06-07Implement RENAME_NOREPLACE for all VFS2 filesystem implementations.Jamie Liu
PiperOrigin-RevId: 377966969
2021-06-04Honor data and FIN from the ACK completing handshakeMithun Iyer
If the ACK completing the handshake has FIN or data, requeue the segment for further processing by the newly established endpoint. Otherwise, the segments would have to be retransmitted by the peer to be processed by the established endpoint. Doing this, keeps the behavior in parity with Linux. This also addresses a test flake with TCPNonBlockingConnectClose where the ACK (completing the handshake) and multiple retransmitted FINACKs from the peer could be dropped by the listener, when using syncookies and the accept queue is full. The handshake could eventually get completed with a retransmitted FINACK, without actual processing of FIN. This can cause the poll with POLLRDHUP on the accepted socket to sometimes time out before the next FINACK retransmission. PiperOrigin-RevId: 377651695
2021-06-04Forward verbose flag to packetimpact testerSam Balana
Forwards the testing verbose flag to the packetimpact test runner. This is necessary for debugging inside packetimpact tests. When this flag is present, all t.Logs in the packetimpact test wil be shown in the resulting test output. PiperOrigin-RevId: 377614550
2021-06-04Allow sniffer receive timeout durations less than one usecSam Balana
Fixes the erronously signaled fatal error when the sniffer receive timeout duration is less than one usec. This was caused by the converstion from float64 to int64; the integer conversion truncated the floating point to 0, which signaled the fatal error. PiperOrigin-RevId: 377600179
2021-06-04Add bind syscall tests for ICMP and ICMPv6Sam Balana
Updates #5711 Updates #6021 Updates #6022 PiperOrigin-RevId: 377582446
2021-06-03Reset global_num_signals_received on RegisterSignalHandlerAdam Barth
Previously, the value of global_num_signals_received would persist between tests. Now, we reset the value to zero when we register a signal handler. PiperOrigin-RevId: 377308357
2021-06-01Ensure full shutdown of endpoint on notifyCloseMithun Iyer
Address a race with non-blocking connect and socket close, causing the FIN (because of socket close) to not be sent out, even after completing the handshake. The race occurs with this sequence: (1) endpoint Connect starts handshake, sending out SYN (2) handshake complete() releases endpoint lock, waiting on sleeper.Fetch() (3) endpoint Close acquires endpoint lock, does not enqueue FIN (as the endpoint is not yet connected) and asserts notifyClose (4) SYNACK from peer gets enqueued asserting newSegmentWaker (5) handshake complete() re-aqcuires lock, first processes newSegmentWaker event, transitions to ESTABLISHED and proceeds to protocolMainLoop() (6) protocolMainLoop() exits while processing notifyClose When the execution follows the above sequence, no FIN is sent to the peer. This causes the listener side to have a half-open connection sitting in the accept queue. Fix this by ensuring that the protocolMainLoop() performs clean shutdown when the endpoint state is still ESTABLISHED. This would not be a bug, if during handshake complete(), sleeper.Fetch() prioritized notificationWaker over newSegmentWaker. In that case, the handshake would not have completed in (5) above. Fixes #6067 PiperOrigin-RevId: 376994395
2021-06-01Test system-wide semaphore limits.Zyad A. Ali
2021-06-01Ignore RST received for a TCP listenerMithun Iyer
The current implementation has a bug where TCP listener does not ignore RSTs from the peer. While handling RST+ACK from the peer, this bug can complete handshakes that use syncookies. This results in half-open connection delivered to the accept queue. Fixes #6076 PiperOrigin-RevId: 376868749
2021-05-27Fix test_app task-treeFabricio Voznika
Executing `select {}` to wait forever triggers Go runtime deadlock detection and kills the child, causing the number actual processes be less than expected. PiperOrigin-RevId: 376298799
2021-05-27Support SO_BINDTODEVICE in ICMP socketsSam Balana
Adds support for the SO_BINDTODEVICE socket option in ICMP sockets with an accompanying packetimpact test to exercise use of this socket option. Adds a unit test to exercise the NIC selection logic introduced by this change. The remaining unit tests for ICMP sockets need to be added in a subsequent CL. See https://gvisor.dev/issues/5623 for the list of remaining unit tests. Adds a "timeout" field to PacketimpactTestInfo, necessary due to the long runtime of the newly added packetimpact test. Fixes #5678 Fixes #4896 Updates #5623 Updates #5681 Updates #5763 Updates #5956 Updates #5966 Updates #5967 PiperOrigin-RevId: 376271581
2021-05-27nanosleep has to store the finish time in the restart blockAndrei Vagin
nanosleep has to count time that a thread spent in the stopped state. PiperOrigin-RevId: 376258641
2021-05-26Specify subsequent layers as ICMP payloads and add ICMPv6.PointerSam Balana
Moves specification of subsequent layers to the Payload field of the ICMP and ICMPv6 layers. Removes the need to manually encode type-specific ICMP or ICMPv6 headers, such as the "pointer" header of parameter problem messages, in the payload. This is necessary prework to enable matching of more type-specific headers, such as "ident" of echo requests. Fixes a bug where the "reserved" header defined by ICMPv6 RFC 4443 was being incorrectly encoded by ToBytes. This change fixes the implementation by copying the payload into Payload, instead of the MessageBody. PiperOrigin-RevId: 376026420
2021-05-26Add verity getdents testsChong Cai
PiperOrigin-RevId: 376001603
2021-05-25Enable verity after mount in verity_mount testChong Cai
PiperOrigin-RevId: 375823719
2021-05-25setgid directories for VFS1 tmpfs, overlayfs, and goferfsKevin Krakauer
PiperOrigin-RevId: 375780659
2021-05-25Expect POLLRDHUP on FuchsiaTamir Duberstein
PiperOrigin-RevId: 375749377
2021-05-21Make many tests build with NDK.Adam Barth
Not all the tests build yet, but many of them do now. PiperOrigin-RevId: 375209824
2021-05-21Prevent infinite loops from being optimized away.gVisor bot
https://github.com/llvm/llvm-project/commit/6c3129549374c0e81e28fd0a21e96f8087b63a78 adds "mustprogress" to loops, which causes empty, side-effect free loops to be optimized away. These loops are intentionally infinite for purposes of testing, so add asm statements that prevent them from being removed. PiperOrigin-RevId: 375188453
2021-05-20Send SIGPIPE for closed pipes.Ian Lewis
Fixes #5974 Updates #161 PiperOrigin-RevId: 375024740
2021-05-20Add protocol state to TCPINFOMithun Iyer
Add missing protocol state to TCPINFO struct and update packetimpact. This re-arranges the TCP state definitions to align with Linux. Fixes #478 PiperOrigin-RevId: 374996751
2021-05-20Fix cgroupfs mount racing with unmount.Rahat Mahmood
Previously, mount could discover a hierarchy being destroyed concurrently, which resulted in mount attempting to take a ref on an already destroyed cgroupfs. Reported-by: syzbot+062c0a67798a200f23ee@syzkaller.appspotmail.com PiperOrigin-RevId: 374959054
2021-05-18Be explicit about setsid() return values in pty.ccKevin Krakauer
PiperOrigin-RevId: 374570219
2021-05-18Prevent infinite loops from being optimized away.gVisor bot
https://github.com/llvm/llvm-project/commit/6c3129549374c0e81e28fd0a21e96f8087b63a78 adds "mustprogress" to loops, which causes empty, side-effect free loops to be optimized away. These loops are intentionally infinite for purposes of testing, so add asm statements that prevent them from being removed. PiperOrigin-RevId: 374546142
2021-05-18Merge pull request #5908 from zhlhahaha:2157gVisor bot
PiperOrigin-RevId: 374517895
2021-05-17Reduce thread count in TCPResetDuringClose.Jamie Liu
This test suffers from extreme contention on tcpip/stack.AddressableEndpointState.mu via AddressableEndpointState.decAddressRef, at least when Go race detection is enabled. PiperOrigin-RevId: 374273745
2021-05-14Add hash15 label for tests.Andrei Vagin
PiperOrigin-RevId: 373875071
2021-05-14Resolve remaining O_PATH TODOs.Dean Deng
O_PATH is now implemented in vfs2. Fixes #2782. PiperOrigin-RevId: 373861410
2021-05-14Add verity_mmap testsChong Cai
PiperOrigin-RevId: 373854462
2021-05-14Fix cgroup hierarchy registration.Rahat Mahmood
Previously, registration was racy because we were publishing hierarchies in the registry without fully initializing the underlying filesystem. This led to concurrent mount(2)s discovering the partially intialized filesystems and dropping the final refs on them which cause them to be freed prematurely. Reported-by: syzbot+13f54e77bdf59f0171f0@syzkaller.appspotmail.com Reported-by: syzbot+2c7f0a9127ac6a84f17e@syzkaller.appspotmail.com PiperOrigin-RevId: 373824552
2021-05-13Apply SWS avoidance to ACKs with window updatesMithun Iyer
When recovering from a zero-receive-window situation, and asked to send out an ACK, ensure that we apply SWS avoidance in our window updates. Fixes #5984 PiperOrigin-RevId: 373689578
2021-05-11fix pty_test error by releasing tty received from testHoward Zhang
The test Truncate set ControllingTTY without releasing it on VFS2. This leads test ReleaseTTYSignals and ReleaseTTY fail when setting ControllingTTY. Skip the test on VFS1 and native, as setting Controlling TTY when open replica only happens on VFS2. Signed-off-by: Howard Zhang <howard.zhang@arm.com>
2021-05-06Implement /proc/cmdlineSteve Silva
This change implements /proc/cmdline with a basic faux command line "BOOT_IMAGE=/vmlinuz-[version]-gvisor quiet" so apps that may expect it do not receive errors. Also tests for the existence of /proc/cmdline as part of the system call test suite PiperOrigin-RevId: 372462070
2021-05-05Fixes to runsc cgroupsFabricio Voznika
When loading cgroups for another process, `/proc/self` was used in a few places, causing the end state to be a mix of the process and self. This is now fixes to always use the proper `/proc/[pid]` path. Added net_prio and net_cls to the list of optional controllers. This is to allow runsc to execute then these cgroups are disabled as long as there are no net_prio and net_cls limits that need to be applied. Deflake TestMultiContainerEvent. Closes #5875 Closes #5887 PiperOrigin-RevId: 372242687
2021-05-05Automated rollback of changelist 361661726Andrei Vagin
PiperOrigin-RevId: 372221411
2021-05-05Fix a race in reading last seen ICMP error during handshakeMithun Iyer
On receiving an ICMP error during handshake, the error is propagated by reading `endpoint.lastError`. This can race with the socket layer invoking getsockopt() with SO_ERROR where the same value is read and cleared, causing the handshake to bail out with a non-error state. Fix the race by checking for lastError state and failing the handshake with ErrConnectionAborted if the lastError was read and cleared by say SO_ERROR. The race mentioned in the bug, is caught only with the newly added tcp_test unit test, where we have control over stopping/resuming protocol loop. Adding a packetimpact test as well for sanity testing of ICMP error handling during handshake. Fixes #5922 PiperOrigin-RevId: 372135662
2021-05-04tcp_socket_test: replace tcp_wmem with SO_SNDBUFKevin Krakauer
PiperOrigin-RevId: 372022596
2021-05-04Increase error margin for memory accounting test.Dean Deng
PiperOrigin-RevId: 371963265
2021-05-03Temporarily disable atime/mtime check in utimensat test.Dean Deng
PiperOrigin-RevId: 371776583
2021-05-03Fix deadlock in /proc/[pid]/fd/[num]Fabricio Voznika
In order to resolve path names, fsSymlink.Readlink() may need to reenter kernfs. Change the code so that kernfs.Inode.Readlink() is called without locks and document the new contract. PiperOrigin-RevId: 371770222