Commit Graph
28 Commits
Author SHA1 Message Date
Nicolas LacasseandgVisor bot 6421cbe3ed Change TODO to NOTE so bug can be closed.
PiperOrigin-RevId: 512678512
2023-02-27 11:30:01 -08:00
Nicolas LacasseandgVisor bot bd9a28a368 Ignore AT_NO_AUTOMOUNT flag in statx() calls.
gVisor does not support automount, so this flag is a no-op.

Confirmed that this fixes recent versions of 'ls':

$ docker run -ti --runtime=fig rockylinux:8.7 /bin/bash
[root@c6c749af0a7a /]# ls /
bin  dev  etc  home  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

PiperOrigin-RevId: 511376385
2023-02-21 20:10:44 -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
Adam BarthandgVisor bot 241b6b5145 Use GetAbsoluteTestTmpdir() rather than hard-code "/tmp"
This change makes these tests easier to run on systems that have their temp
directory in another location.

PiperOrigin-RevId: 388601202
2021-08-03 19:54:35 -07:00
gVisor bot 4f82319e45 Add O_PATH support in vfs2
PiperOrigin-RevId: 354367665
2021-01-28 12:24:37 -08:00
Jamie LiuandgVisor bot 114d68adb8 Support VFS2 save/restore.
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-23 17:48:33 -07:00
Nicolas LacasseandgVisor bot b0d4b64c0a Deflake stat_test with save/restore enabled.
PiperOrigin-RevId: 332546659
2020-09-18 16:13:07 -07:00
Jamie LiuandgVisor bot 5558918d86 Implement fsimpl/overlay.filesystem.RenameAt.
Updates #1199

PiperOrigin-RevId: 332539197
2020-09-18 15:29:26 -07:00
Ayush RanjanandgVisor bot c0fc119a08 [vfs] Disable nlink tests for overlayfs.
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-10 10:40:35 -07:00
Fabricio VoznikaandgVisor bot 2fe88144a7 Misc fixes to make stat_test pass (almost)
The only test failing now requires socket which is not
available in VFS2 yet.

Updates #1198

PiperOrigin-RevId: 302976572
2020-03-25 14:59:15 -07:00
Dean DengandgVisor bot c968841bc7 Plumb VFS2 imported fds into virtual filesystem.
- When setting up the virtual filesystem, mount a host.filesystem to contain
  all files that need to be imported.
- Make read/preadv syscalls to the host in cases where preadv2 may not be
  supported yet (likewise for writing).
- Make save/restore functions in kernel/kernel.go return early if vfs2 is
  enabled.

PiperOrigin-RevId: 300922353
2020-03-14 07:14:33 -07:00
gVisor bot 2667449240 Merge pull request #1471 from xiaobo55x:syscall_test
PiperOrigin-RevId: 292445329
2020-01-30 16:12:25 -08:00
Michael PrattandgVisor bot 6ae2325bed Prefer Type& over Type &
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-28 11:18:17 -08:00
Adin ScannellandgVisor bot 5f66bbfd5a Fix header ordering and format all C++ code.
PiperOrigin-RevId: 291844200
2020-01-27 18:27:20 -08:00
Adin ScannellandgVisor bot 1b8ff2ce79 Change to standard types.
PiperOrigin-RevId: 290846481
2020-01-21 17:28:57 -08:00
gVisor bot 33f3ef287f Merge pull request #1492 from majek:err_typo_in_netstack_tests
PiperOrigin-RevId: 290840370
2020-01-21 16:32:49 -08:00
Haibo Xu 7ec3e71e03 Enable build of test/syscall tests on arm64.
Signed-off-by: Haibo Xu <[email protected]>
Change-Id: I277d6c708bbf5c3edd7c3568941cfd01dc122e17
2020-01-17 07:39:57 +00:00
HaiboandgVisor bot eaab6788a0 test/syscall: Remove duplicated gtest/gtest.h.
Signed-off-by: Haibo Xu <[email protected]>
Change-Id: I05a7ec69b98b88931ba4a8adb3e8a7b822006001
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gvisor/pull/1023 from xiaobo55x:syscall_test d44a8b1f827ed4081997af96cd58ba7449e0a9e1
PiperOrigin-RevId: 276740442
2019-10-25 12:40:36 -07:00
Zach KoopmansandgVisor bot e7efe10a11 Fix flaky stat.cc test.
This test flaked on my current CL. Linux makes no guarantee
that two inodes will consecutive (overflows happen).

https://github.com/avagin/linux-task-diag/blob/master/fs/inode.c#L880

PiperOrigin-RevId: 260608240
2019-07-29 16:47:58 -07:00
Nicolas LacasseandgVisor bot 87df9aab24 Use correct statx syscall number for amd64.
The previous number was for the arm architecture.

Also change the statx tests to force them to run on gVisor, which would have
caught this issue.

PiperOrigin-RevId: 254846831
2019-06-24 15:19:36 -07:00
Nicolas LacasseandgVisor bot 35719d52c7 Implement statx.
We don't have the plumbing for btime yet, so that field is left off. The
returned mask indicates that btime is absent.

Fixes #343

PiperOrigin-RevId: 254575752
2019-06-22 13:29:26 -07:00
Michael PrattandShentubot 4d52a55201 Change copyright notice to "The gVisor Authors"
Based on the guidelines at
https://opensource.google.com/docs/releasing/authors/.

1. $ rg -l "Google LLC" | xargs sed -i 's/Google LLC.*/The gVisor Authors./'
2. Manual fixup of "Google Inc" references.
3. Add AUTHORS file. Authors may request to be added to this file.
4. Point netstack AUTHORS to gVisor AUTHORS. Drop CONTRIBUTORS.

Fixes #209

PiperOrigin-RevId: 245823212
Change-Id: I64530b24ad021a7d683137459cafc510f5ee1de9
2019-04-29 14:26:23 -07:00
Nicolas LacasseandShentubot f4ce43e1f4 Allow and document bug ids in gVisor codebase.
PiperOrigin-RevId: 245818639
Change-Id: I03703ef0fb9b6675955637b9fe2776204c545789
2019-04-29 14:04:14 -07:00
Wei ZhangandShentubot 17ff6063a3 Bugfix: fix fstatat symbol link to dir
For a symbol link to some directory, eg.

`/tmp/symlink -> /tmp/dir`

`fstatat("/tmp/symlink")` should return symbol link data, but
`fstatat("/tmp/symlink/")` (symlink with trailing slash) should return
directory data it points following linux behaviour.

Currently fstatat() a symlink with trailing slash will get "not a
directory" error which is wrong.

Signed-off-by: Wei Zhang <[email protected]>
Change-Id: I63469b1fb89d083d1c1255d32d52864606fbd7e2
PiperOrigin-RevId: 244783916
2019-04-22 20:07:06 -07:00
Rahat MahmoodandShentubot 7cff746ef2 Save/restore simple devices.
We weren't saving simple devices' last allocated inode numbers, which
caused inode number reuse across S/R.

PiperOrigin-RevId: 241414245
Change-Id: I964289978841ef0a57d2fa48daf8eab7633c1284
2019-04-01 15:39:16 -07:00
Nicolas LacasseandShentubot b81bfd6013 lstat should resolve the final path component if it ends in a slash.
PiperOrigin-RevId: 239896221
Change-Id: I0949981fe50c57131c5631cdeb10b225648575c0
2019-03-22 17:38:13 -07:00
Michael PrattandShentubot bd46185e24 Add NoRandomSave to tests with correctness DisableSave
Tests using DisableSave because a portion of the test is *incompatible*
with S/R clearly cannot use random S/R, as the saves may occur in the
DisableSave critical section.

Most such tests already have NoRandomSave. Add it to the rest.

PiperOrigin-RevId: 236914708
Change-Id: Iee1cf044cfa7cb8d5aba21ddc130926218210c48
2019-03-05 13:54:38 -08:00
Brian GeffonandShentubot d3bc79bc84 Open source system call tests.
PiperOrigin-RevId: 224886231
Change-Id: I0fccb4d994601739d8b16b1d4e6b31f40297fb22
2018-12-10 14:42:34 -08:00