USHIFT-7117: Add common script for C2CC scenarios#6827
Conversation
|
@vanhalenar: This pull request references USHIFT-7117 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 story to target the "5.0.0" version, but no target version was set. DetailsIn 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. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughExtracts multi-host C2CC orchestration (readiness, C2CC YAML, firewall, VM lifecycle, test wiring, IPsec) into shared test helper ChangesC2CC Scenario Test Centralization
Sequence Diagram(s)sequenceDiagram
participant VMManager
participant Host1
participant Host2
participant Host3
participant MicroShift
participant IPsec
VMManager->>Host1: launch VM (host1)
VMManager->>Host2: launch VM (host2)
VMManager->>Host3: launch VM (host3)
Host1->>MicroShift: wait greenboot
Host2->>MicroShift: wait greenboot
Host3->>MicroShift: wait greenboot
Host1->>Host2: apply c2cc YAML + firewall
Host1->>Host3: apply c2cc YAML + firewall
Host1->>IPsec: configure PSK + tunnels
IPsec->>Host1: report tunnel status
Possibly Related PRs
Suggested Reviewers
🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vanhalenar The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
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/bin/c2cc_common.sh`:
- Around line 86-87: The defaulting for network and ip_family in c2cc_create_vms
is using ${3-default} and ${4-ipv4} which do not fall back when the argument is
an empty string; change these to use the shell "use default if unset or empty"
form ${3:-default} and ${4:-ipv4} so that network and ip_family are never empty
when passed to launch_vm (references: function c2cc_create_vms, variables
network and ip_family, and caller launch_vm).
🪄 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: fc459070-1f6e-4453-ad11-a1ce0d55788f
📒 Files selected for processing (5)
test/bin/c2cc_common.shtest/scenarios-bootc/el10/presubmits/el102-src@c2cc-ipv6.shtest/scenarios-bootc/el10/presubmits/el102-src@c2cc.shtest/scenarios-bootc/el9/presubmits/el98-src@c2cc-ipv6.shtest/scenarios-bootc/el9/presubmits/el98-src@c2cc.sh
There was a problem hiding this comment.
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/bin/c2cc_common.sh`:
- Around line 176-181: The assignments for host2_ip and host3_ip use command
substitution with local -r which masks failures; change to first capture the
output of get_vm_property into a non-readonly local variable (e.g., host2_ip_tmp
/ host3_ip_tmp) and immediately check the command exit status (or test for empty
value) like the pattern used in configure_c2cc_hosts, logging an error and
returning/non-zero on failure, then set the readonly kubeconfig path variables
(kubeconfig_b / kubeconfig_c) only after successful retrieval of
host2_ip/host3_ip so an empty IP cannot propagate.
🪄 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: 26f9f6ba-1ded-4cb5-afab-98b0b232db96
📒 Files selected for processing (7)
test/bin/c2cc_common.shtest/scenarios-bootc/el10/presubmits/el102-src@c2cc-ipsec.shtest/scenarios-bootc/el10/presubmits/el102-src@c2cc-ipv6.shtest/scenarios-bootc/el10/presubmits/el102-src@c2cc.shtest/scenarios-bootc/el9/presubmits/el98-src@c2cc-ipsec.shtest/scenarios-bootc/el9/presubmits/el98-src@c2cc-ipv6.shtest/scenarios-bootc/el9/presubmits/el98-src@c2cc.sh
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/bin/c2cc_common.sh (1)
30-33: ⚡ Quick winUse
get_host_ipfor consistent error handling.
get_vm_propertyfailure here leaveshost_ipempty and produces a confusing SSH error downstream. Theget_host_iphelper (line 24) handles this cleanly and is used inconfigure_c2cc_hosts.Proposed fix
for host in host1 host2 host3; do - local host_ip full_host - host_ip=$(get_vm_property "${host}" ip) + local host_ip + host_ip=$(get_host_ip "${host}") || return 1 + local full_host full_host=$(full_vm_name "${host}")🤖 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/bin/c2cc_common.sh` around lines 30 - 33, The loop currently calls get_vm_property to set host_ip which can return empty and cause confusing SSH errors; replace the get_vm_property call with the get_host_ip helper to obtain host_ip (while keeping full_host from full_vm_name) so failures are handled consistently like in configure_c2cc_hosts; update the loop that sets host_ip and full_host to use get_host_ip("${host}") instead of get_vm_property and ensure any early-exit or error message semantics from get_host_ip are preserved.
🤖 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.
Nitpick comments:
In `@test/bin/c2cc_common.sh`:
- Around line 30-33: The loop currently calls get_vm_property to set host_ip
which can return empty and cause confusing SSH errors; replace the
get_vm_property call with the get_host_ip helper to obtain host_ip (while
keeping full_host from full_vm_name) so failures are handled consistently like
in configure_c2cc_hosts; update the loop that sets host_ip and full_host to use
get_host_ip("${host}") instead of get_vm_property and ensure any early-exit or
error message semantics from get_host_ip are preserved.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 3ca7a0b3-a880-479b-8cea-c95df67b1d39
📒 Files selected for processing (5)
test/bin/c2cc_common.shtest/scenarios-bootc/el10/presubmits/el102-src@c2cc-ipv6.shtest/scenarios-bootc/el10/presubmits/el102-src@c2cc.shtest/scenarios-bootc/el9/presubmits/el98-src@c2cc-ipv6.shtest/scenarios-bootc/el9/presubmits/el98-src@c2cc.sh
🚧 Files skipped from review as they are similar to previous changes (3)
- test/scenarios-bootc/el9/presubmits/el98-src@c2cc-ipv6.sh
- test/scenarios-bootc/el10/presubmits/el102-src@c2cc-ipv6.sh
- test/scenarios-bootc/el9/presubmits/el98-src@c2cc.sh
| --variable "CLUSTER_C_DOMAIN:${CLUSTER_C_DOMAIN}" \ | ||
| --variable "KUBECONFIG_C:${kubeconfig_c}" \ | ||
| suites/c2cc-ipsec/ | ||
| c2cc_run_tests "suites/c2cc-ipsec/" |
There was a problem hiding this comment.
+ 15:10:42.236037388 microshift/test/bin/c2cc_common.sh:161 local -r suites_dir=suites/c2cc-ipsec/
/home/ec2-user/microshift/test/bin/c2cc_common.sh: line 162: 2: unbound variable
We need the c2cc_run_tests' $2 and $3 to be optional
|
@vanhalenar: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Summary by CodeRabbit
Tests
Refactor