@@ -154,6 +154,7 @@ configvar CSI_PROW_WORK "$(mkdir -p "$GOPATH/pkg" && mktemp -d "$GOPATH/pkg/csip
154
154
configvar CSI_PROW_HOSTPATH_VERSION fc52d13ba07922c80555a24616a5b16480350c3f " hostpath driver" # pre-1.1.0
155
155
configvar CSI_PROW_HOSTPATH_REPO https://github.com/kubernetes-csi/csi-driver-host-path " hostpath repo"
156
156
configvar CSI_PROW_DEPLOYMENT " " " deployment"
157
+ configvar CSI_PROW_DEPLOY_SCRIPT " deploy-hostpath.sh" " deploy script inside the deployment directory"
157
158
158
159
# If CSI_PROW_HOSTPATH_CANARY is set (typically to "canary", but also
159
160
# "1.0-canary"), then all image versions are replaced with that
@@ -176,6 +177,7 @@ configvar CSI_PROW_E2E_IMPORT_PATH_LATEST k8s.io/kubernetes "E2E package for Kub
176
177
configvar CSI_PROW_E2E_VERSION " $( get_versioned_variable CSI_PROW_E2E_VERSION " ${csi_prow_kubernetes_version_suffix} " ) " " E2E version"
177
178
configvar CSI_PROW_E2E_REPO " $( get_versioned_variable CSI_PROW_E2E_REPO " ${csi_prow_kubernetes_version_suffix} " ) " " E2E repo"
178
179
configvar CSI_PROW_E2E_IMPORT_PATH " $( get_versioned_variable CSI_PROW_E2E_IMPORT_PATH " ${csi_prow_kubernetes_version_suffix} " ) " " E2E package"
180
+ configvar CSI_PROW_E2E_TEST_PREFIX " External Storage" " common name of all E2E tests"
179
181
180
182
# csi-sanity testing from the csi-test repo can be run against the installed
181
183
# CSI driver. For this to work, deploying the driver must expose the Unix ___domain
@@ -520,7 +522,7 @@ find_deployment () {
520
522
521
523
# Fixed deployment name? Use it if it exists, otherwise fail.
522
524
if [ " ${CSI_PROW_DEPLOYMENT} " ]; then
523
- file=" $dir /${CSI_PROW_DEPLOYMENT} /deploy-hostpath.sh "
525
+ file=" $dir /${CSI_PROW_DEPLOYMENT} /${CSI_PROW_DEPLOY_SCRIPT} "
524
526
if ! [ -e " $file " ]; then
525
527
return 1
526
528
fi
@@ -530,22 +532,23 @@ find_deployment () {
530
532
531
533
# Ignore: See if you can use ${variable//search/replace} instead.
532
534
# shellcheck disable=SC2001
533
- file=" $dir /kubernetes-$( echo " ${CSI_PROW_KUBERNETES_VERSION} " | sed -e ' s/\([0-9]*\)\.\([0-9]*\).*/\1.\2/' ) /deploy-hostpath.sh "
535
+ file=" $dir /kubernetes-$( echo " ${CSI_PROW_KUBERNETES_VERSION} " | sed -e ' s/\([0-9]*\)\.\([0-9]*\).*/\1.\2/' ) /${CSI_PROW_DEPLOY_SCRIPT} "
534
536
if ! [ -e " $file " ]; then
535
- file=" $dir /kubernetes-latest/deploy-hostpath.sh "
537
+ file=" $dir /kubernetes-latest/${CSI_PROW_DEPLOY_SCRIPT} "
536
538
if ! [ -e " $file " ]; then
537
539
return 1
538
540
fi
539
541
fi
540
542
echo " $file "
541
543
}
542
544
543
- # This installs the hostpath driver example. CSI_PROW_HOSTPATH_CANARY overrides all
544
- # image versions with that canary version. The parameters of install_hostpath can be
545
+ # This installs the driver from the current repo or (if none found and CSI_PROW_HOSTPATH_REPO is set)
546
+ # the hostpath driver example. CSI_PROW_HOSTPATH_CANARY overrides all
547
+ # image versions with that canary version. The parameters of install_driver can be
545
548
# used to override registry and/or tag of individual images (CSI_PROVISIONER_REGISTRY=localhost:9000
546
549
# CSI_PROVISIONER_TAG=latest).
547
- install_hostpath () {
548
- local images deploy_hostpath
550
+ install_driver () {
551
+ local images deploy
549
552
images=" $* "
550
553
551
554
if [ " ${CSI_PROW_DEPLOYMENT} " = " none" ]; then
@@ -561,16 +564,16 @@ install_hostpath () {
561
564
done
562
565
fi
563
566
564
- if deploy_hostpath =" $( find_deployment " $( pwd) /deploy" ) " ; then
567
+ if deploy =" $( find_deployment " $( pwd) /deploy" ) " ; then
565
568
:
566
569
elif [ " ${CSI_PROW_HOSTPATH_REPO} " = " none" ]; then
567
570
return 1
568
571
else
569
572
git_checkout " ${CSI_PROW_HOSTPATH_REPO} " " ${CSI_PROW_WORK} /hostpath" " ${CSI_PROW_HOSTPATH_VERSION} " --depth=1 || die " checking out hostpath repo failed"
570
- if deploy_hostpath =" $( find_deployment " ${CSI_PROW_WORK} /hostpath/deploy" ) " ; then
573
+ if deploy =" $( find_deployment " ${CSI_PROW_WORK} /hostpath/deploy" ) " ; then
571
574
:
572
575
else
573
- die " deploy-hostpath.sh not found in ${CSI_PROW_HOSTPATH_REPO} ${CSI_PROW_HOSTPATH_VERSION} . To disable E2E testing, set CSI_PROW_HOSTPATH_REPO=none"
576
+ die " ${CSI_PROW_DEPLOY_SCRIPT} not found in ${CSI_PROW_HOSTPATH_REPO} ${CSI_PROW_HOSTPATH_VERSION} . To disable E2E testing, set CSI_PROW_HOSTPATH_REPO=none"
574
577
fi
575
578
fi
576
579
@@ -580,12 +583,12 @@ install_hostpath () {
580
583
# Ignore: Double quote to prevent globbing and word splitting.
581
584
# It's intentional here for $images.
582
585
# shellcheck disable=SC2086
583
- if ! run env $images " ${deploy_hostpath } " ; then
586
+ if ! run env $images " ${deploy } " ; then
584
587
# Collect information about failed deployment before failing.
585
588
collect_cluster_info
586
589
(start_loggers > /dev/null; wait)
587
590
info " For container output see job artifacts."
588
- die " deploying the hostpath driver with ${deploy_hostpath } failed"
591
+ die " deploying the CSI driver with ${deploy } failed"
589
592
fi
590
593
}
591
594
@@ -686,6 +689,16 @@ run_filter_junit () {
686
689
run_with_go " ${CSI_PROW_GO_VERSION_BUILD} " go run " ${RELEASE_TOOLS_ROOT} /filter-junit.go" " $@ "
687
690
}
688
691
692
+ # Rename, merge and filter JUnit files. Necessary in case that we run the E2E suite again
693
+ # and to avoid the large number of " skipped" tests that we get from using
694
+ # the full Kubernetes E2E testsuite while only running a few tests.
695
+ move_junit () {
696
+ local name=" $1 "
697
+ if ls " ${ARTIFACTS} " /junit_[0-9]*.xml 2>/dev/null >/dev/null; then
698
+ run_filter_junit -t=" ${CSI_PROW_E2E_TEST_PREFIX} " -o " ${ARTIFACTS} /junit_${name} .xml" " ${ARTIFACTS} " /junit_[0-9]*.xml && rm -f " ${ARTIFACTS} " /junit_[0-9]*.xml
699
+ fi
700
+ }
701
+
689
702
# Runs the E2E test suite in a sub-shell.
690
703
run_e2e () (
691
704
name=" $1 "
@@ -716,15 +729,7 @@ DriverInfo:
716
729
multipods: true
717
730
EOF
718
731
719
- # Rename, merge and filter JUnit files. Necessary in case that we run the E2E suite again
720
- # and to avoid the large number of " skipped" tests that we get from using
721
- # the full Kubernetes E2E testsuite while only running a few tests.
722
- move_junit () {
723
- if ls " ${ARTIFACTS} " /junit_[0-9]*.xml 2>/dev/null >/dev/null; then
724
- run_filter_junit -t=" External Storage" -o " ${ARTIFACTS} /junit_${name} .xml" " ${ARTIFACTS} " /junit_[0-9]*.xml && rm -f " ${ARTIFACTS} " /junit_[0-9]*.xml
725
- fi
726
- }
727
- trap move_junit EXIT
732
+ trap " move_junit ' $name' " EXIT
728
733
729
734
cd " ${GOPATH} /src/${CSI_PROW_E2E_IMPORT_PATH} " &&
730
735
run_with_loggers ginkgo -v " $@ " " ${CSI_PROW_WORK} /e2e.test" -- -report-dir " ${ARTIFACTS} " -storage.testdriver=" ${CSI_PROW_WORK} /hostpath-test-driver.yaml"
@@ -893,7 +898,7 @@ main () {
893
898
cmds=" $( grep ' ^\s*CMDS\s*=' Makefile | sed -e ' s/\s*CMDS\s*=//' ) "
894
899
# Get the image that was just built (if any) from the
895
900
# top-level Makefile CMDS variable and set the
896
- # deploy-hostpath.sh env variables for it. We also need to
901
+ # deploy env variables for it. We also need to
897
902
# side-load those images into the cluster.
898
903
for i in $cmds ; do
899
904
e=$( echo " $i " | tr ' [:lower:]' ' [:upper:]' | tr - _)
@@ -921,7 +926,7 @@ main () {
921
926
start_cluster || die " starting the non-alpha cluster failed"
922
927
923
928
# Installing the driver might be disabled.
924
- if install_hostpath " $images " ; then
929
+ if install_driver " $images " ; then
925
930
collect_cluster_info
926
931
927
932
if sanity_enabled; then
@@ -934,7 +939,7 @@ main () {
934
939
# Ignore: Double quote to prevent globbing and word splitting.
935
940
# shellcheck disable=SC2086
936
941
if ! run_e2e parallel ${CSI_PROW_GINKO_PARALLEL} \
937
- -focus=" External.Storage " \
942
+ -focus=" ${CSI_PROW_E2E_TEST_PREFIX} " \
938
943
-skip=" $( regex_join " ${CSI_PROW_E2E_SERIAL} " " ${CSI_PROW_E2E_ALPHA} " " ${CSI_PROW_E2E_SKIP} " ) " ; then
939
944
warn " E2E parallel failed"
940
945
ret=1
@@ -943,7 +948,7 @@ main () {
943
948
944
949
if tests_enabled " serial" ; then
945
950
if ! run_e2e serial \
946
- -focus=" External.Storage .*($( regex_join " ${CSI_PROW_E2E_SERIAL} " ) )" \
951
+ -focus=" ${CSI_PROW_E2E_TEST_PREFIX} .*($( regex_join " ${CSI_PROW_E2E_SERIAL} " ) )" \
947
952
-skip=" $( regex_join " ${CSI_PROW_E2E_ALPHA} " " ${CSI_PROW_E2E_SKIP} " ) " ; then
948
953
warn " E2E serial failed"
949
954
ret=1
@@ -957,14 +962,14 @@ main () {
957
962
start_cluster " ${CSI_PROW_E2E_ALPHA_GATES} " || die " starting alpha cluster failed"
958
963
959
964
# Installing the driver might be disabled.
960
- if install_hostpath " $images " ; then
965
+ if install_driver " $images " ; then
961
966
collect_cluster_info
962
967
963
968
if tests_enabled " parallel-alpha" ; then
964
969
# Ignore: Double quote to prevent globbing and word splitting.
965
970
# shellcheck disable=SC2086
966
971
if ! run_e2e parallel-alpha ${CSI_PROW_GINKO_PARALLEL} \
967
- -focus=" External.Storage .*($( regex_join " ${CSI_PROW_E2E_ALPHA} " ) )" \
972
+ -focus=" ${CSI_PROW_E2E_TEST_PREFIX} .*($( regex_join " ${CSI_PROW_E2E_ALPHA} " ) )" \
968
973
-skip=" $( regex_join " ${CSI_PROW_E2E_SERIAL} " " ${CSI_PROW_E2E_SKIP} " ) " ; then
969
974
warn " E2E parallel alpha failed"
970
975
ret=1
@@ -973,7 +978,7 @@ main () {
973
978
974
979
if tests_enabled " serial-alpha" ; then
975
980
if ! run_e2e serial-alpha \
976
- -focus=" External.Storage .*(($( regex_join " ${CSI_PROW_E2E_SERIAL} " ) ).*($( regex_join " ${CSI_PROW_E2E_ALPHA} " ) )|($( regex_join " ${CSI_PROW_E2E_ALPHA} " ) ).*($( regex_join " ${CSI_PROW_E2E_SERIAL} " ) ))" \
981
+ -focus=" ${CSI_PROW_E2E_TEST_PREFIX} .*(($( regex_join " ${CSI_PROW_E2E_SERIAL} " ) ).*($( regex_join " ${CSI_PROW_E2E_ALPHA} " ) )|($( regex_join " ${CSI_PROW_E2E_ALPHA} " ) ).*($( regex_join " ${CSI_PROW_E2E_SERIAL} " ) ))" \
977
982
-skip=" $( regex_join " ${CSI_PROW_E2E_SKIP} " ) " ; then
978
983
warn " E2E serial alpha failed"
979
984
ret=1
0 commit comments