summaryrefslogtreecommitdiffhomepage
path: root/test/util
AgeCommit message (Collapse)Author
2021-02-11Assign controlling terminal when tty is opened and support NOCTTYKevin Krakauer
PiperOrigin-RevId: 357015186
2021-01-29Remove side effect from test casesFabricio Voznika
Individual test cases must not rely on being executed in a clean environment. PiperOrigin-RevId: 354604389
2021-01-28Change EXPECT/ASSERT to TEST_CHECK inside InForkedProcessFabricio Voznika
PiperOrigin-RevId: 354441239
2021-01-28Add O_PATH support in vfs2gVisor bot
PiperOrigin-RevId: 354367665
2021-01-22Detect failures in forked functionFabricio Voznika
EXPECT*/ASSERT* functions are not async-signal-safe and should not be called from the function passed to InForkedProcess. However, these happen accidentally sometimes but do no cause InForkedProcess to fail. Detect and notify in such cases. PiperOrigin-RevId: 353354540
2020-11-09Skip `EventHUp` notify in `FIN_WAIT2` on a socket close.Mithun Iyer
This Notify was added as part of cl/279106406; but notifying `EventHUp` in `FIN_WAIT2` is incorrect, as we want to only notify later on `TIME_WAIT` or a reset. However, we do need to notify any blocked waiters of an activity on the endpoint with `EventIn`|`EventOut`. PiperOrigin-RevId: 341490913
2020-11-06Fix infinite loop when splicing to pipes/eventfds.Nicolas Lacasse
Writes to pipes of size < PIPE_BUF are guaranteed to be atomic, so writes larger than that will return EAGAIN if the pipe has capacity < PIPE_BUF. Writes to eventfds will return EAGAIN if the write would cause the eventfd value to go over the max. In both such cases, calling Ready() on the FD will return true (because it is possible to write), but specific kinds of writes will in fact return EAGAIN. This CL fixes an infinite loop in splice and sendfile (VFS1 and VFS2) by forcing skipping the readiness check for the outfile in send, splice, and tee. PiperOrigin-RevId: 341102260
2020-10-28Merge pull request #4543 from lubinszARM:pr_test_sigaltstackgVisor bot
PiperOrigin-RevId: 339459247
2020-10-23Support VFS2 save/restore.Jamie Liu
Inode number consistency checks are now skipped in save/restore tests for reasons described in greatest detail in StatTest.StateDoesntChangeAfterRename. They pass in VFS1 due to the bug described in new test case SimpleStatTest.DifferentFilesHaveDifferentDeviceInodeNumberPairs. Fixes #1663 PiperOrigin-RevId: 338776148
2020-10-22arm64 test: enabled Fault() functionBin Lu
Currently, this Fault() function does not work properly on the arm platform. After modification, sigaltstack_test_runsc_kvm can be passed on Arm64. Signed-off-by: Bin Lu <bin.lu@arm.com>
2020-10-16Use POSIX interval timers in flock test.Dean Deng
ualarm(2) is obsolete. Move IntervalTimer into a test util, where it can be used by flock tests. These tests were flaky with TSAN, probably because it slowed the tests down enough that the alarm was expiring before flock() was called. Use an interval timer so that even if we miss the first alarm (or more), flock() is still guaranteed to be interrupted. PiperOrigin-RevId: 337578751
2020-10-05Internal change.gVisor bot
PiperOrigin-RevId: 335429072
2020-09-16test/fuse: clean upAndrei Vagin
2020-09-16Add fh support for revise attr and fstat(2) testCraig Chi
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-16Add default attr in fuse_utilCraig Chi
fuse_util provides utilities for fuse testing. Add a function to return a stub fuse_attr struct with specified mode and nodeid.
2020-09-16Implement FUSE_OPEN/OPENDIRBoyuan He
Fixes #3174
2020-09-16Add function generating array of iovec with different FUSE structsCraig Chi
This commit adds a function in the newly created fuse_util library, which accepts a variable number of arguments and data structures. Fixes #3609
2020-09-10[vfs] Disable nlink tests for overlayfs.Ayush Ranjan
Overlayfs intentionally does not compute nlink for directories (because it can be really expensive). Linux returns 1, VFS2 returns 2 and VFS1 actually calculates the correct value. PiperOrigin-RevId: 330967139
2020-09-01Refactor tty codebase to use master-replica terminology.Ayush Ranjan
Updates #2972 PiperOrigin-RevId: 329584905
2020-08-31Remove __fuchsia__ definesTamir Duberstein
These mostly guard linux-only headers; check for linux instead. PiperOrigin-RevId: 329362762
2020-08-27Fix JobControl tests for open source.Zach Koopmans
ioctl calls with TIOCSCTTY fail if the calling process already has a controlling terminal, which occurs on a 5.4 kernel like our Ubuntu 18 CI. Thus, run tests calling ioctl TTOCSCTTY in clean subprocess. Also, while we're here, switch out non-inclusive master/slave for main/replica. PiperOrigin-RevId: 328756598
2020-08-26tmpfs: Allow xattrs in the trusted namespace if creds has CAP_SYS_ADMIN.Nicolas Lacasse
This is needed to support the overlay opaque attribute. PiperOrigin-RevId: 328552985
2020-07-15Merge pull request #3165 from ridwanmsharif:ridwanmsharif/fuse-off-by-defaultgVisor bot
PiperOrigin-RevId: 321411758
2020-07-13Add ReadAllFd to test utilFabricio Voznika
PiperOrigin-RevId: 321008185
2020-07-09Gate FUSE behind a runsc flagRidwan Sharif
This change gates all FUSE commands (by gating /dev/fuse) behind a runsc flag. In order to use FUSE commands, use the --fuse flag with the --vfs2 flag. Check if FUSE is enabled by running dmesg in the sandbox.
2020-07-07Deflake exec test.Jamie Liu
- Only use MAXSYMLINKS/2+1 symlinks for each of the interpreter and script paths in SymlinkLimitRefreshedForInterpreter to tolerate cases where the original paths (/tmp, /bin, or /bin/echo) themselves contain symlinks. - Ensure that UnshareFiles performs execve immediately after clone(CLONE_VFORK) (no heap allocation for ExecveArray/RunfilesPath). - Use lstat() rather than stat() for the existence check in fs_util's Exists; the latter will fail if the symlink target does not exist, even if the symlink does. PiperOrigin-RevId: 320110156
2020-07-01Add test env variable "fuchsia"Jay Zhuang
... so that Fuchsia gets the same special cases applied to gVisor in tests when this envrionment variable is set. PiperOrigin-RevId: 319239064
2020-06-18Fix vfs2 tmpfs link permission checks.Dean Deng
Updates #2923. PiperOrigin-RevId: 317246916
2020-05-21Add IsRunningWithVFS1 to test utilFabricio Voznika
VFS2 is adding more functionality than VFS1. In order to test new functionality, it's required to skip some tests with VFS1. To skip tests, use: SKIP_IF(IsRunningWithVFS1()); The test will run in Linux and gVisor with VFS2 enabled. Updates #1035 PiperOrigin-RevId: 312698616
2020-04-03Add missing newlineTamir Duberstein
PiperOrigin-RevId: 304659346
2020-03-03Move temp_umask to test/util.Adin Scannell
PiperOrigin-RevId: 298667595
2020-02-19Add basic microbenchmarks.Adin Scannell
PiperOrigin-RevId: 296104390
2020-02-05Add notes to relevant tests.Adin Scannell
These were out-of-band notes that can help provide additional context and simplify automated imports. PiperOrigin-RevId: 293525915
2020-01-31KVM platform does not support 32bit.Ting-Yu Wang
Fixes: //test/syscalls:32bit_test_runsc_kvm Ref change: 5d569408ef94c753b7aae9392b5e4ebf7e5ea50d PiperOrigin-RevId: 292563926
2020-01-30Simplify testing link rules.Adin Scannell
PiperOrigin-RevId: 292458933
2020-01-30Merge pull request #1471 from xiaobo55x:syscall_testgVisor bot
PiperOrigin-RevId: 292445329
2020-01-30Merge pull request #1630 from xiaobo55x:kOLargeFilegVisor bot
PiperOrigin-RevId: 292419699
2020-01-28Prefer Type& over Type &Michael Pratt
And Type* over Type *. This is basically a whitespace only change. gVisor code already prefers left-alignment of pointers and references, but clang-format formats for consistency with the majority of a file, and some files leaned the wrong way. This is a one-time pass to make us completely conforming. Autogenerated with: $ find . \( -name "*.cc" -or -name "*.c" -or -name "*.h" \) \ | xargs clang-format -i -style="{BasedOnStyle: Google, \ DerivePointerAlignment: false, PointerAlignment: Left}" PiperOrigin-RevId: 291972421
2020-01-27Create platform_util for tests.Adin Scannell
PiperOrigin-RevId: 291869423
2020-01-27Fix header ordering and format all C++ code.Adin Scannell
PiperOrigin-RevId: 291844200
2020-01-27Standardize on tools directory.Adin Scannell
PiperOrigin-RevId: 291745021
2020-01-23Unify the kOLargeFile definition in syscall tests.Haibo Xu
Signed-off-by: Haibo Xu <haibo.xu@arm.com> Change-Id: Id9d6ae98305a4057d55d622ea4c3ac2228fea212
2020-01-21Change to standard types.Adin Scannell
PiperOrigin-RevId: 290846481
2020-01-21Merge pull request #1492 from majek:err_typo_in_netstack_testsgVisor bot
PiperOrigin-RevId: 290840370
2020-01-17Enable build of test/syscall tests on arm64.Haibo Xu
Signed-off-by: Haibo Xu <haibo.xu@arm.com> Change-Id: I277d6c708bbf5c3edd7c3568941cfd01dc122e17
2019-12-30Add test/util/save_util_linux.cc:MaybeSave to support arm64Bin Lu
There is no syscall_create_module on Arm64. Signed-off-by: Bin Lu <bin.lu@arm.com>
2019-12-10Do not consider symlinks as directories in fs utils.Dean Deng
IsDirectory() is used in RecursivelyDelete(), which should not follow symlinks. The only other use (syscalls/linux/rename.cc) is not affected by this change. Updates #1366. PiperOrigin-RevId: 284803968
2019-12-04Allow syscall tests to run with hostinet.Dean Deng
Fixes #1207 PiperOrigin-RevId: 283914438
2019-12-03Add RunfilesPath to test_utilMichael Pratt
A few tests have their own ad-hoc implementations. Add a single common one. PiperOrigin-RevId: 283601666
2019-11-21Import and structure cleanup.Adin Scannell
PiperOrigin-RevId: 281795269