Skip to content

USHIFT-6746: migrate 23 OTP router tests to Robot Framework#6730

Draft
agullon wants to merge 3 commits into
openshift:mainfrom
agullon:USHIFT-6746
Draft

USHIFT-6746: migrate 23 OTP router tests to Robot Framework#6730
agullon wants to merge 3 commits into
openshift:mainfrom
agullon:USHIFT-6746

Conversation

@agullon
Copy link
Copy Markdown
Contributor

@agullon agullon commented May 25, 2026

Summary

  • Migrates 23 tests from openshift-tests-private/test/extended/router/microshift.go to Robot Framework in the MicroShift repo
  • Adds 6 non-disruptive route tests covering HTTP, edge, passthrough, reencrypt routes via router-routes.robot
  • Adds 17 disruptive config tests covering TLS profiles, mTLS, access logging, custom error pages, and wildcard routes via router-config.robot
  • Adds shared test/resources/router.resource with reusable keywords for workload deployment, route creation, curl-from-pod, haproxy inspection, and OpenSSL cert generation
  • Adds el98-src@router-extended.sh CI scenarios (presubmits + releases) for the new test files; updates existing router.sh scenarios to explicitly reference router.robot instead of the directory wildcard to avoid picking up the new (slower) tests
  • Skips OCP-60149 (HTTP Ingress, already covered by networking-smoke.robot) and OCP-73621 (namespace ownership toggle, already covered by router.robot)

Test plan

  • Run make verify-rf locally to confirm lint and format pass
  • Trigger el98-src@router-extended presubmit to validate new tests
  • Confirm existing el98-src@router presubmit still passes (only runs router.robot)
  • Review test cases in router-routes.robot and router-config.robot for correctness

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added comprehensive router testing suites validating routing behaviors (reencrypt, edge, passthrough, HTTP routes) and configuration scenarios (TLS profiles, mTLS, custom error pages, HTTP logging, syslog integration).
    • Extended router test coverage across multiple OS versions and release channels.

Migrate 23 tests from openshift-tests-private/test/extended/router/microshift.go
into the MicroShift repo as Robot Framework tests:

Non-disruptive route tests (router-routes.robot):
- OCP-60136: reencrypt route via Ingress with destination CA certificate
- OCP-60266: edge and passthrough route creation and connectivity
- OCP-60283: HTTP route via oc expose and reencrypt route
- OCP-72802: namespace ownership default (InterNamespaceAllowed) config
- OCP-73152: router-default service as LoadBalancer with route connectivity
- OCP-73202: default listening IPs and ports with route connectivity

Disruptive config tests (router-config.robot):
- OCP-73203: custom listening IPs and ports with route connectivity
- OCP-73209: enable/disable router (Removed → Managed cycle)
- OCP-77349: tuning options default + custom (env vars + haproxy config)
- OCP-80508: custom default certificate with real TLS connectivity
- OCP-80510: Old and Intermediate TLS security profiles
- OCP-80514: Modern and Custom TLS security profiles
- OCP-80517: mTLS Required and Optional client certificate policies
- OCP-80518: mTLS allowedSubjectPatterns filter
- OCP-80520: wildcard routeAdmissionPolicy
- OCP-81996: httpCaptureCookies Prefix match in access logs
- OCP-81997: httpCaptureCookies Exact match and maxLength truncation
- OCP-82000: httpCaptureHeaders request/response in access logs
- OCP-82003: httpCaptureHeaders maxLength adherence
- OCP-82004: custom 503/404 error pages
- OCP-82014: httpLogFormat with real HAProxy format directives
- OCP-82015: syslog logging destination with live rsyslogd pod
- OCP-84260: negative logging config validation

Skipped OCP-60149 (HTTP Ingress, covered by networking-smoke.robot) and
OCP-73621 (namespace ownership toggle, covered by router.robot).

Also adds:
- test/assets/router/: 8 fixture files from OTP testdata/router/
- test/resources/router.resource: shared keywords for workload deployment,
  route creation, curl-from-pod, haproxy inspection, cert generation
- el98-src@router-extended.sh scenarios (presubmits + releases, bootc el9/el10)
- Updates existing router scenarios to reference router.robot explicitly
  instead of the suites/router/ directory wildcard
- Adjusts robocop.toml limits for complex integration tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

pre-commit.check-secrets: ENABLED
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 25, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 25, 2026

@agullon: This pull request references USHIFT-6746 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Migrates 23 tests from openshift-tests-private/test/extended/router/microshift.go to Robot Framework in the MicroShift repo
  • Adds 6 non-disruptive route tests covering HTTP, edge, passthrough, reencrypt routes via router-routes.robot
  • Adds 17 disruptive config tests covering TLS profiles, mTLS, access logging, custom error pages, and wildcard routes via router-config.robot
  • Adds shared test/resources/router.resource with reusable keywords for workload deployment, route creation, curl-from-pod, haproxy inspection, and OpenSSL cert generation
  • Adds el98-src@router-extended.sh CI scenarios (presubmits + releases) for the new test files; updates existing router.sh scenarios to explicitly reference router.robot instead of the directory wildcard to avoid picking up the new (slower) tests
  • Skips OCP-60149 (HTTP Ingress, already covered by networking-smoke.robot) and OCP-73621 (namespace ownership toggle, already covered by router.robot)

Test plan

  • Run make verify-rf locally to confirm lint and format pass
  • Trigger el98-src@router-extended presubmit to validate new tests
  • Confirm existing el98-src@router presubmit still passes (only runs router.robot)
  • Review test cases in router-routes.robot and router-config.robot for correctness

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@agullon agullon marked this pull request as draft May 25, 2026 11:36
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

Walkthrough

This PR adds comprehensive end-to-end testing for MicroShift's router (OpenShift Ingress Controller), covering route validation, advanced configurations, and logging. New test infrastructure includes Kubernetes manifests for workloads, a shared Robot Framework library with 40+ keywords for deployment/probing/verification, two test suites with 13 test cases total, and scenario scripts orchestrating execution across multiple RHEL versions.

Changes

Router End-to-End Test Infrastructure

Layer / File(s) Summary
Test Infrastructure Assets
test/assets/router/*
Kubernetes manifests for nginx deployments (signed and unsigned), test client pods, rsyslogd pod, HTTP Ingress, reencrypt Ingress with destination CA, and custom HTTP 404/503 error page assets used across all test scenarios.
Shared Test Resource Library
test/resources/router.resource
Robot Framework keywords for deploying workloads, creating/validating routes, curl-based HTTP/HTTPS probing with mTLS, router pod inspection, HAProxy config/log reading, MicroShift drop-in orchestration, LB service queries, OpenSSL certificate generation with SAN support, SSH-based host inspection, and operational utilities (configmap creation, pod file copy, deployment scaling).
Route Validation Test Suite
test/suites/router/router-routes.robot
Six tests validating ingress-based TLS reencrypt, edge/passthrough routes, HTTP and reencrypt routes, namespace ownership defaults, LoadBalancer service type, and default listening IPs/ports across multiple route types.
Router Configuration Test Suite
test/suites/router/router-config.robot
Extensive disruptive tests exercising router drop-in configurations: custom listen IPs/alternate ports, ingress status toggling, tuning options, TLS security profiles, mTLS policies/subject filtering, wildcard route admission, HTTP access logging with cookie/header capture and maxLength truncation, custom error pages, HTTP structured log formats, and syslog destination logging; includes 21 helper keywords and negative validation for invalid configs.
Test Orchestration Scripts
test/scenarios*/*@router*.sh
Bash scenario scripts for EL9.8 and EL10.2 (standard, bootc, presubmit, release) that run specific router test suites and new router-extended scenarios executing both route and configuration test suites against dedicated test VMs.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • jerpeter1
🚥 Pre-merge checks | ✅ 10 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Ipv6 And Disconnected Network Test Compatibility ⚠️ Warning Keywords use hardcoded IPv4-only commands: ip -4 addr show in Get Host IPs Via SSH and ip -4 addr in Get First Host Interface And IP Via SSH will fail on IPv6-only clusters. Remove -4 flags from ip commands or add separate IPv6 variants with conditional logic to support both IPv4 and IPv6 clusters.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately reflects the main change: migrating 23 router tests to Robot Framework, which is the core objective of this pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR migrates tests from Ginkgo to Robot Framework. All new Robot test cases use stable, deterministic titles with no dynamic values (IPs, pod names, timestamps, UUIDs, or namespace suffixes).
Test Structure And Quality ✅ Passed PR migrates tests to Robot Framework (.robot/.resource files). Custom check requires Ginkgo test code (It blocks, BeforeEach/AfterEach), which this PR doesn't contain.
Microshift Test Compatibility ✅ Passed PR adds Robot Framework tests, not Ginkgo tests. Custom check applies only to Ginkgo. Tests use only MicroShift-compatible APIs.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR adds Robot Framework tests (.robot files), not Ginkgo tests. SNO compatibility check applies only to Ginkgo e2e tests (Go code), so this check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR adds test code only. Test Deployments use 1 replica with no affinity, nodeSelector, tolerations, or PodDisruptionBudget—compatible with all OpenShift topologies.
Ote Binary Stdout Contract ✅ Passed PR adds only Robot Framework tests, test resources, and shell scripts—no Go/OTE binary code that could violate the stdout contract.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 25, 2026
@openshift-ci openshift-ci Bot requested review from ggiguash and jerpeter1 May 25, 2026 11:36
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 25, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: agullon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 25, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/assets/router/web-server-signed-deploy.yaml`:
- Around line 50-58: The nginx container currently lacks an explicit
securityContext; update the container spec for the container named "nginx" to
add a securityContext that enforces non-root execution and reduces privileges
(e.g., set runAsNonRoot: true, runAsUser to a non-root UID such as 1000, set
allowPrivilegeEscalation: false, set readOnlyRootFilesystem: true, and drop
capabilities like ["ALL"]); place this securityContext block under the nginx
container entry so the pod explicitly hardens runtime privileges.

In `@test/resources/router.resource`:
- Around line 131-137: The JsonPath currently used in the "Router Pod Env Should
Have Value" keyword queries all router pods via
.items[*].spec.containers[*].env[...] which can return multiple values during
rollouts; change the Oc Get JsonPath call to scope to a single pod (e.g., use
.items[0].spec.containers[*].env[?(@.name=="${env_name}")].value) so only one
value is returned, keeping the rest of the keyword (Should Be Equal As Strings
and variables like ${ROUTER_NS} and ${env_name}) unchanged.

In `@test/suites/router/router-config.robot`:
- Around line 722-723: The assertion is checking the wrong truncated hostname
and the comment is wrong; change the test that uses Wait For Router Logs To
Contain from waiting for "route-unsec82003.ap" to the correctly truncated
16-character hostname "route-unsec82003" and update the preceding comment to
state that the full hostname should be truncated to "route-unsec82003" (16
chars) when maxLength: 16; locate the assertion by the call to Wait For Router
Logs To Contain and the nearby comment in the router-config.robot test and
replace both the expected string and the comment to reflect the correct
16-character truncation.

In `@test/suites/router/router-routes.robot`:
- Around line 171-179: Add admission assertions after each route creation: after
the Create OC Route calls for route-http, route-edge, and route-passth call the
Route Should Be Admitted keyword (same as for route-reen) so every created route
is verified before curl checks; also mirror this change in the other identical
route-creation block that creates route-http, route-edge and route-passth so all
created routes are gated on admission.
- Around line 117-120: The test currently assigns ${env} from Oc Get JsonPath
and then asserts it equals a single "true", which fails when multiple router
pods produce values like "true true"; update the assertion so it verifies every
returned env value for ROuTER_DISABLE_NAMESPACE_OWNERSHIP_CHECK is "true" (e.g.,
split ${env} into items or iterate over the list and assert each item == "true",
or use a collection-level assertion) instead of comparing the aggregated string
with a single "true"; adjust the steps surrounding Oc Get JsonPath / ${env} and
replace the single-string check (Should Be Equal As Strings ${env} true) with a
per-item check so multi-pod results pass.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: ebedf450-e7d9-43c3-85aa-30293f17a3da

📥 Commits

Reviewing files that changed from the base of the PR and between ca5e605 and 42f5ec7.

📒 Files selected for processing (22)
  • robocop.toml
  • test/assets/router/error-page-404.http
  • test/assets/router/error-page-503.http
  • test/assets/router/microshift-ingress-destca.yaml
  • test/assets/router/microshift-ingress-http.yaml
  • test/assets/router/rsyslogd-pod.yaml
  • test/assets/router/test-client-pod.yaml
  • test/assets/router/web-server-deploy.yaml
  • test/assets/router/web-server-signed-deploy.yaml
  • test/resources/router.resource
  • test/scenarios-bootc/el10/presubmits/el102-src@router-extended.sh
  • test/scenarios-bootc/el10/presubmits/el102-src@router.sh
  • test/scenarios-bootc/el10/releases/el102-lrel@osconfig-router.sh
  • test/scenarios-bootc/el9/presubmits/el98-src@router-extended.sh
  • test/scenarios-bootc/el9/presubmits/el98-src@router.sh
  • test/scenarios-bootc/el9/releases/el98-lrel@osconfig-router.sh
  • test/scenarios/presubmits/el98-src@router-extended.sh
  • test/scenarios/presubmits/el98-src@router.sh
  • test/scenarios/releases/el98-lrel@router-extended.sh
  • test/scenarios/releases/el98-lrel@router.sh
  • test/suites/router/router-config.robot
  • test/suites/router/router-routes.robot

Comment on lines +50 to +58
containers:
- name: nginx
image: quay.io/openshifttest/nginx-alpine@sha256:cee6930776b92dc1e93b73f9e5965925d49cff3d2e91e1d071c2f0ff72cbca29
volumeMounts:
- name: service-secret
mountPath: /etc/nginx/certs/
- name: nginx-config
mountPath: /etc/nginx/
volumes:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add an explicit container securityContext.

Line 52 currently allows default runtime behavior, which can permit root execution and privilege escalation. Please harden this container explicitly.

Suggested patch
         containers:
         - name: nginx
           image: quay.io/openshifttest/nginx-alpine@sha256:cee6930776b92dc1e93b73f9e5965925d49cff3d2e91e1d071c2f0ff72cbca29
+          securityContext:
+            allowPrivilegeEscalation: false
+            runAsNonRoot: true
+            capabilities:
+              drop:
+              - ALL
           volumeMounts:
           - name: service-secret
             mountPath: /etc/nginx/certs/
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
containers:
- name: nginx
image: quay.io/openshifttest/nginx-alpine@sha256:cee6930776b92dc1e93b73f9e5965925d49cff3d2e91e1d071c2f0ff72cbca29
volumeMounts:
- name: service-secret
mountPath: /etc/nginx/certs/
- name: nginx-config
mountPath: /etc/nginx/
volumes:
containers:
- name: nginx
image: quay.io/openshifttest/nginx-alpine@sha256:cee6930776b92dc1e93b73f9e5965925d49cff3d2e91e1d071c2f0ff72cbca29
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
capabilities:
drop:
- ALL
volumeMounts:
- name: service-secret
mountPath: /etc/nginx/certs/
- name: nginx-config
mountPath: /etc/nginx/
volumes:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/assets/router/web-server-signed-deploy.yaml` around lines 50 - 58, The
nginx container currently lacks an explicit securityContext; update the
container spec for the container named "nginx" to add a securityContext that
enforces non-root execution and reduces privileges (e.g., set runAsNonRoot:
true, runAsUser to a non-root UID such as 1000, set allowPrivilegeEscalation:
false, set readOnlyRootFilesystem: true, and drop capabilities like ["ALL"]);
place this securityContext block under the nginx container entry so the pod
explicitly hardens runtime privileges.

Comment on lines +131 to +137
Router Pod Env Should Have Value
[Documentation] Check an env var value in the router pod.
[Arguments] ${env_name} ${expected_value}
${actual}= Oc Get JsonPath
... pod ${ROUTER_NS} ${EMPTY}
... .items[*].spec.containers[*].env[?(@.name=="${env_name}")].value
Should Be Equal As Strings ${actual} ${expected_value}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Scope env lookup to one router pod to avoid flakiness.

Line 135 uses .items[*]... across all pods. During router rollouts this can return multiple values, so Line 137 may fail nondeterministically.

Suggested patch
 Router Pod Env Should Have Value
     [Documentation]    Check an env var value in the router pod.
     [Arguments]    ${env_name}    ${expected_value}
+    ${pod_name}=    Get Router Pod Name
     ${actual}=    Oc Get JsonPath
-    ...    pod    ${ROUTER_NS}    ${EMPTY}
-    ...    .items[*].spec.containers[*].env[?(@.name=="${env_name}")].value
+    ...    pod    ${ROUTER_NS}    ${pod_name}
+    ...    .spec.containers[*].env[?(@.name=="${env_name}")].value
     Should Be Equal As Strings    ${actual}    ${expected_value}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/resources/router.resource` around lines 131 - 137, The JsonPath
currently used in the "Router Pod Env Should Have Value" keyword queries all
router pods via .items[*].spec.containers[*].env[...] which can return multiple
values during rollouts; change the Oc Get JsonPath call to scope to a single pod
(e.g., use .items[0].spec.containers[*].env[?(@.name=="${env_name}")].value) so
only one value is returned, keeping the rest of the keyword (Should Be Equal As
Strings and variables like ${ROUTER_NS} and ${env_name}) unchanged.

Comment thread test/suites/router/router-config.robot
Comment on lines +117 to +120
${env}= Oc Get JsonPath
... pod ${ROUTER_NS} ${EMPTY}
... .items[*].spec.containers[*].env[?(@.name=="ROUTER_DISABLE_NAMESPACE_OWNERSHIP_CHECK")].value
Should Be Equal As Strings ${env} true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid single-pod assumption in the namespace-ownership env assertion.

Line 120 compares the aggregated JsonPath result to a single true. If multiple router pods are returned, this can become true true and fail despite valid config.

Suggested fix
-    ${env}=    Oc Get JsonPath
+    ${env}=    Oc Get JsonPath
     ...    pod    ${ROUTER_NS}    ${EMPTY}
     ...    .items[*].spec.containers[*].env[?(@.name=="ROUTER_DISABLE_NAMESPACE_OWNERSHIP_CHECK")].value
-    Should Be Equal As Strings    ${env}    true
+    @{env_values}=    Split String    ${env}
+    FOR    ${v}    IN    @{env_values}
+        Should Be Equal As Strings    ${v}    true
+    END
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
${env}= Oc Get JsonPath
... pod ${ROUTER_NS} ${EMPTY}
... .items[*].spec.containers[*].env[?(@.name=="ROUTER_DISABLE_NAMESPACE_OWNERSHIP_CHECK")].value
Should Be Equal As Strings ${env} true
${env}= Oc Get JsonPath
... pod ${ROUTER_NS} ${EMPTY}
... .items[*].spec.containers[*].env[?(@.name=="ROUTER_DISABLE_NAMESPACE_OWNERSHIP_CHECK")].value
@{env_values}= Split String ${env}
FOR ${v} IN @{env_values}
Should Be Equal As Strings ${v} true
END
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/suites/router/router-routes.robot` around lines 117 - 120, The test
currently assigns ${env} from Oc Get JsonPath and then asserts it equals a
single "true", which fails when multiple router pods produce values like "true
true"; update the assertion so it verifies every returned env value for
ROuTER_DISABLE_NAMESPACE_OWNERSHIP_CHECK is "true" (e.g., split ${env} into
items or iterate over the list and assert each item == "true", or use a
collection-level assertion) instead of comparing the aggregated string with a
single "true"; adjust the steps surrounding Oc Get JsonPath / ${env} and replace
the single-string check (Should Be Equal As Strings ${env} true) with a per-item
check so multi-pod results pass.

Comment thread test/suites/router/router-routes.robot Outdated
Remove router-extended scenarios from presubmits and add them under
releases for bootc el9 and el10. Non-disruptive smoke tests belong in
presubmits; the full router-extended suite (with many disruptive restarts)
is better suited for release validation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

pre-commit.check-secrets: ENABLED
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/scenarios-bootc/el9/releases/el98-lrel`@router-extended.sh:
- Around line 15-16: The test script incorrectly calls exit_if_image_not_found
in teardown/test phases which can silently skip cleanup or tests; remove the
exit_if_image_not_found invocations from scenario_remove_vms and
scenario_run_tests and leave the guard only in scenario_create_vms so image
availability only blocks VM creation; locate and delete the
exit_if_image_not_found "${start_image}" calls in the scenario_remove_vms and
scenario_run_tests blocks (also check the duplicate occurrences noted around the
other invocation) and ensure no other teardown/test functions call
exit_if_image_not_found.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: ee327aa5-6071-49cd-bfcc-37af5609b3c0

📥 Commits

Reviewing files that changed from the base of the PR and between 42f5ec7 and ba69fa0.

📒 Files selected for processing (2)
  • test/scenarios-bootc/el10/releases/el102-lrel@router-extended.sh
  • test/scenarios-bootc/el9/releases/el98-lrel@router-extended.sh
✅ Files skipped from review due to trivial changes (1)

Comment on lines +15 to +16
exit_if_image_not_found "${start_image}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Remove image-availability guard from teardown/test phases.

exit_if_image_not_found exits 0 when missing. In scenario_remove_vms and scenario_run_tests, that can silently skip cleanup/tests if the registry/image is unavailable later in the job. Keep this guard only in scenario_create_vms.

Suggested patch
 scenario_remove_vms() {
-    exit_if_image_not_found "${start_image}"
-
     remove_vm host1
 }
 
 scenario_run_tests() {
-    exit_if_image_not_found "${start_image}"
-
     run_tests host1 \
         suites/router/router-routes.robot \
         suites/router/router-config.robot
 }

Also applies to: 21-22

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/scenarios-bootc/el9/releases/el98-lrel`@router-extended.sh around lines
15 - 16, The test script incorrectly calls exit_if_image_not_found in
teardown/test phases which can silently skip cleanup or tests; remove the
exit_if_image_not_found invocations from scenario_remove_vms and
scenario_run_tests and leave the guard only in scenario_create_vms so image
availability only blocks VM creation; locate and delete the
exit_if_image_not_found "${start_image}" calls in the scenario_remove_vms and
scenario_run_tests blocks (also check the duplicate occurrences noted around the
other invocation) and ensure no other teardown/test functions call
exit_if_image_not_found.

Revert robocop.toml to original limits and refactor the new robot tests
to comply without configuration changes:

- Fix LEN07: reduce Wait Until Curl Succeeds From Pod and Curl From Pod
  Should Contain to 5 args; add specialized HTTPS/cookie/client-cert
  curl keyword variants in router.resource
- Fix LEN04/LEN06: extract long test bodies into helper keywords and move
  YAML config strings to the Variables section
- Fix LEN03: split Prepare Two MTLS Certs, Curl All Cookie Routes,
  Verify Header Capture, and Verify Syslog Logging into sub-keywords
- Fix VAR10: uppercase non-local TEST-scoped variables consistently

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

pre-commit.check-secrets: ENABLED
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/resources/router.resource`:
- Around line 102-105: The helper currently forces a HEAD request by passing -I
to curl in the oc exec call (the line using "oc exec ... -- curl ${url} -sI
--resolve ${resolve} --connect-timeout 10 ${flags}"), which strips the body;
remove the hardcoded -I so the command becomes "-s --resolve ${resolve}
--connect-timeout 10 ${flags}" (or otherwise omit -I) and rely on the existing
${flags} argument to opt into HEAD when callers need it; update the Robot
keyword that wraps Run With Kubeconfig to use the modified curl invocation so
downstream checks (e.g. custom 503 error-page assertions) can see response
bodies.
- Around line 338-348: The wrapper keyword "Generate Client Cert File In Dir" is
incorrectly prepending "/CN=" before the ${cn} when calling "Generate CSR And
Key", causing double "/CN=/CN=..." for callers that already provide a full
subject; modify the call to Generate CSR And Key to pass ${cn} unchanged (remove
the hardcoded "/CN=" prefix) so the subject provided by callers is forwarded
verbatim.

In `@test/suites/router/router-config.robot`:
- Around line 702-710: The test "Verify Custom LB Ports And IP" currently uses
"Get LB IPs" + "Should Contain", which allows extra IPs; change it to assert
exclusivity by checking the list length and membership: after calling ${lb_ips}=
Get LB IPs add "Length Should Be    ${lb_ips}    1" and then keep or add "Should
Contain    ${lb_ips}    ${host_ip}" (or replace both with creating @{expected}
with ${host_ip} and use "Lists Should Be Equal    ${lb_ips}    ${expected}").
This ensures the router-default LB exposes exactly the single custom ${host_ip}.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 924210dd-c568-4210-9330-ea0caa00cd47

📥 Commits

Reviewing files that changed from the base of the PR and between ba69fa0 and d8a7c7f.

📒 Files selected for processing (3)
  • test/resources/router.resource
  • test/suites/router/router-config.robot
  • test/suites/router/router-routes.robot

Comment on lines +102 to +105
[Arguments] ${pod_name} ${ns} ${url} ${resolve} ${flags}=${EMPTY}
${output}= Run With Kubeconfig
... oc exec -n ${ns} ${pod_name} -- curl ${url} -sI --resolve ${resolve} --connect-timeout 10 ${flags}
RETURN ${output}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Don't hardcode HEAD requests in the shared curl helper.

-I strips the response body. That makes downstream checks like the custom 503 error-page assertion unreachable through this keyword, because Custom:Application Unavailable will never be returned here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/resources/router.resource` around lines 102 - 105, The helper currently
forces a HEAD request by passing -I to curl in the oc exec call (the line using
"oc exec ... -- curl ${url} -sI --resolve ${resolve} --connect-timeout 10
${flags}"), which strips the body; remove the hardcoded -I so the command
becomes "-s --resolve ${resolve} --connect-timeout 10 ${flags}" (or otherwise
omit -I) and rely on the existing ${flags} argument to opt into HEAD when
callers need it; update the Robot keyword that wraps Run With Kubeconfig to use
the modified curl invocation so downstream checks (e.g. custom 503 error-page
assertions) can see response bodies.

Comment on lines +338 to +348
Generate Client Cert File In Dir
[Documentation] Generate a CSR, key, and signed cert in the given directory using a name prefix.
[Arguments] ${tmpdir} ${host} ${cn} ${cert_prefix}
Generate CSR And Key ${tmpdir}/${cert_prefix}.key ${tmpdir}/${cert_prefix}.csr /CN=${cn}
VAR ${san}= subjectAltName = DNS.1:*.${BASE_DOMAIN},DNS.2:${host}
Sign CSR With CA
... ${tmpdir}/${cert_prefix}.csr
... ${tmpdir}/ca.crt
... ${tmpdir}/ca.key
... ${tmpdir}/${cert_prefix}.crt
... ${san}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Pass the subject through unchanged.

Generate CSR And Key already takes a full subject string. The current wrapper prepends /CN= again, so the new callers that pass /CN=example-test.com end up generating /CN=/CN=example-test.com, which will break the mTLS subject-filter case.

Suggested patch
 Generate Client Cert File In Dir
     [Documentation]    Generate a CSR, key, and signed cert in the given directory using a name prefix.
     [Arguments]    ${tmpdir}    ${host}    ${cn}    ${cert_prefix}
-    Generate CSR And Key    ${tmpdir}/${cert_prefix}.key    ${tmpdir}/${cert_prefix}.csr    /CN=${cn}
+    Generate CSR And Key    ${tmpdir}/${cert_prefix}.key    ${tmpdir}/${cert_prefix}.csr    ${cn}
     VAR    ${san}=    subjectAltName = DNS.1:*.${BASE_DOMAIN},DNS.2:${host}
     Sign CSR With CA
     ...    ${tmpdir}/${cert_prefix}.csr
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Generate Client Cert File In Dir
[Documentation] Generate a CSR, key, and signed cert in the given directory using a name prefix.
[Arguments] ${tmpdir} ${host} ${cn} ${cert_prefix}
Generate CSR And Key ${tmpdir}/${cert_prefix}.key ${tmpdir}/${cert_prefix}.csr /CN=${cn}
VAR ${san}= subjectAltName = DNS.1:*.${BASE_DOMAIN},DNS.2:${host}
Sign CSR With CA
... ${tmpdir}/${cert_prefix}.csr
... ${tmpdir}/ca.crt
... ${tmpdir}/ca.key
... ${tmpdir}/${cert_prefix}.crt
... ${san}
Generate Client Cert File In Dir
[Documentation] Generate a CSR, key, and signed cert in the given directory using a name prefix.
[Arguments] ${tmpdir} ${host} ${cn} ${cert_prefix}
Generate CSR And Key ${tmpdir}/${cert_prefix}.key ${tmpdir}/${cert_prefix}.csr ${cn}
VAR ${san}= subjectAltName = DNS.1:*.${BASE_DOMAIN},DNS.2:${host}
Sign CSR With CA
... ${tmpdir}/${cert_prefix}.csr
... ${tmpdir}/ca.crt
... ${tmpdir}/ca.key
... ${tmpdir}/${cert_prefix}.crt
... ${san}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/resources/router.resource` around lines 338 - 348, The wrapper keyword
"Generate Client Cert File In Dir" is incorrectly prepending "/CN=" before the
${cn} when calling "Generate CSR And Key", causing double "/CN=/CN=..." for
callers that already provide a full subject; modify the call to Generate CSR And
Key to pass ${cn} unchanged (remove the hardcoded "/CN=" prefix) so the subject
provided by callers is forwarded verbatim.

Comment on lines +702 to +710
Verify Custom LB Ports And IP
[Documentation] Check the router-default LB has the expected IP and custom port numbers.
[Arguments] ${host_ip}
${lb_ips}= Get LB IPs
Should Contain ${lb_ips} ${host_ip}
${http_port}= Get LB Port http
Should Be Equal As Strings ${http_port} ${ALT_HTTP_PORT}
${https_port}= Get LB Port https
Should Be Equal As Strings ${https_port} ${ALT_HTTPS_PORT}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Check the custom LB IP set exactly.

Should Contain still passes if router-default exposes extra LB IPs. This test is meant to prove the custom listenAddress limits exposure to the selected host IP, so the assertion should fail when additional IPs are present.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/suites/router/router-config.robot` around lines 702 - 710, The test
"Verify Custom LB Ports And IP" currently uses "Get LB IPs" + "Should Contain",
which allows extra IPs; change it to assert exclusivity by checking the list
length and membership: after calling ${lb_ips}= Get LB IPs add "Length Should Be
${lb_ips}    1" and then keep or add "Should Contain    ${lb_ips}    ${host_ip}"
(or replace both with creating @{expected} with ${host_ip} and use "Lists Should
Be Equal    ${lb_ips}    ${expected}"). This ensures the router-default LB
exposes exactly the single custom ${host_ip}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants