qa/workunits/cephadm/test_cephadm.sh: systemctl stop nfs-server

stop any running nfs servers before attempting a deploy of nfs-ganesha

Signed-off-by: Michael Fritch <mfritch@suse.com>
This commit is contained in:
Michael Fritch 2020-02-28 09:14:41 -07:00
parent 606b79b19f
commit 8543e2e50b
No known key found for this signature in database
GPG Key ID: 75F3EB2E80A03B7F

View File

@ -89,7 +89,7 @@ fi
function expect_false()
{
set -x
if "$@"; then return 1; else return 0; fi
if eval "$@"; then return 1; else return 0; fi
}
function is_available()
@ -138,6 +138,20 @@ function dump_all_logs()
done
}
function nfs_stop()
{
# stop the running nfs server
local units="nfs-server nfs-kernel-server"
for unit in $units; do
if systemctl status $unit; then
$SUDO systemctl stop $unit
fi
done
# ensure the NFS port is no longer in use
expect_false "$SUDO ss -tlnp '( sport = :nfs )' | grep LISTEN"
}
## prepare + check host
$SUDO $CEPHADM check-host
@ -279,6 +293,7 @@ cond="curl --insecure 'https://localhost:3000' | grep -q 'grafana'"
is_available "grafana" "$cond" 30
# add nfs-ganesha
nfs_stop
nfs_rados_pool=$(cat ${CEPHADM_SAMPLES_DIR}/nfs.json | jq -r '.["pool"]')
$CEPHADM shell --fsid $FSID --config $CONFIG --keyring $KEYRING -- \
ceph osd pool create $nfs_rados_pool 64