From ea61c8ab5a13de317727fba6515c33c04fd29a9b Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sat, 16 May 2015 15:32:20 +0200 Subject: [PATCH] tests: ceph-helpers.sh do not hardcode id a in run_mon Fix hardcoding of id a in the run_mon function. The directory in which the mon data is stored must be a sub-directory of the directory given in argument. If mon_initial_members is set, the rbd pool cannot be redefined, which is ok because this is rare and it's only an optimization to reduce the number of PG. Signed-off-by: Loic Dachary --- src/test/ceph-helpers.sh | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/test/ceph-helpers.sh b/src/test/ceph-helpers.sh index 8280ef2fde2bd..af14f4eb04ffc 100755 --- a/src/test/ceph-helpers.sh +++ b/src/test/ceph-helpers.sh @@ -260,8 +260,11 @@ function test_kill_daemons() { # run_mon $dir a # spawn a mon and bind port 7018 # run_mon $dir a --debug-filestore=20 # spawn with filestore debugging # -# The default rbd pool is deleted and replaced with a replicated pool -# with less placement groups to speed up initialization. +# If mon_initial_members is not set, the default rbd pool is deleted +# and replaced with a replicated pool with less placement groups to +# speed up initialization. If mon_initial_members is set, no attempt +# is made to recreate the rbd pool because it would hang forever, +# waiting for other mons to join. # # A **dir**/ceph.conf file is created but not meant to be used by any # function. It is convenient for debugging a failure with: @@ -278,7 +281,7 @@ function run_mon() { shift local id=$1 shift - local data=$dir + local data=$dir/$id ceph-mon \ --id $id \ @@ -300,6 +303,7 @@ function run_mon() { --chdir= \ --mon-data=$data \ --log-file=$dir/\$name.log \ + --admin-socket=$dir/\$cluster-\$name.asok \ --mon-cluster-log-file=$dir/log \ --run-dir=$dir \ --pid-file=$dir/\$name.pid \ @@ -307,12 +311,13 @@ function run_mon() { cat > $dir/ceph.conf <