-
Notifications
You must be signed in to change notification settings - Fork 63
CORENET-7431: migrate OTP network-tools test cases #190
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
Open
anuragthehatter
wants to merge
3
commits into
openshift:main
Choose a base branch
from
anuragthehatter:ote-otp-migration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,71 @@ | ||
| module github.com/openshift/network-tools | ||
|
|
||
| go 1.22.0 | ||
| go 1.24.0 | ||
|
|
||
| require github.com/openshift/build-machinery-go v0.0.0-20200917070002-f171684f77ab | ||
| require ( | ||
| github.com/onsi/ginkgo/v2 v2.25.1 | ||
| github.com/onsi/gomega v1.38.2 | ||
| github.com/openshift-eng/openshift-tests-extension v0.0.0-20260521151256-b5a8f7ec8a38 | ||
| github.com/openshift/build-machinery-go v0.0.0-20200917070002-f171684f77ab | ||
| github.com/spf13/cobra v1.9.1 | ||
| k8s.io/api v0.32.3 | ||
| k8s.io/apimachinery v0.32.3 | ||
| k8s.io/client-go v0.32.3 | ||
| k8s.io/utils v0.0.0-20241210054802-24370beab758 | ||
| ) | ||
|
|
||
| replace github.com/onsi/ginkgo/v2 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20260303184444-1cc650aa0565 | ||
|
|
||
| require ( | ||
| github.com/Masterminds/semver/v3 v3.4.0 // indirect | ||
| github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect | ||
| github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect | ||
| github.com/emicklei/go-restful/v3 v3.11.0 // indirect | ||
| github.com/fxamacker/cbor/v2 v2.7.0 // indirect | ||
| github.com/go-logr/logr v1.4.3 // indirect | ||
| github.com/go-openapi/jsonpointer v0.21.0 // indirect | ||
| github.com/go-openapi/jsonreference v0.20.2 // indirect | ||
| github.com/go-openapi/swag v0.23.0 // indirect | ||
| github.com/go-task/slim-sprig/v3 v3.0.0 // indirect | ||
| github.com/gogo/protobuf v1.3.2 // indirect | ||
| github.com/golang/protobuf v1.5.4 // indirect | ||
| github.com/google/cel-go v0.17.8 // indirect | ||
| github.com/google/gnostic-models v0.6.8 // indirect | ||
| github.com/google/go-cmp v0.7.0 // indirect | ||
| github.com/google/gofuzz v1.2.0 // indirect | ||
| github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect | ||
| github.com/google/uuid v1.6.0 // indirect | ||
| github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
| github.com/josharian/intern v1.0.0 // indirect | ||
| github.com/json-iterator/go v1.1.12 // indirect | ||
| github.com/mailru/easyjson v0.7.7 // indirect | ||
| github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
| github.com/modern-go/reflect2 v1.0.2 // indirect | ||
| github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect | ||
| github.com/pkg/errors v0.9.1 // indirect | ||
| github.com/spf13/pflag v1.0.6 // indirect | ||
| github.com/stoewer/go-strcase v1.2.0 // indirect | ||
| github.com/x448/float16 v0.8.4 // indirect | ||
| go.yaml.in/yaml/v3 v3.0.4 // indirect | ||
| golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect | ||
| golang.org/x/mod v0.27.0 // indirect | ||
| golang.org/x/net v0.43.0 // indirect | ||
| golang.org/x/oauth2 v0.23.0 // indirect | ||
| golang.org/x/sync v0.16.0 // indirect | ||
| golang.org/x/sys v0.35.0 // indirect | ||
| golang.org/x/term v0.34.0 // indirect | ||
| golang.org/x/text v0.28.0 // indirect | ||
| golang.org/x/time v0.7.0 // indirect | ||
| golang.org/x/tools v0.36.0 // indirect | ||
| google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect | ||
| google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61 // indirect | ||
| google.golang.org/protobuf v1.36.7 // indirect | ||
| gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect | ||
| gopkg.in/inf.v0 v0.9.1 // indirect | ||
| gopkg.in/yaml.v3 v3.0.1 // indirect | ||
| k8s.io/klog/v2 v2.130.1 // indirect | ||
| k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect | ||
| sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect | ||
| sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect | ||
| sigs.k8s.io/yaml v1.4.0 // indirect | ||
| ) | ||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| BINARY_NAME := network-tools-tests-ext | ||
|
|
||
| BUILD_DIR := bin | ||
|
|
||
| .PHONY: all | ||
| all: build | ||
|
|
||
| .PHONY: build | ||
| build: | ||
| @echo "Building $(BINARY_NAME)..." | ||
| @mkdir -p $(BUILD_DIR) | ||
| cd cmd && go build -o ../$(BUILD_DIR)/$(BINARY_NAME) . | ||
|
|
||
| .PHONY: clean | ||
| clean: | ||
| @echo "Cleaning build artifacts..." | ||
| rm -rf $(BUILD_DIR) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "os" | ||
|
|
||
| "github.com/openshift-eng/openshift-tests-extension/pkg/cmd" | ||
| "github.com/spf13/cobra" | ||
|
|
||
| e "github.com/openshift-eng/openshift-tests-extension/pkg/extension" | ||
| et "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests" | ||
| g "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo" | ||
|
|
||
| _ "github.com/openshift/network-tools/test/ote" | ||
| ) | ||
|
|
||
| func main() { | ||
| registry := e.NewRegistry() | ||
|
|
||
| ext := e.NewExtension("openshift", "payload", "network-tools") | ||
| ext.AddSuite(e.Suite{ | ||
| Name: "openshift/network-tools", | ||
| Parents: []string{ | ||
| "openshift/conformance/parallel", | ||
| }, | ||
| Qualifiers: []string{ | ||
| "name.contains('[Suite:openshift/network-tools]')", | ||
| }, | ||
| }) | ||
|
|
||
| specs, err := g.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite() | ||
| if err != nil { | ||
| fmt.Fprintf(os.Stderr, "couldn't build extension test specs from ginkgo: %v\n", err) | ||
| os.Exit(1) | ||
| } | ||
|
|
||
| specs.Walk(func(spec *et.ExtensionTestSpec) { | ||
| spec.Lifecycle = et.LifecycleInforming | ||
| }) | ||
| ext.AddSpecs(specs) | ||
| registry.Register(ext) | ||
|
|
||
| root := &cobra.Command{ | ||
| Long: "OpenShift Tests Extension for Network Tools", | ||
| } | ||
| root.AddCommand(cmd.DefaultExtensionCommands(registry)...) | ||
|
|
||
| if err := func() error { | ||
| return root.Execute() | ||
| }(); err != nil { | ||
| os.Exit(1) | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/network-tools
Length of output: 4305
🏁 Script executed:
Repository: openshift/network-tools
Length of output: 4862
🌐 Web query:
github openshift onsi-ginkgo v2.6.1-0.20260303184444-1cc650aa0565💡 Result:
The string "github.com/onsi/ginkgo/v2 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20260303184444-1cc650aa0565" refers to a pseudo-version override used in OpenShift Go module configuration files (go.mod) [1]. This entry is used to replace the standard upstream Ginkgo dependency with a specific version or fork maintained or customized by OpenShift [2][1]. The version string v2.6.1-0.20260303184444-1cc650aa0565 follows standard Go pseudo-version formatting, indicating a commit from March 3, 2026 [1]. Key points regarding this dependency: - Ginkgo is a BDD (Behavior-Driven Development) testing framework for Go, widely used for writing tests in Kubernetes and OpenShift components [3][4][5]. - While there is a repository named openshift/onsi-ginkgo, it is a fork of the primary upstream repository onsi/ginkgo [4][5]. - OpenShift projects often use these replace directives in their go.mod files to ensure that specific components are tested against consistent, verified versions of the testing infrastructure [2][1]. - The version 2.6.1 referenced in the pseudo-version reflects a legacy base version that has been patched or re-tagged by OpenShift for their internal build needs, rather than a modern upstream release (which, as of August 2026, has progressed to versions like v2.32.0) [6][5][1].
Citations:
🌐 Web query:
OSV golang.org/x/oauth2 v0.23.0 vulnerabilities💡 Result:
The golang.org/x/oauth2 package at version v0.23.0 is affected by a security vulnerability identified as CVE-2025-22868 [1][2]. Details of the vulnerability: - Identifier: CVE-2025-22868 (also tracked as GO-2025-3488 and GHSA-6v2p-p543-phr9) [1][3][4]. - Description: The vulnerability exists in the golang.org/x/oauth2/jws package, specifically within the Verify function [5][2]. An attacker can pass a malicious, malformed token that causes unexpected memory consumption during parsing, leading to a potential denial-of-service (DoS) condition [5][6][7]. - Affected Versions: All versions of golang.org/x/oauth2 prior to v0.27.0 [5][3]. - Resolution: This issue was addressed in version v0.27.0 [6][7]. Users are advised to update to version v0.27.0 or later to mitigate this vulnerability [6][3]. You can view the full vulnerability reports at the following official sources: - Go Vulnerability Database: https://pkg.go.dev/vuln/GO-2025-3488 [1] - OSV (Open Source Vulnerabilities): https://osv.dev/vulnerability/GO-2025-3488 [5]
Citations:
🏁 Script executed:
Repository: openshift/network-tools
Length of output: 1796
🏁 Script executed:
Repository: openshift/network-tools
Length of output: 4916
Use an approved Ginkgo version and update
golang.org/x/oauth2.go.mod:17replaces Ginkgo with a pre-release forked pseudo-version. The Dockerfile vendors this module graph and packages the test extension in the final image. Use an approved stable version or document a reviewed exception.go.mod:53selectsgolang.org/x/oauth2 v0.23.0, affected byGO-2025-3488. Update tov0.27.0or later.🤖 Prompt for AI Agents
Source: Path instructions