]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test: fix test_pidfile 13646/head
authoryaoning <yaoning@unitedstack.com>
Fri, 24 Feb 2017 17:36:02 +0000 (01:36 +0800)
committeryaoning <yaoning@unitedstack.com>
Tue, 28 Feb 2017 06:10:59 +0000 (14:10 +0800)
kill_daemons cat the pidfile, then kill the pid in it.
it does not work in this case since pid in osd.0.pid is wrong

Signed-off-by: yaoning <yaoning@unitedstack.com>
src/test/test_pidfile.sh

index 7bc2696a49a1d2223b21d3bba984bd2801c6fbcf..3fd003239be10ce88945117e61660db0ac0c7b0a 100755 (executable)
@@ -69,9 +69,10 @@ function TEST_pidfile() {
     # if the pid in the file is different from the pid of the daemon
     # the file is not removed because it is assumed to be owned by
     # another daemon
-    cp $dir/osd.0.pid $dir/osd.0.pid.old  # so that kill_daemon finds the pid
+    mkdir $dir/old
+    cp $dir/osd.0.pid $dir/old/osd.0.pid  # so that kill_daemon finds the pid
     echo 123 > $dir/osd.0.pid
-    kill_daemons $dir TERM osd.0 || return 1
+    kill_daemons $dir/old TERM osd.0 || return 1
     test -f $dir/osd.0.pid || return 1
 
     # when the daemon shutdown, it removes its own pid file