diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2024-01-31 18:42:56 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-01-31 18:42:56 +0000 |
commit | 7123abff5170eea24a895e673562815a11fa53ca (patch) | |
tree | b191bf368379429fbf2a938f7a0b5238b388391f | |
parent | fb7d4c4761805f672f348422cb0568bb280a069a (diff) | |
parent | 234dc36ac657e7848e9b935e6558d748aa5a7018 (diff) | |
download | bionic-7123abff5170eea24a895e673562815a11fa53ca.tar.gz |
Merge "sys_statvfs_test: fix expectation for Linux 6.7." into android13-tests-devandroid13-tests-dev
-rw-r--r-- | tests/sys_statvfs_test.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/sys_statvfs_test.cpp b/tests/sys_statvfs_test.cpp index 1761e6a51..73b2a9681 100644 --- a/tests/sys_statvfs_test.cpp +++ b/tests/sys_statvfs_test.cpp @@ -28,9 +28,19 @@ template <typename StatVfsT> void Check(StatVfsT& sb) { EXPECT_EQ(4096U, sb.f_bsize); EXPECT_EQ(0U, sb.f_bfree); EXPECT_EQ(0U, sb.f_ffree); - EXPECT_EQ(0U, sb.f_fsid); EXPECT_EQ(255U, sb.f_namemax); + // Linux 6.7 requires that all filesystems have a non-zero fsid. + if (sb.f_fsid != 0U) { + // fs/libfs.c reuses the filesystem's device number. + struct stat proc_sb; + ASSERT_EQ(0, stat("/proc", &proc_sb)); + EXPECT_EQ(proc_sb.st_dev, sb.f_fsid); + } else { + // Prior to that, the fsid for /proc was just 0. + EXPECT_EQ(0U, sb.f_fsid); + } + // The kernel sets a private bit to indicate that f_flags is valid. // This flag is not supposed to be exposed to libc clients. static const uint32_t ST_VALID = 0x0020; |