summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2019-06-27 17:21:34 -0700
committergVisor bot <gvisor-bot@google.com>2019-06-27 17:22:53 -0700
commitb2907595e5e974d2b011ea011033aa06d796e090 (patch)
treea7401828788fd25675a2dd86ff331605ec826b00 /test
parent5b41ba5d0eca266790dba5f5dd095010e3944726 (diff)
Complete pipe support on overlayfs
Get/Set pipe size and ioctl support were missing from overlayfs. It required moving the pipe.Sizer interface to fs so that overlay could get access. Fixes #318 PiperOrigin-RevId: 255511125
Diffstat (limited to 'test')
-rw-r--r--test/syscalls/BUILD2
-rw-r--r--test/syscalls/linux/pipe.cc6
2 files changed, 5 insertions, 3 deletions
diff --git a/test/syscalls/BUILD b/test/syscalls/BUILD
index b06e46c03..b5f89033b 100644
--- a/test/syscalls/BUILD
+++ b/test/syscalls/BUILD
@@ -255,7 +255,7 @@ syscall_test(test = "//test/syscalls/linux:pause_test")
syscall_test(
size = "large",
- add_overlay = False, # TODO(gvisor.dev/issue/318): enable when fixed.
+ add_overlay = True,
shard_count = 5,
test = "//test/syscalls/linux:pipe_test",
)
diff --git a/test/syscalls/linux/pipe.cc b/test/syscalls/linux/pipe.cc
index 1f4422f4e..65afb90f3 100644
--- a/test/syscalls/linux/pipe.cc
+++ b/test/syscalls/linux/pipe.cc
@@ -339,11 +339,13 @@ TEST_P(PipeTest, BlockPartialWriteClosed) {
SKIP_IF(!CreateBlocking());
ScopedThread t([this]() {
- std::vector<char> buf(2 * Size());
+ const int pipe_size = Size();
+ std::vector<char> buf(2 * pipe_size);
+
// Write more than fits in the buffer. Blocks then returns partial write
// when the other end is closed. The next call returns EPIPE.
ASSERT_THAT(write(wfd_.get(), buf.data(), buf.size()),
- SyscallSucceedsWithValue(Size()));
+ SyscallSucceedsWithValue(pipe_size));
EXPECT_THAT(write(wfd_.get(), buf.data(), buf.size()),
SyscallFailsWithErrno(EPIPE));
});