-
Notifications
You must be signed in to change notification settings - Fork 803
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run upstream e2e test suites with migration
- Loading branch information
Showing
13 changed files
with
868 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Prerequisites | ||
- kubernetes 1.16+ AWS cluster | ||
|
||
# Run | ||
```sh | ||
go test -v -timeout 0 ./... -kubeconfig=$HOME/.kube/config -report-dir=$ARTIFACTS -ginkgo.focus="\[ebs-csi-migration\]" -ginkgo.skip="\[Disruptive\]" -gce-zone=us-west-2a | ||
``` | ||
|
||
# Update dependencies | ||
```sh | ||
go mod edit -require=k8s.io/[email protected] | ||
./hack/update-gomod.sh v1.15.3 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
Copyright 2018 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package e2e | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"log" | ||
"os" | ||
"path" | ||
"path/filepath" | ||
"testing" | ||
|
||
"github.com/onsi/ginkgo" | ||
"github.com/onsi/ginkgo/config" | ||
"github.com/onsi/ginkgo/reporters" | ||
"github.com/onsi/gomega" | ||
"k8s.io/kubernetes/test/e2e/framework" | ||
"k8s.io/kubernetes/test/e2e/storage/drivers" | ||
"k8s.io/kubernetes/test/e2e/storage/testsuites" | ||
|
||
// ensure that cloud provider is loaded | ||
_ "k8s.io/kubernetes/test/e2e/framework/providers/aws" | ||
) | ||
|
||
const kubeconfigEnvVar = "KUBECONFIG" | ||
|
||
func init() { | ||
// k8s.io/kubernetes/test/e2e/framework requires env KUBECONFIG to be set | ||
// it does not fall back to defaults | ||
if os.Getenv(kubeconfigEnvVar) == "" { | ||
kubeconfig := filepath.Join(os.Getenv("HOME"), ".kube", "config") | ||
os.Setenv(kubeconfigEnvVar, kubeconfig) | ||
} | ||
framework.RegisterCommonFlags(flag.CommandLine) | ||
framework.RegisterClusterFlags(flag.CommandLine) | ||
_ = flag.Set("storage.migratedPlugins", "kubernetes.io/aws-ebs") | ||
_ = flag.Set("provider", "aws") | ||
flag.Parse() | ||
framework.AfterReadingAllFlags(&framework.TestContext) | ||
} | ||
|
||
func TestEBSCSI(t *testing.T) { | ||
gomega.RegisterFailHandler(ginkgo.Fail) | ||
|
||
// Run tests through the Ginkgo runner with output to console + JUnit for Jenkins | ||
var r []ginkgo.Reporter | ||
if framework.TestContext.ReportDir != "" { | ||
if err := os.MkdirAll(framework.TestContext.ReportDir, 0755); err != nil { | ||
log.Fatalf("Failed creating report directory: %v", err) | ||
} else { | ||
r = append(r, reporters.NewJUnitReporter(path.Join(framework.TestContext.ReportDir, fmt.Sprintf("junit_%v%02d.xml", framework.TestContext.ReportPrefix, config.GinkgoConfig.ParallelNode)))) | ||
} | ||
} | ||
log.Printf("Starting e2e run %q on Ginkgo node %d", framework.RunID, config.GinkgoConfig.ParallelNode) | ||
|
||
ginkgo.RunSpecsWithDefaultAndCustomReporters(t, "EBS CSI Migration Suite", r) | ||
} | ||
|
||
// List of testSuites to be executed in below loop | ||
var csiTestSuites = []func() testsuites.TestSuite{ | ||
testsuites.InitVolumesTestSuite, | ||
testsuites.InitVolumeIOTestSuite, | ||
testsuites.InitVolumeModeTestSuite, | ||
testsuites.InitSubPathTestSuite, | ||
testsuites.InitProvisioningTestSuite, | ||
testsuites.InitSnapshottableTestSuite, | ||
testsuites.InitVolumeExpandTestSuite, | ||
testsuites.InitMultiVolumeTestSuite, | ||
} | ||
|
||
var _ = ginkgo.Describe("[ebs-csi-migration] EBS CSI Migration", func() { | ||
// Init the *in-tree* driver. | ||
// The CSIMigration & CSIMigrationAWS feature gates must be enabled on the cluster. | ||
// The storage.migratedPlugins flag must be set to "kubernetes.io/aws-ebs". Then the tests will | ||
// validate that CSI, not in-tree, operations are happening. | ||
driver := drivers.InitAwsDriver() | ||
ginkgo.Context(testsuites.GetDriverNameWithFeatureTags(driver), func() { | ||
testsuites.DefineTestSuite(driver, csiTestSuites) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
module github.com/kubernetes-sigs/aws-ebs-csi-driver/tests/e2e-migration | ||
|
||
go 1.12 | ||
|
||
replace k8s.io/api => k8s.io/api v0.0.0-20190822053644-6185379c914a | ||
|
||
replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190822063004-0670dc4fec4e | ||
|
||
replace k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190820074809-31b1e1ea64dc | ||
|
||
replace k8s.io/apiserver => k8s.io/apiserver v0.0.0-20190822060508-785eacbd19ae | ||
|
||
replace k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20190822063658-442a64f3fed7 | ||
|
||
replace k8s.io/client-go => k8s.io/client-go v0.0.0-20190822054823-0a74433fb222 | ||
|
||
replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.0.0-20190822065847-2058b41dfbb6 | ||
|
||
replace k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.0.0-20190822065536-566e5fc137f7 | ||
|
||
replace k8s.io/code-generator => k8s.io/code-generator v0.0.0-20190820100630-060a3d12ce80 | ||
|
||
replace k8s.io/component-base => k8s.io/component-base v0.0.0-20190822055535-1f6a258f5d89 | ||
|
||
replace k8s.io/cri-api => k8s.io/cri-api v0.0.0-20190820110325-95eec93e2395 | ||
|
||
replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.0.0-20190822070154-f51cd605b3ee | ||
|
||
replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.0.0-20190822061015-a4f93a8219ed | ||
|
||
replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.0.0-20190822065235-826221481525 | ||
|
||
replace k8s.io/kube-proxy => k8s.io/kube-proxy v0.0.0-20190822064323-7e0495d8a3ff | ||
|
||
replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.0.0-20190822064931-4470440ed041 | ||
|
||
replace k8s.io/kubectl => k8s.io/kubectl v0.0.0-20190822071625-14af4a63a1e1 | ||
|
||
replace k8s.io/kubelet => k8s.io/kubelet v0.0.0-20190822064626-fa8f3d935631 | ||
|
||
replace k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.0.0-20190822070624-3a30a18bba71 | ||
|
||
replace k8s.io/metrics => k8s.io/metrics v0.0.0-20190822063337-6c03eb8600ee | ||
|
||
replace k8s.io/node-api => k8s.io/node-api v0.0.0-20190822070940-24e163ffb9e7 | ||
|
||
replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.0.0-20190822061642-ab22eab63834 | ||
|
||
replace k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.0.0-20190822064016-bcca3cc588da | ||
|
||
replace k8s.io/sample-controller => k8s.io/sample-controller v0.0.0-20190822062306-1b561d990eb5 | ||
|
||
require ( | ||
github.com/onsi/ginkgo v1.9.0 | ||
github.com/onsi/gomega v1.6.0 | ||
k8s.io/kubernetes v1.16.0-beta.1 | ||
) |
Oops, something went wrong.