Skip to content

Commit dc5c0a4

Browse files
committed
Port CCM specific core Service mutability e2e test
Implements a stripped down version of the Service mutability test from the Kubernetes core E2E test suite.
1 parent 8841eac commit dc5c0a4

File tree

118 files changed

+12896
-1010
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+12896
-1010
lines changed

Gopkg.lock

+41-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hack/boilerplate/boilerplate.py

+9
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ def file_extension(filename):
141141
"hack/boilerplate/boilerplate_test.py",
142142
"hack/boilerplate/test",
143143
"hack/verify-boilerplate.sh",
144+
145+
"test/e2e/e2e_test.go",
146+
"test/e2e/load_balancer_test.go",
147+
"test/e2e/framework/cleanup.go",
148+
"test/e2e/framework/framework.go",
149+
"test/e2e/framework/service_util.go",
150+
"test/e2e/framework/util.go",
151+
"test/e2e/framework/networking_utils.go",
152+
"test/e2e/framework/ginkgowrapper/wrapper.go",
144153
]
145154

146155

test/e2e/README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ E2E tests.
55

66
## Running
77

8+
9+
```bash
10+
$ ginkgo -v -progress test/e2e -- --kubeconfig=${HOME}/.kube/config --delete-namespace=false
811
```
9-
$ ginkgo test/e2e -v --progress -- --kubeconfig=$HOME/.kube/config
10-
```
12+
13+
NOTE: Test suite will fail if executed behind a `$HTTP_PROXY` that returns a
14+
200 OK response upon failure to connect.
1115

1216

1317
[1]: https://github.com/kubernetes/kubernetes/blob/0cb15453dae92d8be66cf42e6c1b04e21a2d0fb6/test/e2e/network/service.go

test/e2e/e2e_test.go

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2015 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package e2e
218

319
import (

test/e2e/framework/framework.go

+31-9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2015 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package framework
218

319
import (
@@ -23,10 +39,14 @@ const (
2339
)
2440

2541
// path to kubeconfig on disk.
26-
var kubeconfig string
42+
var (
43+
kubeconfig string
44+
deleteNamespace bool
45+
)
2746

2847
func init() {
2948
flag.StringVar(&kubeconfig, "kubeconfig", "", "Path to Kubeconfig file with authorization and master location information.")
49+
flag.BoolVar(&deleteNamespace, "delete-namespace", true, "If true tests will delete namespace after completion. It is only designed to make debugging easier, DO NOT turn it off by default.")
3050
}
3151

3252
// Framework is used in the execution of e2e tests.
@@ -159,14 +179,16 @@ func (f *Framework) AfterEach() {
159179
defer func() {
160180
nsDeletionErrors := map[string]error{}
161181

162-
// TODO: skip namespace deletion
163-
for _, ns := range f.namespacesToDelete {
164-
By(fmt.Sprintf("Destroying namespace %q for this suite.", ns.Name))
165-
if err := f.DeleteNamespace(ns.Name, 5*time.Minute); err != nil {
166-
if !apierrors.IsNotFound(err) {
167-
nsDeletionErrors[ns.Name] = err
168-
} else {
169-
Logf("Namespace %v was already deleted", ns.Name)
182+
if deleteNamespace {
183+
// TODO: skip namespace deletion
184+
for _, ns := range f.namespacesToDelete {
185+
By(fmt.Sprintf("Destroying namespace %q for this suite.", ns.Name))
186+
if err := f.DeleteNamespace(ns.Name, 5*time.Minute); err != nil {
187+
if !apierrors.IsNotFound(err) {
188+
nsDeletionErrors[ns.Name] = err
189+
} else {
190+
Logf("Namespace %v was already deleted", ns.Name)
191+
}
170192
}
171193
}
172194
}

0 commit comments

Comments
 (0)