← Back to Pull requests

CORENET-7345: add OTE networkpolicy VAP and statefulset tests #3549

Open
unknown opened this pull request with 364 lines diff across 4 files
View on GitHub
unknown unknown commented on Oct 15, 2026 17:13 UTC
Author

Description

Why: The OVN-Kubernetes OTP (openshift-tests-private) NetworkPolicy tests are being migrated to the OpenShift Tests Extension (OTE) so they run through ovn-kubernetes-tests-ext instead of the downstream private suite. This PR migrates two tests that exercise OpenShift-specific NetworkPolicy behavior.

What: Adds a self-contained OTE NetworkPolicy slice under openshift/ — the OTE scaffolding/infra, a pkg/ote/utils subset scoped strictly to these two tests, their testdata fixtures, and the two migrated tests, each in its own file:

  • 83735 (test/ote/network_policy_vap.go) — a NetworkPolicy labeled npprotection/blockdeletion=true cannot be deleted once the fine-grained-network-policy-protection ValidatingAdmissionPolicy is applied, and becomes deletable again after the VAP and its binding are removed. Exercises a default-network and a UDN namespace.

  • 49186 (test/ote/network_policy_statefulset.go) — an egress NetworkPolicy keeps selecting a StatefulSet pod across repeated pod deletions/recreations, so traffic to the allowed peer keeps working and traffic to the disallowed peer stays blocked after the pod identity is recycled.
  • OTP-labeled specs skip the extension-wide labels and run with the Informing lifecycle via the [OTP] tag.

    Commits:
    1. OTE: add OTE networkpolicy VAP and statefulset migration infra
    2. OTE: add OTE networkpolicy VAP and statefulset utils
    3. CORENET-7345: add OTE networkpolicy VAP deletion-protection test
    4. CORENET-7345: add OTE networkpolicy statefulset egress test

    Additional Information

    This PR is independent — it is no longer stacked on #3514. The openshift/ tree is its own Go module; the OTE infra and a utils subset scoped only to these two tests are carried here directly. It overlaps #3514 / #3548 on openshift/pkg/ote/*, both cmd/.../main.go files and openshift/go.mod, so whichever of those lands first, the others rebase.

    New dependency — github.com/openshift/origin: required by the exutil import (github.com/openshift/origin/test/extended/util), OpenShift's e2e CLI harness (exutil.NewCLI, oc.SetupProject, CreateNamespaceUDN, admin oc runners) that the migrated OTP tests are written against. It is a test-only build dependency of the openshift/ extension module.

    vendor/ is intentionally not committed; the Dockerfile vendors it at build time.

    How to verify it

  • cd openshift && go mod tidy && go build -mod=mod ./... && gofmt -l . — clean.

  • Run on a live OVN OpenShift cluster via ovn-kubernetes-tests-ext run-test:

  • - 83735 (VAP) — validated, passed.
    - 49186 (statefulset egress) — migrated as-is from the OTP suite; builds clean, pending cluster re-validation by the author.

    Release Notes

    ``release-note
    NONE
    ``

    AI assistance: these tests were migrated with help from an AI coding tool and were reviewed and built by the author.

    Diff: 364 lines (+273 / -91) across 4 files Reviewer: jluhrsen Review duration: 67564m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.50) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 364 lines diff across 4 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.353
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #3549"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49.7% (MEDIUM) · Higher = larger blast radius
    49.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.5% · Safe to merge
    27.5%