-
Notifications
You must be signed in to change notification settings - Fork 35
CORENET-6822: OTE framework for Ingress Node Firewall with LEVEL0 test case #694
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # test/Makefile - Build targets for ingress-node-firewall extended tests | ||
|
|
||
| SHELL := /bin/bash | ||
|
|
||
| # Binary name | ||
| BINARY_NAME := ingress-node-firewall-tests | ||
|
|
||
| # Build directory | ||
| BUILD_DIR := bin | ||
| BINARY_PATH := $(BUILD_DIR)/$(BINARY_NAME) | ||
|
|
||
| # Go build flags | ||
| GO := go | ||
| GOFLAGS ?= | ||
| LDFLAGS := -w -s | ||
|
|
||
| # Version information | ||
| VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "unknown") | ||
| GIT_COMMIT ?= $(shell git rev-parse HEAD 2>/dev/null || echo "unknown") | ||
| BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ") | ||
|
|
||
| # LDFLAGS with version info | ||
| LDFLAGS += -X github.com/openshift/ingress-node-firewall/test/version.Version=$(VERSION) | ||
| LDFLAGS += -X github.com/openshift/ingress-node-firewall/test/version.GitCommit=$(GIT_COMMIT) | ||
| LDFLAGS += -X github.com/openshift/ingress-node-firewall/test/version.BuildDate=$(BUILD_DATE) | ||
|
|
||
| .PHONY: all | ||
| all: build-e2e-tests | ||
|
|
||
| .PHONY: build-e2e-tests | ||
| build-e2e-tests: ## Build the extended e2e test binary (static, ART compliant) | ||
| @echo "Building $(BINARY_NAME)..." | ||
| @mkdir -p $(BUILD_DIR) | ||
| CGO_ENABLED=0 GO_COMPLIANCE_POLICY="exempt_all" $(GO) build \ | ||
| -a -mod=mod \ | ||
| -ldflags "$(LDFLAGS)" \ | ||
| -o $(BINARY_PATH) ./cmd/main.go | ||
|
Comment on lines
+23
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Locate the version package and confirm the three exported vars exist.
fd -t f -e go . test/version 2>/dev/null
rg -nP '\b(Version|GitCommit|BuildDate)\b\s*(=|string)' -g '*.go' test/version 2>/dev/null || \
echo "test/version package or vars not found"Repository: openshift/ingress-node-firewall Length of output: 114 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== test/version directory listing (if present) =="
ls -la test/version 2>/dev/null || echo "test/version directory not found"
echo
echo "== Go files under test/version =="
fd -t f -e go test/version 2>/dev/null || true
echo
echo "== Find package version declarations under test/ =="
rg -n --hidden --no-ignore '^\s*package\s+version\s*$' -g '*.go' test 2>/dev/null || echo "No 'package version' found under test/"
echo
echo "== Find exported vars/constants for Version/GitCommit/BuildDate =="
rg -n --hidden --no-ignore '^(export\s+)?(var|const)\s+(Version|GitCommit|BuildDate)\b' -g '*.go' test 2>/dev/null || echo "No exported Version/GitCommit/BuildDate declarations found under test/"
echo
echo "== Locate references to github.com/openshift/ingress-node-firewall/test/version =="
rg -n 'github\.com/openshift/ingress-node-firewall/test/version' -S -g '*.go' . 2>/dev/null || echo "No references found"Repository: openshift/ingress-node-firewall Length of output: 528 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Search for -X injections (LDFLAGS) =="
rg -n --hidden --no-ignore 'LDFLAGS\s*\+?=' -g 'Makefile' . || true
rg -n --hidden --no-ignore '-X\s+github\.com/openshift/ingress-node-firewall/[^ ]+' -g 'Makefile' . || true
rg -n --hidden --no-ignore '-X\s+github\.com/openshift/ingress-node-firewall/test/version' -S -g 'Makefile' . || true
echo
echo "== Search for exported identifiers =="
rg -n --hidden --no-ignore '\b(GitCommit|BuildDate|Version)\b' -S -g '*.go' . || true
echo
echo "== Find any version packages under test/ =="
fd -t d test -a 2>/dev/null | rg '(^|/)version$' || true
fd -t d -a . 2>/dev/null | rg '(^|/)test/version$|(^|/)version$' || true
echo
echo "== Search for package name 'version' anywhere =="
rg -n --hidden --no-ignore '^\s*package\s+version\s*$' -g '*.go' . || trueRepository: openshift/ingress-node-firewall Length of output: 51216 Fix linker
🧰 Tools🪛 checkmake (0.3.2)[warning] 31-31: Target body for "build-e2e-tests" exceeds allowed length of 5 lines (7). (maxbodylength) 🤖 Prompt for AI Agents |
||
| @echo "Built $(BINARY_PATH)" | ||
|
|
||
| .PHONY: clean | ||
| clean: ## Clean build artifacts | ||
| @echo "Cleaning test build artifacts..." | ||
| @rm -rf $(BUILD_DIR) | ||
|
|
||
| .PHONY: help | ||
| help: ## Display this help | ||
| @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
Uh oh!
There was an error while loading. Please reload this page.