diff options
author | Adin Scannell <ascannell@google.com> | 2021-04-26 16:25:26 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-04-26 16:27:45 -0700 |
commit | 36fdc6c9ef565be34f5ab27affed31eb2430e89a (patch) | |
tree | b7f7abab391f1c9664b5a14ed6f786560d2afc49 /test/syscalls | |
parent | 5b7b7daa425ffc93e98c12cbd37ea7b15a8bcc8d (diff) |
Handle tmpfs with 5 fields in /proc/mounts parsing.
PiperOrigin-RevId: 370565903
Diffstat (limited to 'test/syscalls')
-rw-r--r-- | test/syscalls/linux/mount.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/syscalls/linux/mount.cc b/test/syscalls/linux/mount.cc index 92d0fb05c..3c7311782 100644 --- a/test/syscalls/linux/mount.cc +++ b/test/syscalls/linux/mount.cc @@ -45,6 +45,7 @@ namespace testing { namespace { +using ::testing::AnyOf; using ::testing::Contains; using ::testing::Pair; @@ -360,7 +361,8 @@ TEST(MountTest, MountInfo) { if (e.mount_point == dir.path()) { EXPECT_EQ(e.fstype, "tmpfs"); auto mopts = ParseMountOptions(e.mount_opts); - EXPECT_THAT(mopts, Contains(Pair("mode", "0123"))); + EXPECT_THAT(mopts, AnyOf(Contains(Pair("mode", "0123")), + Contains(Pair("mode", "123")))); } } @@ -371,7 +373,8 @@ TEST(MountTest, MountInfo) { if (e.mount_point == dir.path()) { EXPECT_EQ(e.fstype, "tmpfs"); auto mopts = ParseMountOptions(e.super_opts); - EXPECT_THAT(mopts, Contains(Pair("mode", "0123"))); + EXPECT_THAT(mopts, AnyOf(Contains(Pair("mode", "0123")), + Contains(Pair("mode", "123")))); } } } |