Skip to content

Commit

Permalink
Merge pull request #538 from AndrewSirenko/modifyVolume
Browse files Browse the repository at this point in the history
Add ControllerModifyVolume RPC sanity tests
  • Loading branch information
k8s-ci-robot authored Aug 15, 2024
2 parents 7a77a22 + 4fe8f0b commit 79f5a9b
Show file tree
Hide file tree
Showing 9 changed files with 271 additions and 277 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

#ignore files specific to csi-test
bin/mock-driver
bin/*
cmd/csi-sanity/csi-sanity
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ build-sanity:
$(MAKE) -C cmd/csi-sanity all


TEST_HOSTPATH_VERSION=v1.7.3
TEST_HOSTPATH_VERSION=v1.14.1
TEST_HOSTPATH_SOURCE=bin/hostpath-source
TEST_HOSTPATH_REPO=https://github.com/kubernetes-csi/csi-driver-host-path.git
bin/hostpathplugin:
Expand Down
1 change: 1 addition & 0 deletions cmd/csi-sanity/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func main() {
int64Var(&config.TestVolumeSize, "testvolumesize", "Base volume size used for provisioned volumes")
int64Var(&config.TestVolumeExpandSize, "testvolumeexpandsize", "Target size for expanded volumes")
stringVar(&config.TestVolumeParametersFile, "testvolumeparameters", "YAML file of volume parameters for provisioned volumes")
stringVar(&config.TestVolumeMutableParametersFile, "testvolumemutableparameters", "YAML file of mutable parameters for modifying volumes")
stringVar(&config.TestSnapshotParametersFile, "testsnapshotparameters", "YAML file of snapshot parameters for provisioned snapshots")
boolVar(&config.TestNodeVolumeAttachLimit, "testnodevolumeattachlimit", "Test node volume attach limit")
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)")
Expand Down
14 changes: 10 additions & 4 deletions hack/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ TCP_SERVER="tcp://localhost:7654"
# ... and slightly differently for gRPC.
TCP_CLIENT="dns:///localhost:7654"
CSI_ENDPOINTS="$CSI_ENDPOINTS ${UDS}"
MUTABLE_PARAMETER_KEY="realKey"

# cleanup mock_driver_pid files...
cleanup () {
Expand All @@ -40,11 +41,16 @@ cleanup () {
runTest()
(
tmp=$(mktemp -d)
./bin/hostpathplugin -statedir "$tmp" -endpoint "$1" -nodeid fake-node-id &
./bin/hostpathplugin -statedir "$tmp" -endpoint "$1" -nodeid fake-node-id -enable-controller-modify-volume -accepted-mutable-parameter-names "$MUTABLE_PARAMETER_KEY" &
local pid=$!
trap 'cleanup $pid $1 $tmp' EXIT
trap 'cleanup $pid $1 $tmp $mutableparametersfile' EXIT

echo "$MUTABLE_PARAMETER_KEY: bar
" > testmutableparameters.yaml

local mutableparametersfile="$PWD/testmutableparameters.yaml"

./cmd/csi-sanity/csi-sanity $TESTARGS --csi.endpoint=$2 --csi.testnodevolumeattachlimit
./cmd/csi-sanity/csi-sanity $TESTARGS --csi.endpoint=$2 --csi.testnodevolumeattachlimit --csi.testvolumemutableparameters=$mutableparametersfile
)

runTestAPI()
Expand Down Expand Up @@ -106,7 +112,7 @@ fi
tmp=$(mktemp -d)
./bin/hostpathplugin -statedir "$tmp" -endpoint "$1" -nodeid fake-node-id &
local pid=$!
trap 'cleanup $pid $1 $tmp $creationscriptpath $removalscriptpath' EXIT
trap 'cleanup $pid $1 $tmp $creationscriptpath $removalscriptpath $checkscriptpath' EXIT

./cmd/csi-sanity/csi-sanity $TESTARGS \
--csi.endpoint=$2 \
Expand Down
Loading

0 comments on commit 79f5a9b

Please sign in to comment.