test/libcephfs: release resources before umount

Fixes: #6742
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Yan, Zheng 2013-12-11 07:38:18 +08:00 committed by Sage Weil
parent b8884e01a0
commit 5bb04763de

View File

@ -38,6 +38,7 @@ TEST(LibCephFS, ReaddirRCB) {
sprintf(c_file, "/readdir_r_cb_tests_%d/foo", getpid());
int fd = ceph_open(cmount, c_file, O_CREAT, 0777);
ASSERT_LT(0, fd);
ASSERT_EQ(0, ceph_close(cmount, fd));
// check correctness with one entry
ASSERT_LE(0, ceph_closedir(cmount, dirp));
@ -56,6 +57,7 @@ TEST(LibCephFS, ReaddirRCB) {
ASSERT_EQ(4, ceph_getdnames(cmount, dirp, buf, 6));
// free cmount after finishing testing
ASSERT_LE(0, ceph_closedir(cmount, dirp));
ASSERT_EQ(0, ceph_unmount(cmount));
ASSERT_EQ(0, ceph_release(cmount));
}