summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls
diff options
context:
space:
mode:
authorSteve Silva <stevesilva@google.com>2021-05-06 18:00:49 -0700
committergVisor bot <gvisor-bot@google.com>2021-05-06 18:03:42 -0700
commit339001204000a3060628256cd9131ea2a2d4e08a (patch)
tree518e103c362ebd106fdf96cedb1d08fdade42376 /test/syscalls
parent9800fd8e4717133476afb9bdc64f8384c53f82dd (diff)
Implement /proc/cmdline
This change implements /proc/cmdline with a basic faux command line "BOOT_IMAGE=/vmlinuz-[version]-gvisor quiet" so apps that may expect it do not receive errors. Also tests for the existence of /proc/cmdline as part of the system call test suite PiperOrigin-RevId: 372462070
Diffstat (limited to 'test/syscalls')
-rw-r--r--test/syscalls/linux/proc.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/syscalls/linux/proc.cc b/test/syscalls/linux/proc.cc
index 143075e2d..24928d876 100644
--- a/test/syscalls/linux/proc.cc
+++ b/test/syscalls/linux/proc.cc
@@ -1201,6 +1201,15 @@ TEST(ProcSelfCwd, Absolute) {
EXPECT_EQ(exe[0], '/');
}
+// Sanity check that /proc/cmdline is present.
+TEST(ProcCmdline, IsPresent) {
+ SKIP_IF(IsRunningWithVFS1());
+
+ std::string proc_cmdline =
+ ASSERT_NO_ERRNO_AND_VALUE(GetContents("/proc/cmdline"));
+ ASSERT_FALSE(proc_cmdline.empty());
+}
+
// Sanity check for /proc/cpuinfo fields that must be present.
TEST(ProcCpuinfo, RequiredFieldsArePresent) {
std::string proc_cpuinfo =