]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Fix and enable test_pidfile.sh 16987/head
authorDavid Zafman <dzafman@redhat.com>
Tue, 1 Aug 2017 02:15:37 +0000 (19:15 -0700)
committerDavid Zafman <dzafman@redhat.com>
Fri, 11 Aug 2017 01:24:29 +0000 (18:24 -0700)
Increase delay so daemonized process can make progress and write/lock pidfile
Add --log_flush_on_exit to ensure log gets flushed for TEST_without_pidfile test

Fixes: http://tracker.ceph.com/issues/20770
Signed-off-by: David Zafman <dzafman@redhat.com>
src/test/CMakeLists.txt
src/test/test_pidfile.sh

index 50b35769106f1d08d06322058289f43418438252..07f3238a4e4d1271e811a4992e4d8eb5b9400212 100644 (file)
@@ -567,10 +567,7 @@ if(WITH_RBD)
 endif(WITH_RBD)
 add_ceph_test(run-cli-tests ${CMAKE_CURRENT_SOURCE_DIR}/run-cli-tests)
 add_ceph_test(test_objectstore_memstore.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_objectstore_memstore.sh)
-
-# buggy, see http://tracker.ceph.com/issues/20975
-#add_ceph_test(test_pidfile.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_pidfile.sh)
-
+add_ceph_test(test_pidfile.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_pidfile.sh)
 add_ceph_test(test_subman.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_subman.sh)
 add_ceph_test(smoke.sh ${CMAKE_CURRENT_SOURCE_DIR}/smoke.sh)
 add_ceph_test(unittest_bufferlist.sh ${CMAKE_SOURCE_DIR}/src/unittest_bufferlist.sh)
index fbd5ab617d9d090433fbb226376d0fab501044fe..8f9c8cc2c181a0c2809cebbc340150728640e347 100755 (executable)
@@ -33,10 +33,10 @@ function TEST_without_pidfile() {
         --mkfs \
         --mon-data=$data \
         --run-dir=$dir || return 1
-    sleep 1
     expect_failure $dir "ignore empty --pid-file" ceph-mon \
         -f \
         --log-to-stderr \
+       --log_flush_on_exit \
         --pid-file= \
         --id $id \
         --mon-data=$data \
@@ -50,9 +50,11 @@ function TEST_pidfile() {
 
     # no daemon can use a pidfile that is owned by another daemon
     run_mon $dir a || return 1
+    sleep 2
     run_mon $dir a --log-to-stderr -f 2>&1 | grep "failed to lock pidfile" || return 1
 
     run_osd $dir 0 || return 1
+    sleep 2
     activate_osd $dir 0 --log-to-stderr -f 2>&1 | grep "failed to lock pidfile" || return 1
 
     # when a daemon shutdown, it will not unlink a path different from