Skip to content

Commit bea77c6

Browse files
committed
Temporarly exception for open port 9447 not appearing in docs
port 9447 is an external port used only internaly and for that is not documented. the port will soon be an internal port but for now we will make an exception for him to not fail the test.
1 parent ecd9be8 commit bea77c6

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,6 @@ github.com/opencontainers/selinux v1.11.1 h1:nHFvthhM0qY8/m+vfhJylliSshm8G1jJ2jD
611611
github.com/opencontainers/selinux v1.11.1/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
612612
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250220212757-b9c4d98a0c45 h1:hXpbYtP3iTh8oy/RKwKkcMziwchY3fIk95ciczf7cOA=
613613
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250220212757-b9c4d98a0c45/go.mod h1:6gkP5f2HL0meusT0Aim8icAspcD1cG055xxBZ9yC68M=
614-
github.com/openshift-kni/commatrix v0.0.4-0.20250530175137-ed4c18697c21 h1:r035vZN9aLvesMDd9HjQcf3ldGm8g3XJgYEd5cXzMvA=
615-
github.com/openshift-kni/commatrix v0.0.4-0.20250530175137-ed4c18697c21/go.mod h1:R8JhlXqlLwe3N6nQheK2KpMEESIlDVCUw5TOLKiZ08s=
616614
github.com/openshift-kni/commatrix v0.0.4-0.20250604173218-064b4004e9fb h1:+owPvmRBKN5dYuVQ7/CROW0h6wL6Hk8MJlf2vnZQfSM=
617615
github.com/openshift-kni/commatrix v0.0.4-0.20250604173218-064b4004e9fb/go.mod h1:R8JhlXqlLwe3N6nQheK2KpMEESIlDVCUw5TOLKiZ08s=
618616
github.com/openshift/api v0.0.0-20250513132935-9052dea86694 h1:kPnk1+m89LJHexYsTP+MVM9OgJLxcpUR3vRdMQNF66s=

test/extended/networking/commatrix.go

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,21 @@ const (
4545

4646
var docCommatrixBaseURL = fmt.Sprintf(docCommatrixTemplateURL, docReleaseTemplate, docTypeHolder)
4747

48+
// Temporarly exception for external port used only interanly.
49+
var staticOpenPortsToIgnore = []types.ComDetails{
50+
{
51+
Direction: "Ingress",
52+
Protocol: "TCP",
53+
Port: 9447,
54+
NodeRole: "master",
55+
Service: "baremetal-operator-webhook-service",
56+
Namespace: "openshift-machine-api",
57+
Pod: "metal3-baremetal-operator",
58+
Container: "metal3-baremetal-operator",
59+
Optional: false,
60+
},
61+
}
62+
4863
var _ = Describe("[sig-network][Feature:commatrix][apigroup:config.openshift.io][Serial]", func() {
4964
It("generated communication matrix should be equal to documented communication matrix", func() {
5065
kubeconfig := os.Getenv("KUBECONFIG")
@@ -171,28 +186,27 @@ var _ = Describe("[sig-network][Feature:commatrix][apigroup:config.openshift.io]
171186
logrus.Warningf("unused documented ports found:\n%s", notUsedPortsMat)
172187
}
173188

174-
var portsToIgnoreMat *types.ComMatrix
189+
portsToIgnoreMat := &types.ComMatrix{Matrix: staticOpenPortsToIgnore}
175190

176191
openPortsToIgnoreFile, _ := os.LookupEnv("OPEN_PORTS_TO_IGNORE_IN_DOC_TEST_FILE")
177192
openPortsToIgnoreFormat, _ := os.LookupEnv("OPEN_PORTS_TO_IGNORE_IN_DOC_TEST_FORMAT")
178193

179194
// Get ports that are in the generated commatrix but not in the documented commatrix,
180195
// and ignore the ports in given file (if exists)
181-
missingPortsMat := endpointslicesDiffWithDocMat.GetUniquePrimary()
182196
if openPortsToIgnoreFile != "" && openPortsToIgnoreFormat != "" {
183197
// generate open ports to ignore commatrix
184198
portsToIgnoreFileContent, err := os.ReadFile(openPortsToIgnoreFile)
185199
Expect(err).ToNot(HaveOccurred())
186200
portsToIgnoreComDetails, err := types.ParseToComDetailsList(portsToIgnoreFileContent, openPortsToIgnoreFormat)
187201
Expect(err).ToNot(HaveOccurred())
188-
portsToIgnoreMat = &types.ComMatrix{Matrix: portsToIgnoreComDetails}
189-
190-
// generate the diff matrix between the open ports to ignore matrix and the missing ports in the documented commatrix (based on the diff between the enpointslice and the doc matrix)
191-
nonDocumentedEndpointslicesMat := endpointslicesDiffWithDocMat.GetUniquePrimary()
192-
endpointslicesDiffWithIgnoredPorts := matrixdiff.Generate(nonDocumentedEndpointslicesMat, portsToIgnoreMat)
193-
missingPortsMat = endpointslicesDiffWithIgnoredPorts.GetUniquePrimary()
202+
portsToIgnoreMat.Matrix = append(portsToIgnoreMat.Matrix, portsToIgnoreComDetails...)
194203
}
195204

205+
// generate the diff matrix between the open ports to ignore matrix and the missing ports in the documented commatrix (based on the diff between the enpointslice and the doc matrix)
206+
nonDocumentedEndpointslicesMat := endpointslicesDiffWithDocMat.GetUniquePrimary()
207+
endpointslicesDiffWithIgnoredPorts := matrixdiff.Generate(nonDocumentedEndpointslicesMat, portsToIgnoreMat)
208+
missingPortsMat := endpointslicesDiffWithIgnoredPorts.GetUniquePrimary()
209+
196210
Expect(missingPortsMat.Matrix).To(BeEmpty(), fmt.Sprintf("non-documented open ports found: \n%v", missingPortsMat))
197211

198212
if len(missingPortsMat.Matrix) > 0 {

0 commit comments

Comments
 (0)