]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test: add missing ceph_ll_close calls
authorJeff Layton <jlayton@redhat.com>
Thu, 8 Dec 2016 19:24:04 +0000 (14:24 -0500)
committerJeff Layton <jlayton@redhat.com>
Thu, 8 Dec 2016 19:24:04 +0000 (14:24 -0500)
There's a noticable up to tick-length hang that occurs when you call
ceph_shutdown with open files still in play. Ensure that we always
call ceph_ll_close after a successful ceph_ll_create.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/test/libcephfs/recordlock.cc
src/test/libcephfs/test.cc

index 7f852ef3f4694379103331f51cb9d37f6a0f2332..5a18c5126d0036b13d832165ba2c1b8c6447b483 100644 (file)
@@ -355,6 +355,8 @@ static void thread_ConcurrentRecordLocking(str_ConcurrentRecordLocking& s) {
   lock1.l_pid = getpid();
   ASSERT_EQ(0, ceph_ll_setlk(cmount, fh, &lock1, pthread_self(), false));
   PING_MAIN(7); // (7)
+
+  ASSERT_EQ(0, ceph_ll_close(cmount, fh));
 }
 
 // Used by ConcurrentRecordLocking test
@@ -746,6 +748,7 @@ static void process_ConcurrentRecordLocking(str_ConcurrentRecordLocking& s) {
   ASSERT_EQ(0, ceph_ll_setlk(cmount, fh, &lock1, mypid, false));
   PING_MAIN(7); // (7)
 
+  ASSERT_EQ(0, ceph_ll_close(cmount, fh));
   CLEANUP_CEPH();
 
   s.sem_destroy();
index 5f43f4ce2e822c35a5fdcc312a24f02bd62b6b78..0d6c87c446488d9d439d482883e0453fafb936a8 100644 (file)
@@ -1402,6 +1402,7 @@ TEST(LibCephFS, Nlink) {
   ASSERT_EQ(ceph_ll_mkdir(cmount, root, dirname, 0755, &dir, &stx, 0, 0, perms), 0);
   ASSERT_EQ(ceph_ll_create(cmount, dir, filename, 0666, O_RDWR|O_CREAT|O_EXCL,
                           &file, &fh, &stx, CEPH_STATX_NLINK, 0, perms), 0);
+  ASSERT_EQ(ceph_ll_close(cmount, fh), 0);
   ASSERT_EQ(stx.stx_nlink, (nlink_t)1);
 
   ASSERT_EQ(ceph_ll_link(cmount, file, dir, linkname, perms), 0);
@@ -1573,6 +1574,7 @@ TEST(LibCephFS, LazyStatx) {
   ceph_ll_unlink(cmount1, root1, filename, perms1);
   ASSERT_EQ(ceph_ll_create(cmount1, root1, filename, 0666, O_RDWR|O_CREAT|O_EXCL,
                           &file1, &fh, &stx, 0, 0, perms1), 0);
+  ASSERT_EQ(ceph_ll_close(cmount1, fh), 0);
 
   ASSERT_EQ(ceph_ll_lookup_root(cmount2, &root2), 0);
 
@@ -1737,5 +1739,6 @@ TEST(LibCephFS, ClearSetuid) {
   ASSERT_TRUE(stx.stx_mask & CEPH_STATX_MODE);
   ASSERT_FALSE(stx.stx_mode & (S_ISUID|S_ISGID));
 
+  ASSERT_EQ(ceph_ll_close(cmount, fh), 0);
   ceph_shutdown(cmount);
 }