Skip to content

USHIFT-6870: Add e2e test for router service IP connectivity#6515

Open
pacevedom wants to merge 1 commit intoopenshift:mainfrom
pacevedom:OCPBUGS-45192
Open

USHIFT-6870: Add e2e test for router service IP connectivity#6515
pacevedom wants to merge 1 commit intoopenshift:mainfrom
pacevedom:OCPBUGS-45192

Conversation

@pacevedom
Copy link
Copy Markdown
Contributor

@pacevedom pacevedom commented Apr 16, 2026

Summary by CodeRabbit

Tests

  • Added comprehensive test coverage for IPv6 dual stack router service connectivity, validating IPv4 route creation, service accessibility across multiple router IP addresses, system behavior during router deployment restarts, and complete resource lifecycle management with proper cleanup procedures for test isolation.

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 16, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@pacevedom: This pull request references Jira Issue OCPBUGS-45192, which is invalid:

  • expected the bug to target either version "5.0." or "openshift-5.0.", but it targets "4.19.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

Walkthrough

Added a new test case "Router Service IP Connectivity" to verify dual stack IPv4 route connectivity through router LoadBalancer IPs, along with two supporting keywords for retrieving router service IPs and validating SSH+cURL access from the host.

Changes

Cohort / File(s) Summary
IPv6 Dual Stack Test
test/suites/ipv6/dualstack.robot
Added "Router Service IP Connectivity" test case that configures dual stack, deploys a hello service via IPv4 route, and validates connectivity from host to each router LoadBalancer IP. Introduced two keywords: Get Router Service IPs to retrieve LoadBalancer ingress IPs, and Access Hello MicroShift From Host to execute SSH+cURL validation against a given router IP and port.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 9 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning The new Access Hello MicroShift From Host keyword lacks meaningful failure messages on three assertions, inconsistent with other assertions in the same file that include descriptive messages. Add descriptive messages to the three assertions: include 'SSH curl command failed with exit code' for rc check, 'Response missing HTTP 200 status' for HTTP check, and 'Response missing expected Hello MicroShift content' for content check.
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed All test names and keywords are stable and deterministic with no dynamic identifiers, timestamps, or IP addresses embedded.
Microshift Test Compatibility ✅ Passed Custom check for Ginkgo e2e tests does not apply to Robot Framework test files like dualstack.robot.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Custom check designed for Ginkgo e2e tests in OpenShift environment is not applicable to Robot Framework test file in MicroShift repository.
Topology-Aware Scheduling Compatibility ✅ Passed PR adds only Robot Framework test code for router service IP connectivity in dual-stack IPv6 environment, not production deployment manifests or operator code.
Ote Binary Stdout Contract ✅ Passed The pull request modifies only Robot Framework test files, not Go binaries. The OTE Binary Stdout Contract does not apply since no process-level code is modified.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR adds Robot Framework tests to test/suites/ipv6/dualstack.robot, not Ginkgo e2e tests. Custom check targets Ginkgo tests (It(), Describe(), Context(), When() functions), making it inapplicable.
Title check ✅ Passed The title clearly summarizes the main addition: an e2e test for router service IP connectivity, which directly matches the changeset.

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

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci openshift-ci Bot requested review from agullon and vanhalenar April 16, 2026 14:30
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 16, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pacevedom

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 Apr 16, 2026
Copy link
Copy Markdown

@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

🧹 Nitpick comments (1)
test/suites/standard1/networking-smoke.robot (1)

79-90: Prefer reusing existing shared router-IP keyword to avoid drift.

This duplicates logic already provided in test/resources/microshift-network.resource (Get All IPs From Router Default LB, snippet lines 1-100). Reusing the shared keyword keeps LB IP parsing behavior consistent across suites.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/suites/standard1/networking-smoke.robot` around lines 79 - 90, The
keyword Get Router Service IPs duplicates parsing logic already provided by the
shared keyword Get All IPs From Router Default LB; replace the body of Get
Router Service IPs with a single call to Get All IPs From Router Default LB and
return its result (e.g., @{ips}=    Get All IPs From Router Default LB    RETURN
@{ips}), ensuring you keep the same return variable name (@{ips}) so callers
remain unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/suites/standard1/networking-smoke.robot`:
- Around line 46-50: The test currently calls Get Router Service IPs once into
@{ips} immediately after router restart which can return empty/partial results;
wrap that discovery in a retry (e.g., a loop using Wait Until Keyword Succeeds
or Retry Keyword) so Get Router Service IPs is retried until non-empty before
iterating FOR ${ip} IN @{ips}; keep the existing inner Wait Until Keyword
Succeeds + Access Hello Microshift Success logic (using ${HTTP_PORT} and
ushift_ip=${ip}) but ensure @{ips} is reobtained/revalidated by Get Router
Service IPs on each retry attempt to avoid flakes.

---

Nitpick comments:
In `@test/suites/standard1/networking-smoke.robot`:
- Around line 79-90: The keyword Get Router Service IPs duplicates parsing logic
already provided by the shared keyword Get All IPs From Router Default LB;
replace the body of Get Router Service IPs with a single call to Get All IPs
From Router Default LB and return its result (e.g., @{ips}=    Get All IPs From
Router Default LB    RETURN    @{ips}), ensuring you keep the same return
variable name (@{ips}) so callers remain unchanged.
🪄 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: Pro Plus

Run ID: 9aafb157-3429-43e2-a8ba-9a87aa1f97f3

📥 Commits

Reviewing files that changed from the base of the PR and between 87d90b3 and 4ef04e7.

📒 Files selected for processing (1)
  • test/suites/standard1/networking-smoke.robot

Comment on lines +46 to +50
@{ips}= Get Router Service IPs
FOR ${ip} IN @{ips}
Wait Until Keyword Succeeds 10x 6s
... Access Hello Microshift Success ${HTTP_PORT} ushift_ip=${ip}
END
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add retry around IP discovery to prevent post-restart flakes.

Line 46 fetches ingress IPs only once right after router restart. If LB status isn’t populated yet, the test fails before Line 48 retries can help.

Proposed fix
-    @{ips}=    Get Router Service IPs
+    @{ips}=    Wait Until Keyword Succeeds    10x    6s    Get Router Service IPs
     FOR    ${ip}    IN    @{ips}
         Wait Until Keyword Succeeds    10x    6s
         ...    Access Hello Microshift Success    ${HTTP_PORT}    ushift_ip=${ip}
     END
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/suites/standard1/networking-smoke.robot` around lines 46 - 50, The test
currently calls Get Router Service IPs once into @{ips} immediately after router
restart which can return empty/partial results; wrap that discovery in a retry
(e.g., a loop using Wait Until Keyword Succeeds or Retry Keyword) so Get Router
Service IPs is retried until non-empty before iterating FOR ${ip} IN @{ips};
keep the existing inner Wait Until Keyword Succeeds + Access Hello Microshift
Success logic (using ${HTTP_PORT} and ushift_ip=${ip}) but ensure @{ips} is
reobtained/revalidated by Get Router Service IPs on each retry attempt to avoid
flakes.

Copy link
Copy Markdown

@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.

🧹 Nitpick comments (3)
test/suites/ipv6/dualstack.robot (3)

91-111: Consider dropping Restart Router from setup or justifying its need.

The two sibling tests restart the router to resync routes after apiserver churn. This new test follows the same pattern, which is fine — but since it runs after them in the same suite, the restart here mostly duplicates work. Not a blocker; leave it if you prefer symmetry/robustness.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/suites/ipv6/dualstack.robot` around lines 91 - 111, The test "Router
Service IP Connectivity" re-runs "Restart Router" in its [Setup] which
duplicates the restart performed by sibling tests; remove the "Restart Router"
step from the test's [Setup] to avoid redundant work or alternatively add an
explicit justification comment in the test documentation (the [Documentation]
block) explaining why the restart is necessary for this test; update the Setup
block that currently contains "Restart Router" (and any related sequence like
"Create Hello MicroShift Pod", "Expose Hello MicroShift Service Via Route IPv4")
to either omit the "Restart Router" line or document why it must remain.

171-181: -k is a no-op for http:// and Log Many on failure loses stderr.

Two small nits:

  • curl -k only affects TLS; the URL here is plain http://. Safe to drop.
  • On non-zero rc, Should Be Equal As Integers fails before Log Many runs, so stderr never gets logged. Consider logging before assertions to aid debugging of the retry loop.
♻️ Proposed tweak
-    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command
-    ...    curl -k -i --connect-to "${hostname}::${ip}:" "http://${hostname}:${port}"
-    ...    sudo=False    return_rc=True    return_stderr=True    return_stdout=True
-    Log Many    ${stdout}    ${stderr}
-    Should Be Equal As Integers    0    ${rc}
+    ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command
+    ...    curl -i --connect-to "${hostname}::${ip}:" "http://${hostname}:${port}"
+    ...    sudo=False    return_rc=True    return_stderr=True    return_stdout=True
+    Log Many    rc=${rc}    stdout=${stdout}    stderr=${stderr}
+    Should Be Equal As Integers    ${rc}    0
     Should Match Regexp    ${stdout}    HTTP.*200
     Should Contain    ${stdout}    Hello MicroShift
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/suites/ipv6/dualstack.robot` around lines 171 - 181, In the Access Hello
MicroShift From Host test, remove the redundant curl -k flag (curl is using
http://) inside the SSHLibrary.Execute Command call, and move the Log Many
${stdout} ${stderr} line to immediately after the Execute Command so stderr is
logged before any assertions; reference the Add Brackets If Ipv6 preprocessing
and the SSHLibrary.Execute Command invocation and keep the subsequent assertions
(Should Be Equal As Integers, Should Match Regexp, Should Contain) unchanged.

159-169: LGTM — but worth asserting both families are present.

Since the suite name advertises dual stack and the PR’s intent is to validate connectivity across all router IPs, consider asserting the returned list contains at least one IPv4 and one IPv6 address. That way, a regression where the LB only advertises one family is caught here rather than masquerading as a passing test that iterated a single IP.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/suites/ipv6/dualstack.robot` around lines 159 - 169, Update the "Get
Router Service IPs" keyword to assert that the returned @{ips} list contains at
least one IPv4 and one IPv6 address: after calling "Split String    ${output}"
and before "RETURN    @{ips}", add two assertions (e.g., using Robot's regex
match/contain keywords) that check for an IPv4 pattern and an IPv6 pattern
across the list entries returned by "Oc Get JsonPath" (use ${output} or @{ips}
for the checks) so the test fails if only one address family is advertised by
the load balancer.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@test/suites/ipv6/dualstack.robot`:
- Around line 91-111: The test "Router Service IP Connectivity" re-runs "Restart
Router" in its [Setup] which duplicates the restart performed by sibling tests;
remove the "Restart Router" step from the test's [Setup] to avoid redundant work
or alternatively add an explicit justification comment in the test documentation
(the [Documentation] block) explaining why the restart is necessary for this
test; update the Setup block that currently contains "Restart Router" (and any
related sequence like "Create Hello MicroShift Pod", "Expose Hello MicroShift
Service Via Route IPv4") to either omit the "Restart Router" line or document
why it must remain.
- Around line 171-181: In the Access Hello MicroShift From Host test, remove the
redundant curl -k flag (curl is using http://) inside the SSHLibrary.Execute
Command call, and move the Log Many ${stdout} ${stderr} line to immediately
after the Execute Command so stderr is logged before any assertions; reference
the Add Brackets If Ipv6 preprocessing and the SSHLibrary.Execute Command
invocation and keep the subsequent assertions (Should Be Equal As Integers,
Should Match Regexp, Should Contain) unchanged.
- Around line 159-169: Update the "Get Router Service IPs" keyword to assert
that the returned @{ips} list contains at least one IPv4 and one IPv6 address:
after calling "Split String    ${output}" and before "RETURN    @{ips}", add two
assertions (e.g., using Robot's regex match/contain keywords) that check for an
IPv4 pattern and an IPv6 pattern across the list entries returned by "Oc Get
JsonPath" (use ${output} or @{ips} for the checks) so the test fails if only one
address family is advertised by the load balancer.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: c4f45c14-f47d-441e-8d6c-dc95c43b0ce5

📥 Commits

Reviewing files that changed from the base of the PR and between 13d5056 and c4a39ab.

📒 Files selected for processing (1)
  • test/suites/ipv6/dualstack.robot

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 17, 2026

@pacevedom: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@pacevedom pacevedom changed the title OCPBUGS-45192: Add e2e test for router service IP connectivity USHIFT-6870: Add e2e test for router service IP connectivity Apr 21, 2026
@openshift-ci-robot openshift-ci-robot removed jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 21, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 21, 2026

@pacevedom: This pull request references USHIFT-6870 which is a valid jira issue.

Details

In response to this:

Summary by CodeRabbit

Tests

  • Added comprehensive test coverage for IPv6 dual stack router service connectivity, validating IPv4 route creation, service accessibility across multiple router IP addresses, system behavior during router deployment restarts, and complete resource lifecycle management with proper cleanup procedures for test isolation.

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.

@pacevedom
Copy link
Copy Markdown
Contributor Author

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Apr 21, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@pacevedom: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI

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.

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants