From 21f158daa25c7438a5f177ce519844c59a4c2154 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Tue, 13 Oct 2020 21:11:12 +0530 Subject: [PATCH] CI: update GH Actions for sanity-test Signed-off-by: Mayank Shah --- .github/workflows/sanity.yaml | 3 +++ test/sanity/params.yaml | 3 +++ test/sanity/run-test.sh | 8 +++++++- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/sanity/params.yaml diff --git a/.github/workflows/sanity.yaml b/.github/workflows/sanity.yaml index edc963f0..e27d116f 100644 --- a/.github/workflows/sanity.yaml +++ b/.github/workflows/sanity.yaml @@ -11,6 +11,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + - name: Install nfs-common + run: | + sudo apt-get install -y nfs-common - name: Run tests run: | make sanity-test \ No newline at end of file diff --git a/test/sanity/params.yaml b/test/sanity/params.yaml new file mode 100644 index 00000000..6fa8ed6d --- /dev/null +++ b/test/sanity/params.yaml @@ -0,0 +1,3 @@ + +server: 127.0.0.1 +share: / \ No newline at end of file diff --git a/test/sanity/run-test.sh b/test/sanity/run-test.sh index 787526e7..c28babed 100755 --- a/test/sanity/run-test.sh +++ b/test/sanity/run-test.sh @@ -32,6 +32,12 @@ function install_csi_sanity_bin { popd } +function provision_nfs_server { + echo 'Installing NFS server on localhost' + docker run -d --name nfs --privileged -p 2049:2049 -v $(pwd):/nfsshare -e SHARED_DIRECTORY=/nfsshare itsthenetwork/nfs-server-alpine:latest +} + +provision_nfs_server install_csi_sanity_bin readonly endpoint='unix:///tmp/csi.sock' @@ -44,4 +50,4 @@ bin/nfsplugin --endpoint "$endpoint" --nodeid "$nodeid" -v=5 & echo 'Begin to run sanity test...' readonly CSI_SANITY_BIN='csi-test/cmd/csi-sanity/csi-sanity' -"$CSI_SANITY_BIN" --ginkgo.v --ginkgo.noColor --csi.endpoint="$endpoint" --ginkgo.skip="ValidateVolumeCapabilities|ControllerGetCapabilities|should work" +"$CSI_SANITY_BIN" --ginkgo.v --ginkgo.noColor --csi.testvolumeparameters="$(pwd)/test/sanity/params.yaml" --csi.endpoint="$endpoint" --ginkgo.skip="should not fail when requesting to create a volume with already existing name and same capacity|ValidateVolumeCapabilities|ControllerGetCapabilities|should work"