From 8543e2e50b9bd453e4c4324765b4f0d2a5d90035 Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Fri, 28 Feb 2020 09:14:41 -0700 Subject: [PATCH] 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 --- qa/workunits/cephadm/test_cephadm.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/qa/workunits/cephadm/test_cephadm.sh b/qa/workunits/cephadm/test_cephadm.sh index 36b3dab55dba5..ad0a43631111b 100755 --- a/qa/workunits/cephadm/test_cephadm.sh +++ b/qa/workunits/cephadm/test_cephadm.sh @@ -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 -- 2.39.5