summaryrefslogtreecommitdiffstats
path: root/src/test/libcephfs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2016-08-29 13:16:41 +0200
committerJeff Layton <jlayton@redhat.com>2016-08-29 16:33:46 +0200
commitc3efea6fc34a437c7e711305a6e49908496768b4 (patch)
tree0a46fc2384a6825664b62deef6f6770b73146de6 /src/test/libcephfs
parentclient: add a ceph_fstatx (diff)
downloadceph-c3efea6fc34a437c7e711305a6e49908496768b4.tar.xz
ceph-c3efea6fc34a437c7e711305a6e49908496768b4.zip
client: extend the Btime test to cover fstatx as well
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'src/test/libcephfs')
-rw-r--r--src/test/libcephfs/test.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/libcephfs/test.cc b/src/test/libcephfs/test.cc
index a4062a95e9b..4efb3ff7f94 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);