]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/cephadm/test_cephadm.sh: systemctl stop nfs-server
authorMichael Fritch <mfritch@suse.com>
Fri, 28 Feb 2020 16:14:41 +0000 (09:14 -0700)
committerMichael Fritch <mfritch@suse.com>
Thu, 12 Mar 2020 14:08:59 +0000 (08:08 -0600)
stop any running nfs servers before attempting a deploy of nfs-ganesha

Signed-off-by: Michael Fritch <mfritch@suse.com>
qa/workunits/cephadm/test_cephadm.sh

index 36b3dab55dba5b2e88213b42ead7e045a349ff08..ad0a43631111b8bce98886e75a6f60727e39b1fa 100755 (executable)
@@ -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