From 826f3a130ae1ddf9ef525a1757edc321aec72d4d Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Sat, 19 Aug 2023 12:50:59 +0000 Subject: [PATCH] promote to conformance Service multiprotocol tests Services can expose network applications that are running on one or more Pods. User need to specify the Port and Protocol of the network application, and network implementations must forward only the traffic indicated in the Service, as it may present a security problem if you allow to forward traffic to a backend if the user didn't specify it. Change-Id: I77fbb23c6415ed09dd81c4f2deb6df7a17de46f0 --- test/conformance/testdata/conformance.yaml | 10 ++++++++++ test/e2e/network/service.go | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/test/conformance/testdata/conformance.yaml b/test/conformance/testdata/conformance.yaml index 14b883ddee2..cea0edfdbe3 100755 --- a/test/conformance/testdata/conformance.yaml +++ b/test/conformance/testdata/conformance.yaml @@ -1745,6 +1745,16 @@ pods are deleted the endpoints from the service MUST be empty. release: v1.9 file: test/e2e/network/service.go +- testname: Service, should serve endpoints on same port and different protocols. + codename: '[sig-network] Services should serve endpoints on same port and different + protocols [Conformance]' + description: Create one service with two ports, same port number and different protocol + TCP and UDP. It MUST be able to forward traffic to both ports. Update the Service + to expose only the TCP port, it MUST succeed to connect to the TCP port and fail + to connect to the UDP port. Update the Service to expose only the UDP port, it + MUST succeed to connect to the UDP port and fail to connect to the TCP port. + release: v1.29 + file: test/e2e/network/service.go - testname: Service, endpoints with multiple ports codename: '[sig-network] Services should serve multiport endpoints from pods [Conformance]' description: Create a service with two ports but no Pods are added to the service diff --git a/test/e2e/network/service.go b/test/e2e/network/service.go index 2cd64c3f893..5764fe96db2 100644 --- a/test/e2e/network/service.go +++ b/test/e2e/network/service.go @@ -3624,7 +3624,17 @@ var _ = common.SIGDescribe("Services", func() { framework.Logf("Collection of services has been deleted") }) - ginkgo.It("should serve endpoints on same port and different protocols", func(ctx context.Context) { + /* + Release: v1.29 + Testname: Service, should serve endpoints on same port and different protocols. + Description: Create one service with two ports, same port number and different protocol TCP and UDP. + It MUST be able to forward traffic to both ports. + Update the Service to expose only the TCP port, it MUST succeed to connect to the TCP port and fail + to connect to the UDP port. + Update the Service to expose only the UDP port, it MUST succeed to connect to the UDP port and fail + to connect to the TCP port. + */ + framework.ConformanceIt("should serve endpoints on same port and different protocols", func(ctx context.Context) { serviceName := "multiprotocol-test" testLabels := map[string]string{"app": "multiport"} ns := f.Namespace.Name