summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux
diff options
context:
space:
mode:
authorgystemd <gystemd@gmail.com>2021-08-26 17:00:10 +0200
committergystemd <gystemd@gmail.com>2021-08-26 17:00:10 +0200
commit73ba5943cfdc49ac2cb4638e00b14223ec7ee2b4 (patch)
tree7c3c5fd0570624996aba2d1827c28633adc3b4fb /test/syscalls/linux
parent4c7aaa941eaa05eea99b1b1e7f8e33b42c2bd6a8 (diff)
fix tests in pty.cc
fixed and enabled SetForegroundProcessGroup and SetForegroundProcessGroupEmptyProcessGroup.
Diffstat (limited to 'test/syscalls/linux')
-rw-r--r--test/syscalls/linux/pty.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/syscalls/linux/pty.cc b/test/syscalls/linux/pty.cc
index c008c89e7..c6592b4a7 100644
--- a/test/syscalls/linux/pty.cc
+++ b/test/syscalls/linux/pty.cc
@@ -1594,9 +1594,9 @@ TEST_F(JobControlTest, GetForegroundProcessGroupNonControlling) {
// - creates a child process in a new process group
// - sets that child as the foreground process group
// - kills its child and sets itself as the foreground process group.
-// TODO(gvisor.dev/issue/5357): Fix and enable.
-TEST_F(JobControlTest, DISABLED_SetForegroundProcessGroup) {
+TEST_F(JobControlTest, SetForegroundProcessGroup) {
auto res = RunInChild([=]() {
+ TEST_PCHECK(setsid() >= 0);
TEST_PCHECK(!ioctl(replica_.get(), TIOCSCTTY, 0));
// Ignore SIGTTOU so that we don't stop ourself when calling tcsetpgrp.
@@ -1634,7 +1634,7 @@ TEST_F(JobControlTest, DISABLED_SetForegroundProcessGroup) {
// Set ourself as the foreground process.
pid_t pgid;
- TEST_PCHECK(pgid = getpgid(0) == 0);
+ TEST_PCHECK((pgid = getpgid(0)) >= 0);
TEST_PCHECK(!tcsetpgrp(replica_.get(), pgid));
});
ASSERT_NO_ERRNO(res);
@@ -1735,9 +1735,9 @@ TEST_F(JobControlTest, SetForegroundProcessGroupNegPgid) {
ASSERT_NO_ERRNO(ret);
}
-// TODO(gvisor.dev/issue/5357): Fix and enable.
-TEST_F(JobControlTest, DISABLED_SetForegroundProcessGroupEmptyProcessGroup) {
+TEST_F(JobControlTest, SetForegroundProcessGroupEmptyProcessGroup) {
auto res = RunInChild([=]() {
+ TEST_PCHECK(setsid() >= 0);
TEST_PCHECK(!ioctl(replica_.get(), TIOCSCTTY, 0));
// Create a new process, put it in a new process group, make that group the