File tree Expand file tree Collapse file tree 3 files changed +59
-0
lines changed Expand file tree Collapse file tree 3 files changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -270,3 +270,7 @@ test-shellcheck:
270
270
.PHONY : check-go-version-%
271
271
check-go-version-% :
272
272
./release-tools/verify-go-version.sh " $* "
273
+
274
+ .PHONY : sanity-test
275
+ sanity-test : build
276
+ test/sanity/run-test.sh
Original file line number Diff line number Diff line change
1
+ ## Sanity Tests
2
+ Testing the NFS CSI driver using the [ ` sanity ` ] ( https://github.com/kubernetes-csi/csi-test/tree/master/pkg/sanity ) package test suite.
3
+
4
+ ### Run sanity tests
5
+ ```
6
+ make sanity-test
7
+ ```
8
+
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Copyright 2019 The Kubernetes Authors.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ set -eo pipefail
18
+
19
+ function cleanup {
20
+ echo ' pkill -f nfsplugin'
21
+ pkill -f nfsplugin
22
+ echo ' Deleting CSI sanity test binary'
23
+ rm -rf csi-test
24
+ }
25
+ trap cleanup EXIT
26
+
27
+ function install_csi_sanity_bin {
28
+ echo ' Installing CSI sanity test binary...'
29
+ git clone https://github.com/kubernetes-csi/csi-test.git -b v2.2.0
30
+ pushd csi-test/cmd/csi-sanity
31
+ make
32
+ popd
33
+ }
34
+
35
+ install_csi_sanity_bin
36
+
37
+ readonly endpoint=' unix:///tmp/csi.sock'
38
+ nodeid=' CSINode'
39
+ if [[ " $# " -gt 0 ]] && [[ -n " $1 " ]]; then
40
+ nodeid=" $1 "
41
+ fi
42
+
43
+ bin/nfsplugin --endpoint " $endpoint " --nodeid " $nodeid " -v=5 &
44
+
45
+ echo ' Begin to run sanity test...'
46
+ readonly CSI_SANITY_BIN=' csi-test/cmd/csi-sanity/csi-sanity'
47
+ " $CSI_SANITY_BIN " --ginkgo.v --ginkgo.noColor --csi.endpoint=" $endpoint "
You can’t perform that action at this time.
0 commit comments