From ab58cce972f725be37575307c73b612dff84dad0 Mon Sep 17 00:00:00 2001 From: Kyle Harding Date: Wed, 14 Feb 2024 09:15:38 -0500 Subject: [PATCH] Test mounting an nfs share Change-type: patch Signed-off-by: Kyle Harding --- test/healthcheck.sh | 11 +++++++++++ test/setup.sh | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/test/healthcheck.sh b/test/healthcheck.sh index 2e26c75..c858c56 100644 --- a/test/healthcheck.sh +++ b/test/healthcheck.sh @@ -91,6 +91,17 @@ if command -v ping >/dev/null 2>&1; then ping -c 1 -M "do" -s 1472 "$(head -1 /etc/resolv.conf | awk '{print $2}')" fi +# test mounting nfs shares +# if this share goes away, just delete this test, no one will miss it +case $(id -u) in + 0) + mkdir -p /mnt/nfs + mount -t nfs nfs.product-os.io:/ /mnt/nfs -o fsc + ;; + *) + ;; +esac + if command -v curl >/dev/null 2>&1; then curl -fsSL https://raw.githubusercontent.com/dylanaraps/neofetch/7.1.0/neofetch | bash fi diff --git a/test/setup.sh b/test/setup.sh index 45cbca2..c31dd61 100644 --- a/test/setup.sh +++ b/test/setup.sh @@ -24,7 +24,7 @@ ubuntu | debian) # install packages required by healthchecks apt-get update - apt-get install -y ca-certificates cpu-checker curl gnupg iproute2 iptables iputils-ping kmod util-linux + apt-get install -y ca-certificates cpu-checker curl gnupg iproute2 iptables iputils-ping kmod util-linux nfs-common # Add Docker's official GPG key install -m 0755 -d /etc/apt/keyrings @@ -53,7 +53,7 @@ ubuntu | debian) ;; alpine) # install packages required by healthchecks - apk add --no-cache bash ca-certificates curl docker iproute2 iputils-ping kmod lsblk util-linux + apk add --no-cache bash ca-certificates curl docker iproute2 iputils-ping kmod lsblk util-linux nfs-common # create nonroot user for healthchecks adduser --disabled-password --gecos "" nonroot