From: Jeff Layton Date: Mon, 29 Aug 2016 11:16:41 +0000 (-0400) Subject: client: extend the Btime test to cover fstatx as well X-Git-Tag: v11.0.1~326^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c3efea6fc34a437c7e711305a6e49908496768b4;p=ceph.git client: extend the Btime test to cover fstatx as well Signed-off-by: Jeff Layton --- diff --git a/src/test/libcephfs/test.cc b/src/test/libcephfs/test.cc index a4062a95e9b8..4efb3ff7f946 100644 --- a/src/test/libcephfs/test.cc +++ b/src/test/libcephfs/test.cc @@ -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);