Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix E2E IPv6 tests: adapt addresses and subnets #2505

Merged
merged 1 commit into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 44 additions & 18 deletions test/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,10 @@ var _ = ginkgo.Describe("e2e control plane", func() {
var svcname = "nettest"

f := framework.NewDefaultFramework(svcname)
var numMasters int
var (
extDNSIP string
numMasters int
)

ginkgo.BeforeEach(func() {
// Assert basic external connectivity.
Expand All @@ -479,15 +482,19 @@ var _ = ginkgo.Describe("e2e control plane", func() {
})
framework.ExpectNoError(err)
numMasters = len(masterPods.Items)
extDNSIP = "8.8.8.8"
if IsIPv6Cluster(f.ClientSet) {
kyrtapz marked this conversation as resolved.
Show resolved Hide resolved
extDNSIP = "2001:4860:4860::8888"
}
})

ginkgo.It("should provide Internet connection continuously when ovn-k8s pod is killed", func() {
ginkgo.By("Running container which tries to connect to 8.8.8.8 in a loop")
ginkgo.By(fmt.Sprintf("Running container which tries to connect to %s in a loop", extDNSIP))

podChan, errChan := make(chan *v1.Pod), make(chan error)
go func() {
defer ginkgo.GinkgoRecover()
checkContinuousConnectivity(f, "", "connectivity-test-continuous", "8.8.8.8", 53, 30, 30, podChan, errChan)
checkContinuousConnectivity(f, "", "connectivity-test-continuous", extDNSIP, 53, 30, 30, podChan, errChan)
}()

testPod := <-podChan
Expand All @@ -506,12 +513,12 @@ var _ = ginkgo.Describe("e2e control plane", func() {
})

ginkgo.It("should provide Internet connection continuously when master is killed", func() {
ginkgo.By("Running container which tries to connect to 8.8.8.8 in a loop")
ginkgo.By(fmt.Sprintf("Running container which tries to connect to %s in a loop", extDNSIP))

podChan, errChan := make(chan *v1.Pod), make(chan error)
go func() {
defer ginkgo.GinkgoRecover()
checkContinuousConnectivity(f, "", "connectivity-test-continuous", "8.8.8.8", 53, 30, 30, podChan, errChan)
checkContinuousConnectivity(f, "", "connectivity-test-continuous", extDNSIP, 53, 30, 30, podChan, errChan)
}()
testPod := <-podChan
framework.Logf("Test pod running on %q", testPod.Spec.NodeName)
Expand Down Expand Up @@ -1488,10 +1495,8 @@ var _ = ginkgo.Describe("e2e non-vxlan external gateway and update validation",
// is properly handled as defined in the crd configuration in the test.
var _ = ginkgo.Describe("e2e egress firewall policy validation", func() {
const (
svcname string = "egress-firewall-policy"
exFWPermitTcpDnsDest string = "8.8.8.8"
exFWDenyTcpDnsDest string = "8.8.4.4"
exFWPermitTcpWwwDest string = "1.1.1.1"
svcname string = "egress-firewall-policy"

ovnContainer string = "ovnkube-node"
egressFirewallYamlFile string = "egress-fw.yml"
testTimeout string = "5"
Expand All @@ -1505,7 +1510,13 @@ var _ = ginkgo.Describe("e2e egress firewall policy validation", func() {
}

var (
serverNodeInfo nodeInfo
serverNodeInfo nodeInfo
exFWPermitTcpDnsDest string
singleIPMask string
exFWDenyTcpDnsDest string
exFWPermitTcpWwwDest string
exFWPermitCIDR string
exFWDenyCIDR string
)

f := framework.NewDefaultFramework(svcname)
Expand All @@ -1526,6 +1537,21 @@ var _ = ginkgo.Describe("e2e egress firewall policy validation", func() {
name: nodes.Items[1].Name,
nodeIP: ips[1],
}

exFWPermitTcpDnsDest = "8.8.8.8"
exFWDenyTcpDnsDest = "8.8.4.4"
exFWPermitTcpWwwDest = "1.1.1.1"
exFWPermitCIDR = "1.1.1.0/24"
exFWDenyCIDR = "0.0.0.0/0"
singleIPMask = "32"
if IsIPv6Cluster(f.ClientSet) {
exFWPermitTcpDnsDest = "2001:4860:4860::8888"
exFWDenyTcpDnsDest = "2001:4860:4860::8844"
exFWPermitTcpWwwDest = "2606:4700:4700::1111"
exFWPermitCIDR = "2606:4700:4700::/64"
exFWDenyCIDR = "::/0"
singleIPMask = "128"
}
})

ginkgo.AfterEach(func() {})
Expand All @@ -1546,17 +1572,17 @@ spec:
egress:
- type: Allow
to:
cidrSelector: 8.8.8.8/32
cidrSelector: %s/%s
- type: Allow
to:
cidrSelector: 1.1.1.0/24
cidrSelector: %s
ports:
- protocol: TCP
port: 80
- type: Deny
to:
cidrSelector: 0.0.0.0/0
`, f.Namespace.Name)
cidrSelector: %s
`, f.Namespace.Name, exFWPermitTcpDnsDest, singleIPMask, exFWPermitCIDR, exFWDenyCIDR)
// write the config to a file for application and defer the removal
if err := ioutil.WriteFile(egressFirewallYamlFile, []byte(egressFirewallConfig), 0644); err != nil {
framework.Failf("Unable to write CRD config to disk: %v", err)
Expand Down Expand Up @@ -1628,7 +1654,7 @@ spec:
egress:
- type: Allow
to:
cidrSelector: 8.8.8.8/32
cidrSelector: %s/%s
- type: Allow
to:
dnsName: www.test1.com
Expand Down Expand Up @@ -1667,14 +1693,14 @@ spec:
dnsName: www.test12.com
- type: Allow
to:
cidrSelector: 1.1.1.0/24
cidrSelector: %s
ports:
- protocol: TCP
port: 80
- type: Deny
to:
cidrSelector: 0.0.0.0/0
`, f.Namespace.Name)
cidrSelector: %s
`, f.Namespace.Name, exFWPermitTcpDnsDest, singleIPMask, exFWPermitCIDR, exFWDenyCIDR)
// write the config to a file for application and defer the removal
if err := ioutil.WriteFile(egressFirewallYamlFile, []byte(egressFirewallConfig), 0644); err != nil {
framework.Failf("Unable to write CRD config to disk: %v", err)
Expand Down
4 changes: 0 additions & 4 deletions test/scripts/e2e-cp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ export KUBECONFIG=${HOME}/admin.conf
# Skip tests which are not IPv6 ready yet (see description of https://github.com/ovn-org/ovn-kubernetes/pull/2276)
IPV6_SKIPPED_TESTS="Should be allowed by externalip services|\
should provide connection to external host by DNS name from a pod|\
should provide Internet connection continuously when master is killed|\
should provide Internet connection continuously when ovn-k8s pod is killed|\
Should validate connectivity from a pod to a non-node host address on same node|\
Should validate connectivity without vxlan before and after updating the namespace annotation to a new external gateway|\
Should validate ingress connectivity from an external gateway|\
Should validate NetFlow data of br-int is sent to an external gateway|\
Should validate the egress firewall policy functionality against remote hosts|\
Should validate the egress IP functionality against remote hosts|\
recovering from deleting db files while maintain connectivity|\
test tainting a node according to its defaults interface MTU size"

Expand Down