From 98eef6229c1c69037974fe49cf3be5cfbbbcb289 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Wed, 7 Sep 2022 07:40:58 +0000 Subject: [PATCH] test/libcephfs: skip dirent inode check on Windows The LibCephFS.DirLs test calls ceph_readdirplus_r and expects the returning dirent.d_ino value to match the ceph_statx.stx_ino inode. The issue is that on Windows, "dirent" uses long (4B) inodes, which isn't large enough to hold the ceph inodes (uint64_t). For now, we'll drop this specific assertion. On Windows, the ceph_statx inode should be used instead of the dirent one. Signed-off-by: Lucian Petrut --- src/test/libcephfs/test.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/libcephfs/test.cc b/src/test/libcephfs/test.cc index a94ab036e33..a6094a7e5c9 100644 --- a/src/test/libcephfs/test.cc +++ b/src/test/libcephfs/test.cc @@ -483,7 +483,12 @@ TEST(LibCephFS, DirLs) { sscanf(name, "dirf%d", &size); ASSERT_TRUE(stx.stx_mask & CEPH_STATX_SIZE); ASSERT_EQ(stx.stx_size, (size_t)size); + // On Windows, dirent uses long (4B) inodes, which get trimmed + // and can't be used. + // TODO: consider defining ceph_dirent. + #ifndef _WIN32 ASSERT_EQ(stx.stx_ino, rdent.d_ino); + #endif //ASSERT_EQ(st.st_mode, (mode_t)0666); } ASSERT_EQ(found, entries); -- 2.39.5