Skip to content

Commit 99ee0e1

Browse files
committed
Drop old sdn multitenant tests
test/extended/networking had a handful of tests whose primary purpose was to validate the difference between Subnet and Multitenant mode in openshift-sdn. These are no longer relevant. (There are upstream e2e tests for basic networking functionality if you don't care about the isolation distinction).
1 parent 5920fec commit 99ee0e1

File tree

4 files changed

+0
-285
lines changed

4 files changed

+0
-285
lines changed

test/extended/networking/isolation.go

Lines changed: 0 additions & 71 deletions
This file was deleted.

test/extended/networking/services.go

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -19,73 +19,7 @@ import (
1919
)
2020

2121
var _ = Describe("[sig-network] services", func() {
22-
Context("basic functionality", func() {
23-
f1 := e2e.NewDefaultFramework("net-services1")
24-
// TODO(sur): verify if privileged is really necessary in a follow-up
25-
f1.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
26-
27-
It("should allow connections to another pod on the same node via a service IP", func() {
28-
Expect(checkServiceConnectivity(f1, f1, SAME_NODE)).To(Succeed())
29-
})
30-
31-
It("should allow connections to another pod on a different node via a service IP", func() {
32-
Expect(checkServiceConnectivity(f1, f1, DIFFERENT_NODE)).To(Succeed())
33-
})
34-
})
35-
36-
InNonIsolatingContext(func() {
37-
f1 := e2e.NewDefaultFramework("net-services1")
38-
// TODO(sur): verify if privileged is really necessary in a follow-up
39-
f1.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
40-
f2 := e2e.NewDefaultFramework("net-services2")
41-
// TODO(sur): verify if privileged is really necessary in a follow-up
42-
f2.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
43-
44-
It("should allow connections to pods in different namespaces on the same node via service IPs", func() {
45-
Expect(checkServiceConnectivity(f1, f2, SAME_NODE)).To(Succeed())
46-
})
47-
48-
It("should allow connections to pods in different namespaces on different nodes via service IPs", func() {
49-
Expect(checkServiceConnectivity(f1, f2, DIFFERENT_NODE)).To(Succeed())
50-
})
51-
})
52-
5322
oc := exutil.NewCLIWithPodSecurityLevel("ns-global", admissionapi.LevelBaseline)
54-
55-
InIsolatingContext(func() {
56-
f1 := e2e.NewDefaultFramework("net-services1")
57-
// TODO(sur): verify if privileged is really necessary in a follow-up
58-
f1.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
59-
f2 := e2e.NewDefaultFramework("net-services2")
60-
// TODO(sur): verify if privileged is really necessary in a follow-up
61-
f2.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
62-
63-
It("should prevent connections to pods in different namespaces on the same node via service IPs", func() {
64-
Expect(checkServiceConnectivity(f1, f2, SAME_NODE)).NotTo(Succeed())
65-
})
66-
67-
It("should prevent connections to pods in different namespaces on different nodes via service IPs", func() {
68-
Expect(checkServiceConnectivity(f1, f2, DIFFERENT_NODE)).NotTo(Succeed())
69-
})
70-
71-
It("should allow connections to services in the default namespace from a pod in another namespace on the same node", func() {
72-
makeNamespaceGlobal(oc, f1.Namespace)
73-
Expect(checkServiceConnectivity(f1, f2, SAME_NODE)).To(Succeed())
74-
})
75-
It("should allow connections to services in the default namespace from a pod in another namespace on a different node", func() {
76-
makeNamespaceGlobal(oc, f1.Namespace)
77-
Expect(checkServiceConnectivity(f1, f2, DIFFERENT_NODE)).To(Succeed())
78-
})
79-
It("should allow connections from pods in the default namespace to a service in another namespace on the same node", func() {
80-
makeNamespaceGlobal(oc, f2.Namespace)
81-
Expect(checkServiceConnectivity(f1, f2, SAME_NODE)).To(Succeed())
82-
})
83-
It("should allow connections from pods in the default namespace to a service in another namespace on a different node", func() {
84-
makeNamespaceGlobal(oc, f2.Namespace)
85-
Expect(checkServiceConnectivity(f1, f2, DIFFERENT_NODE)).To(Succeed())
86-
})
87-
})
88-
8923
var retryInterval = 1 * time.Minute
9024

9125
InIPv4ClusterContext(oc, func() {

test/extended/networking/util.go

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"fmt"
88
"math/rand"
99
"net"
10-
"os"
1110
"os/exec"
1211
"path/filepath"
1312
"strconv"
@@ -21,7 +20,6 @@ import (
2120
projectv1 "github.com/openshift/api/project/v1"
2221
configv1client "github.com/openshift/client-go/config/clientset/versioned"
2322
networkclient "github.com/openshift/client-go/network/clientset/versioned/typed/network/v1"
24-
"github.com/openshift/library-go/pkg/network/networkutils"
2523
exutil "github.com/openshift/origin/test/extended/util"
2624
appsv1 "k8s.io/api/apps/v1"
2725
corev1 "k8s.io/api/core/v1"
@@ -33,7 +31,6 @@ import (
3331
"k8s.io/apimachinery/pkg/util/intstr"
3432
"k8s.io/apimachinery/pkg/util/sets"
3533
"k8s.io/apimachinery/pkg/util/wait"
36-
"k8s.io/apiserver/pkg/storage/names"
3734
"k8s.io/client-go/dynamic"
3835
"k8s.io/client-go/kubernetes"
3936
k8sclient "k8s.io/client-go/kubernetes"
@@ -282,29 +279,6 @@ func networkPluginName() string {
282279
return *cachedNetworkPluginName
283280
}
284281

285-
func pluginIsolatesNamespaces() bool {
286-
if os.Getenv("NETWORKING_E2E_ISOLATION") == "true" {
287-
return true
288-
}
289-
// Assume that only the OpenShift SDN "multitenant" plugin isolates by default
290-
return openshiftSDNMode() == networkutils.MultiTenantPluginName
291-
}
292-
293-
func pluginImplementsNetworkPolicy() bool {
294-
switch {
295-
case os.Getenv("NETWORKING_E2E_NETWORKPOLICY") == "true":
296-
return true
297-
case networkPluginName() == OpenshiftSDNPluginName && openshiftSDNMode() == networkutils.NetworkPolicyPluginName:
298-
return true
299-
case networkPluginName() == OVNKubernetesPluginName:
300-
return true
301-
default:
302-
// If we can't detect the plugin, we assume it doesn't support
303-
// NetworkPolicy, so the tests will work under kubenet
304-
return false
305-
}
306-
}
307-
308282
func makeNamespaceGlobal(oc *exutil.CLI, ns *corev1.Namespace) {
309283
clientConfig := oc.AdminConfig()
310284
networkClient := networkclient.NewForConfigOrDie(clientConfig)
@@ -432,92 +406,6 @@ func findAppropriateNodes(f *e2e.Framework, nodeType NodeType) (*corev1.Node, *c
432406
return &candidates[0], &candidates[0], nil
433407
}
434408

435-
func checkPodIsolation(f1, f2 *e2e.Framework, nodeType NodeType) error {
436-
makeNamespaceScheduleToAllNodes(f1)
437-
makeNamespaceScheduleToAllNodes(f2)
438-
serverNode, clientNode, err := findAppropriateNodes(f1, nodeType)
439-
if err != nil {
440-
return err
441-
}
442-
podName := "isolation-webserver"
443-
defer f1.ClientSet.CoreV1().Pods(f1.Namespace.Name).Delete(context.Background(), podName, metav1.DeleteOptions{})
444-
ip := exutil.LaunchWebserverPod(f1.ClientSet, f1.Namespace.Name, podName, serverNode.Name)
445-
446-
return checkConnectivityToHost(f2, clientNode.Name, "isolation-wget", ip, 10*time.Second)
447-
}
448-
449-
func checkServiceConnectivity(serverFramework, clientFramework *e2e.Framework, nodeType NodeType) error {
450-
makeNamespaceScheduleToAllNodes(serverFramework)
451-
makeNamespaceScheduleToAllNodes(clientFramework)
452-
serverNode, clientNode, err := findAppropriateNodes(serverFramework, nodeType)
453-
if err != nil {
454-
return err
455-
}
456-
podName := names.SimpleNameGenerator.GenerateName("service-")
457-
defer serverFramework.ClientSet.CoreV1().Pods(serverFramework.Namespace.Name).Delete(context.Background(), podName, metav1.DeleteOptions{})
458-
defer serverFramework.ClientSet.CoreV1().Services(serverFramework.Namespace.Name).Delete(context.Background(), podName, metav1.DeleteOptions{})
459-
ip := launchWebserverService(serverFramework.ClientSet, serverFramework.Namespace.Name, podName, serverNode.Name)
460-
461-
return checkConnectivityToHost(clientFramework, clientNode.Name, "service-wget", ip, 10*time.Second)
462-
}
463-
464-
func InNonIsolatingContext(body func()) {
465-
Context("when using a plugin in a mode that does not isolate namespaces by default", func() {
466-
BeforeEach(func() {
467-
if pluginIsolatesNamespaces() {
468-
e2eskipper.Skipf("This plugin isolates namespaces by default.")
469-
}
470-
})
471-
472-
body()
473-
})
474-
}
475-
476-
func InIsolatingContext(body func()) {
477-
Context("when using a plugin in a mode that isolates namespaces by default", func() {
478-
BeforeEach(func() {
479-
if !pluginIsolatesNamespaces() {
480-
e2eskipper.Skipf("This plugin does not isolate namespaces by default.")
481-
}
482-
})
483-
484-
body()
485-
})
486-
}
487-
488-
func InNetworkPolicyContext(body func()) {
489-
Context("when using a plugin that implements NetworkPolicy", func() {
490-
BeforeEach(func() {
491-
if !pluginImplementsNetworkPolicy() {
492-
e2eskipper.Skipf("This plugin does not implement NetworkPolicy.")
493-
}
494-
})
495-
496-
body()
497-
})
498-
}
499-
500-
func InopenshiftSDNModeContext(plugins []string, body func()) {
501-
Context(fmt.Sprintf("when using one of the OpenshiftSDN modes '%s'", strings.Join(plugins, ", ")),
502-
func() {
503-
BeforeEach(func() {
504-
found := false
505-
for _, plugin := range plugins {
506-
if openshiftSDNMode() == plugin {
507-
found = true
508-
break
509-
}
510-
}
511-
if !found {
512-
e2eskipper.Skipf("Not using one of the specified OpenshiftSDN modes")
513-
}
514-
})
515-
516-
body()
517-
},
518-
)
519-
}
520-
521409
func InOpenShiftSDNContext(body func()) {
522410
Context("when using openshift-sdn",
523411
func() {

test/extended/util/annotate/generated/zz_generated.annotations.go

Lines changed: 0 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)