]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: extend the Btime test to cover fstatx as well
authorJeff Layton <jlayton@redhat.com>
Mon, 29 Aug 2016 11:16:41 +0000 (07:16 -0400)
committerJeff Layton <jlayton@redhat.com>
Mon, 29 Aug 2016 14:33:46 +0000 (10:33 -0400)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/test/libcephfs/test.cc

index a4062a95e9b8d4aa1a2ec5b196225558ab1f426d..4efb3ff7f9465d5aeec541b2b44c33d2717c104f 100644 (file)
@@ -1483,7 +1483,15 @@ TEST(LibCephFS, Btime) {
   int fd = ceph_open(cmount, filename, O_RDWR|O_CREAT|O_EXCL, 0666);
   ASSERT_LT(0, fd);
 
+  /* make sure fstatx works */
   struct ceph_statx    stx;
+
+  ASSERT_EQ(ceph_fstatx(cmount, fd, &stx, CEPH_STATX_CTIME|CEPH_STATX_BTIME, 0), 0);
+  ASSERT_TRUE(stx.stx_mask & (CEPH_STATX_CTIME|CEPH_STATX_BTIME));
+  ASSERT_EQ(stx.stx_btime, stx.stx_ctime);
+  ASSERT_EQ(stx.stx_btime_ns, stx.stx_ctime_ns);
+  ceph_close(cmount, fd);
+
   ASSERT_EQ(ceph_statx(cmount, filename, &stx, CEPH_STATX_CTIME|CEPH_STATX_BTIME, 0), 0);
   ASSERT_TRUE(stx.stx_mask & (CEPH_STATX_CTIME|CEPH_STATX_BTIME));
   ASSERT_EQ(stx.stx_btime, stx.stx_ctime);