mirror of
https://github.com/ceph/ceph
synced 2025-03-23 18:58:41 +00:00
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:
parent
b8884e01a0
commit
5bb04763de
@ -38,6 +38,7 @@ TEST(LibCephFS, ReaddirRCB) {
|
|||||||
sprintf(c_file, "/readdir_r_cb_tests_%d/foo", getpid());
|
sprintf(c_file, "/readdir_r_cb_tests_%d/foo", getpid());
|
||||||
int fd = ceph_open(cmount, c_file, O_CREAT, 0777);
|
int fd = ceph_open(cmount, c_file, O_CREAT, 0777);
|
||||||
ASSERT_LT(0, fd);
|
ASSERT_LT(0, fd);
|
||||||
|
ASSERT_EQ(0, ceph_close(cmount, fd));
|
||||||
|
|
||||||
// check correctness with one entry
|
// check correctness with one entry
|
||||||
ASSERT_LE(0, ceph_closedir(cmount, dirp));
|
ASSERT_LE(0, ceph_closedir(cmount, dirp));
|
||||||
@ -56,6 +57,7 @@ TEST(LibCephFS, ReaddirRCB) {
|
|||||||
ASSERT_EQ(4, ceph_getdnames(cmount, dirp, buf, 6));
|
ASSERT_EQ(4, ceph_getdnames(cmount, dirp, buf, 6));
|
||||||
|
|
||||||
// free cmount after finishing testing
|
// free cmount after finishing testing
|
||||||
|
ASSERT_LE(0, ceph_closedir(cmount, dirp));
|
||||||
ASSERT_EQ(0, ceph_unmount(cmount));
|
ASSERT_EQ(0, ceph_unmount(cmount));
|
||||||
ASSERT_EQ(0, ceph_release(cmount));
|
ASSERT_EQ(0, ceph_release(cmount));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user