]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test/libcephfs: skip dirent inode check on Windows
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 7 Sep 2022 07:40:58 +0000 (07:40 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 10 Nov 2022 07:38:13 +0000 (09:38 +0200)
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 <lpetrut@cloudbasesolutions.com>
src/test/libcephfs/test.cc

index a94ab036e33934da23a61b330a7c13829834a915..a6094a7e5c9714584ad00ff4c3bb3ffbefcbf91a 100644 (file)
@@ -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);