Skip to content

Commit 4fe8f0b

Browse files
committed
Add ControllerModifyVolume RPC sanity tests
1 parent 56ba74f commit 4fe8f0b

File tree

9 files changed

+271
-277
lines changed

9 files changed

+271
-277
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
#ignore files specific to csi-test
3-
bin/mock-driver
3+
bin/*
44
cmd/csi-sanity/csi-sanity

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ build-sanity:
3838
$(MAKE) -C cmd/csi-sanity all
3939

4040

41-
TEST_HOSTPATH_VERSION=v1.7.3
41+
TEST_HOSTPATH_VERSION=v1.14.1
4242
TEST_HOSTPATH_SOURCE=bin/hostpath-source
4343
TEST_HOSTPATH_REPO=https://github.com/kubernetes-csi/csi-driver-host-path.git
4444
bin/hostpathplugin:

cmd/csi-sanity/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ func main() {
8888
int64Var(&config.TestVolumeSize, "testvolumesize", "Base volume size used for provisioned volumes")
8989
int64Var(&config.TestVolumeExpandSize, "testvolumeexpandsize", "Target size for expanded volumes")
9090
stringVar(&config.TestVolumeParametersFile, "testvolumeparameters", "YAML file of volume parameters for provisioned volumes")
91+
stringVar(&config.TestVolumeMutableParametersFile, "testvolumemutableparameters", "YAML file of mutable parameters for modifying volumes")
9192
stringVar(&config.TestSnapshotParametersFile, "testsnapshotparameters", "YAML file of snapshot parameters for provisioned snapshots")
9293
boolVar(&config.TestNodeVolumeAttachLimit, "testnodevolumeattachlimit", "Test node volume attach limit")
9394
flag.Var(flag.Lookup("ginkgo.junit-report").Value, prefix+"junitfile", "JUnit XML output file where test results will be written (deprecated: use ginkgo.junit-report instead)")

hack/e2e.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ TCP_SERVER="tcp://localhost:7654"
2222
# ... and slightly differently for gRPC.
2323
TCP_CLIENT="dns:///localhost:7654"
2424
CSI_ENDPOINTS="$CSI_ENDPOINTS ${UDS}"
25+
MUTABLE_PARAMETER_KEY="realKey"
2526

2627
# cleanup mock_driver_pid files...
2728
cleanup () {
@@ -40,11 +41,16 @@ cleanup () {
4041
runTest()
4142
(
4243
tmp=$(mktemp -d)
43-
./bin/hostpathplugin -statedir "$tmp" -endpoint "$1" -nodeid fake-node-id &
44+
./bin/hostpathplugin -statedir "$tmp" -endpoint "$1" -nodeid fake-node-id -enable-controller-modify-volume -accepted-mutable-parameter-names "$MUTABLE_PARAMETER_KEY" &
4445
local pid=$!
45-
trap 'cleanup $pid $1 $tmp' EXIT
46+
trap 'cleanup $pid $1 $tmp $mutableparametersfile' EXIT
47+
48+
echo "$MUTABLE_PARAMETER_KEY: bar
49+
" > testmutableparameters.yaml
50+
51+
local mutableparametersfile="$PWD/testmutableparameters.yaml"
4652

47-
./cmd/csi-sanity/csi-sanity $TESTARGS --csi.endpoint=$2 --csi.testnodevolumeattachlimit
53+
./cmd/csi-sanity/csi-sanity $TESTARGS --csi.endpoint=$2 --csi.testnodevolumeattachlimit --csi.testvolumemutableparameters=$mutableparametersfile
4854
)
4955

5056
runTestAPI()
@@ -106,7 +112,7 @@ fi
106112
tmp=$(mktemp -d)
107113
./bin/hostpathplugin -statedir "$tmp" -endpoint "$1" -nodeid fake-node-id &
108114
local pid=$!
109-
trap 'cleanup $pid $1 $tmp $creationscriptpath $removalscriptpath' EXIT
115+
trap 'cleanup $pid $1 $tmp $creationscriptpath $removalscriptpath $checkscriptpath' EXIT
110116

111117
./cmd/csi-sanity/csi-sanity $TESTARGS \
112118
--csi.endpoint=$2 \

0 commit comments

Comments
 (0)