diff options
author | Kevin Krakauer <krakauer@google.com> | 2019-07-12 15:16:01 -0700 |
---|---|---|
committer | Kevin Krakauer <krakauer@google.com> | 2019-07-12 15:16:01 -0700 |
commit | 6ebb925acd6336760f6f9453e860944e0e314a7b (patch) | |
tree | c3599585ed41535fbbab2151262188eaa6a42129 /test/syscalls | |
parent | ddef7f8078ba87ae2c73c6b89668e01d1da76cfe (diff) |
Add permission, char device, and uid checks.
Change-Id: I8307bfb390a56424aaa651285a218aad277c4aed
Diffstat (limited to 'test/syscalls')
-rw-r--r-- | test/syscalls/linux/dev.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/syscalls/linux/dev.cc b/test/syscalls/linux/dev.cc index 7b1dd14ef..7f0a2ec45 100644 --- a/test/syscalls/linux/dev.cc +++ b/test/syscalls/linux/dev.cc @@ -148,6 +148,10 @@ TEST(DevTest, WriteDevFull) { TEST(DevTest, TTYExists) { struct stat statbuf = {}; ASSERT_THAT(stat("/dev/tty", &statbuf), SyscallSucceeds()); + // Check that it's a character device with rw-rw-rw- permissions. + EXPECT_EQ(statbuf.st_mode, S_IFCHR | 0666); + // Check that it's owned by root. + EXPECT_EQ(statbuf.st_uid, 0); } } // namespace |