From: Adam King Date: Wed, 24 Aug 2022 19:13:15 +0000 (-0400) Subject: qa/cephadm: remove fsid dir before bootstrap in test_cephadm.sh X-Git-Tag: v16.2.11~308^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d4d63f3b1e1ceb692cc98f6fe953eecc3bf72453;p=ceph.git qa/cephadm: remove fsid dir before bootstrap in test_cephadm.sh The shell commands we test beforehand can create the /var/lib/ceph/00000000-0000-0000-0000-0000deadbeef directory and that directory being present will block bootstrap as it will think a cluster with this fsid alreayd exists Fixes: https://tracker.ceph.com/issues/57290 Signed-off-by: Adam King (cherry picked from commit 7c825da44aee1245e8a17bcdc37512c226463bcf) --- diff --git a/qa/workunits/cephadm/test_cephadm.sh b/qa/workunits/cephadm/test_cephadm.sh index df463cb50bbb..6239d2934573 100755 --- a/qa/workunits/cephadm/test_cephadm.sh +++ b/qa/workunits/cephadm/test_cephadm.sh @@ -180,6 +180,14 @@ $CEPHADM shell --fsid $FSID -e FOO=BAR -- printenv | grep FOO=BAR # test stdin echo foo | $CEPHADM shell -- cat | grep -q foo +# the shell commands a bit above this seems to cause the +# /var/lib/ceph/ directory to be made. Since we now +# check in bootstrap that there are no clusters with the same +# fsid based on the directory existing, we need to make sure +# this directory is gone before bootstrapping. We can +# accomplish this with another rm-cluster +$CEPHADM rm-cluster --fsid $FSID --force + ## bootstrap ORIG_CONFIG=`mktemp -p $TMPDIR` CONFIG=`mktemp -p $TMPDIR`