-
Notifications
You must be signed in to change notification settings - Fork 231
USHIFT-7412: Add RPM presubmit scenarios #7175
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: main
Are you sure you want to change the base?
Changes from all commits
323860f
903fdd6
482e647
fb45a24
190d711
1183645
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,42 @@ | ||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Sourced from scenario.sh and uses functions defined there. | ||||||||||||||||||||||
|
Comment on lines
+1
to
+3
Contributor
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. 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win Use the required shell initialization in every scenario.
Proposed fix-#!/bin/bash
+#!/usr/bin/bash
+
+set -euo pipefailAs per coding guidelines, Shell scripts must use the 📝 Committable suggestion
Suggested change
📍 Affects 4 files
🤖 Prompt for AI AgentsSource: Coding guidelines |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # The installer ISO creates a bare RHEL VM without MicroShift or greenboot. | ||||||||||||||||||||||
| export SKIP_GREENBOOT=true | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Tests must run in order: install, test, remove. | ||||||||||||||||||||||
| export TEST_RANDOMIZATION=none | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| scenario_create_vms() { | ||||||||||||||||||||||
| prepare_kickstart host1 kickstart-liveimg.ks.template "" | ||||||||||||||||||||||
| launch_vm rhel102-installer | ||||||||||||||||||||||
| configure_vm_firewall host1 | ||||||||||||||||||||||
| subscription_manager_register host1 | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| scenario_remove_vms() { | ||||||||||||||||||||||
| remove_vm host1 | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| scenario_run_tests() { | ||||||||||||||||||||||
| local -r source_reponame=$(basename "${LOCAL_REPO}") | ||||||||||||||||||||||
| local -r source_repo_url="${WEB_SERVER_URL}/rpm-repos/${source_reponame}" | ||||||||||||||||||||||
| local -r target_version=$(local_rpm_version) | ||||||||||||||||||||||
|
Comment on lines
+23
to
+25
Contributor
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. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Do not mask command failures with
Proposed fix- local -r source_reponame=$(basename "${LOCAL_REPO}")
+ local source_reponame
+ source_reponame="$(basename -- "${LOCAL_REPO}")"
+ readonly source_reponame
local -r source_repo_url="${WEB_SERVER_URL}/rpm-repos/${source_reponame}"
- local -r target_version=$(local_rpm_version)
+ local target_version
+ target_version="$(local_rpm_version)"
+ readonly target_versionAs per coding guidelines, Shell scripts must pass 📝 Committable suggestion
Suggested change
📍 Affects 4 files
🤖 Prompt for AI AgentsSource: Coding guidelines |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| configure_rhocp_repo "${RHOCP_MINOR_Y}" 4 "${MINOR_VERSION}" | ||||||||||||||||||||||
| configure_rhocp_repo "${RHOCP_MINOR_Y_BETA}" 4 "${MINOR_VERSION}" | ||||||||||||||||||||||
| configure_rhocp_repo "${RHOCP_MINOR_Y1}" 4 "${PREVIOUS_MINOR_VERSION}" | ||||||||||||||||||||||
| configure_rhocp_repo "${RHOCP_MINOR_Y1_BETA}" 4 "${PREVIOUS_MINOR_VERSION}" | ||||||||||||||||||||||
| run_command_on_vm host1 "sudo subscription-manager release --set 10.2" | ||||||||||||||||||||||
| configure_fast_datapath_repo | ||||||||||||||||||||||
|
Contributor
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. 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift Configure a RHEL 10 Fast Datapath repository. On RHEL 10,
📍 Affects 2 files
🤖 Prompt for AI Agents |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| run_tests host1 \ | ||||||||||||||||||||||
| --exitonfailure \ | ||||||||||||||||||||||
| --variable "SOURCE_REPO_URL:${source_repo_url}" \ | ||||||||||||||||||||||
| --variable "TARGET_VERSION:${target_version}" \ | ||||||||||||||||||||||
| --variable "EXPECTED_OS_VERSION:10.2" \ | ||||||||||||||||||||||
| suites/rpm/install.robot \ | ||||||||||||||||||||||
| suites/standard1/ \ | ||||||||||||||||||||||
| suites/rpm/remove.robot | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Sourced from scenario.sh and uses functions defined there. | ||
|
|
||
| # The installer ISO creates a bare RHEL VM without MicroShift or greenboot. | ||
| export SKIP_GREENBOOT=true | ||
|
|
||
| # Tests must run in order: install, test, remove. | ||
| export TEST_RANDOMIZATION=none | ||
|
|
||
| scenario_create_vms() { | ||
| prepare_kickstart host1 kickstart-liveimg.ks.template "" | ||
| launch_vm rhel102-installer | ||
| configure_vm_firewall host1 | ||
| subscription_manager_register host1 | ||
| } | ||
|
|
||
| scenario_remove_vms() { | ||
| remove_vm host1 | ||
| } | ||
|
|
||
| scenario_run_tests() { | ||
| local -r source_reponame=$(basename "${LOCAL_REPO}") | ||
| local -r source_repo_url="${WEB_SERVER_URL}/rpm-repos/${source_reponame}" | ||
| local -r target_version=$(local_rpm_version) | ||
|
|
||
| configure_rhocp_repo "${RHOCP_MINOR_Y}" 4 "${MINOR_VERSION}" | ||
| configure_rhocp_repo "${RHOCP_MINOR_Y_BETA}" 4 "${MINOR_VERSION}" | ||
| configure_rhocp_repo "${RHOCP_MINOR_Y1}" 4 "${PREVIOUS_MINOR_VERSION}" | ||
| configure_rhocp_repo "${RHOCP_MINOR_Y1_BETA}" 4 "${PREVIOUS_MINOR_VERSION}" | ||
| run_command_on_vm host1 "sudo subscription-manager release --set 10.2" | ||
| configure_fast_datapath_repo | ||
|
|
||
| run_tests host1 \ | ||
| --exitonfailure \ | ||
| --variable "SOURCE_REPO_URL:${source_repo_url}" \ | ||
| --variable "TARGET_VERSION:${target_version}" \ | ||
| suites/rpm/install.robot \ | ||
| suites/standard2/ \ | ||
| suites/rpm/remove.robot | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Sourced from scenario.sh and uses functions defined there. | ||
|
|
||
| # The installer ISO creates a bare RHEL VM without MicroShift or greenboot. | ||
| export SKIP_GREENBOOT=true | ||
|
|
||
| # Tests must run in order: install, test, remove. | ||
| export TEST_RANDOMIZATION=none | ||
|
|
||
| scenario_create_vms() { | ||
| prepare_kickstart host1 kickstart-liveimg.ks.template "" | ||
| launch_vm rhel98-installer | ||
| configure_vm_firewall host1 | ||
| subscription_manager_register host1 | ||
| } | ||
|
|
||
| scenario_remove_vms() { | ||
| remove_vm host1 | ||
| } | ||
|
|
||
| scenario_run_tests() { | ||
| local -r source_reponame=$(basename "${LOCAL_REPO}") | ||
| local -r source_repo_url="${WEB_SERVER_URL}/rpm-repos/${source_reponame}" | ||
| local -r target_version=$(local_rpm_version) | ||
|
|
||
| configure_rhocp_repo "${RHOCP_MINOR_Y}" 4 "${MINOR_VERSION}" | ||
| configure_rhocp_repo "${RHOCP_MINOR_Y_BETA}" 4 "${MINOR_VERSION}" | ||
| configure_rhocp_repo "${RHOCP_MINOR_Y1}" 4 "${PREVIOUS_MINOR_VERSION}" | ||
| configure_rhocp_repo "${RHOCP_MINOR_Y1_BETA}" 4 "${PREVIOUS_MINOR_VERSION}" | ||
| run_command_on_vm host1 "sudo subscription-manager release --set 9.8" | ||
| configure_fast_datapath_repo | ||
|
|
||
| run_tests host1 \ | ||
| --exitonfailure \ | ||
| --variable "SOURCE_REPO_URL:${source_repo_url}" \ | ||
| --variable "TARGET_VERSION:${target_version}" \ | ||
| --variable "EXPECTED_OS_VERSION:9.8" \ | ||
| suites/rpm/install.robot \ | ||
| suites/standard1/ \ | ||
| suites/rpm/remove.robot | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Sourced from scenario.sh and uses functions defined there. | ||
|
|
||
| # The installer ISO creates a bare RHEL VM without MicroShift or greenboot. | ||
| export SKIP_GREENBOOT=true | ||
|
|
||
| # Tests must run in order: install, test, remove. | ||
| export TEST_RANDOMIZATION=none | ||
|
|
||
| scenario_create_vms() { | ||
| prepare_kickstart host1 kickstart-liveimg.ks.template "" | ||
| launch_vm rhel98-installer | ||
| configure_vm_firewall host1 | ||
| subscription_manager_register host1 | ||
| } | ||
|
|
||
| scenario_remove_vms() { | ||
| remove_vm host1 | ||
| } | ||
|
|
||
| scenario_run_tests() { | ||
| local -r source_reponame=$(basename "${LOCAL_REPO}") | ||
| local -r source_repo_url="${WEB_SERVER_URL}/rpm-repos/${source_reponame}" | ||
| local -r target_version=$(local_rpm_version) | ||
|
|
||
| configure_rhocp_repo "${RHOCP_MINOR_Y}" 4 "${MINOR_VERSION}" | ||
| configure_rhocp_repo "${RHOCP_MINOR_Y_BETA}" 4 "${MINOR_VERSION}" | ||
| configure_rhocp_repo "${RHOCP_MINOR_Y1}" 4 "${PREVIOUS_MINOR_VERSION}" | ||
| configure_rhocp_repo "${RHOCP_MINOR_Y1_BETA}" 4 "${PREVIOUS_MINOR_VERSION}" | ||
| run_command_on_vm host1 "sudo subscription-manager release --set 9.8" | ||
| configure_fast_datapath_repo | ||
|
|
||
| run_tests host1 \ | ||
| --exitonfailure \ | ||
| --variable "SOURCE_REPO_URL:${source_repo_url}" \ | ||
| --variable "TARGET_VERSION:${target_version}" \ | ||
| suites/rpm/install.robot \ | ||
| suites/standard2/ \ | ||
| suites/rpm/remove.robot | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Do not suppress EPEL installation failures.
|| trueallows the required EPEL setup to fail silently. If the repository installation fails, Line 216 may fail later becauseparalleldepends on EPEL. Remove|| true, or handle only the already-installed case explicitly.🧰 Tools
🪛 Shellcheck (0.11.0)
[warning] 215-215: This { is literal. Check expression (missing ;/\n?) or quote it.
(SC1083)
[warning] 215-215: This } is literal. Check expression (missing ;/\n?) or quote it.
(SC1083)
🤖 Prompt for AI Agents
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/microshift
Length of output: 1114
🏁 Script executed:
Repository: openshift/microshift
Length of output: 3437
🏁 Script executed:
Repository: openshift/microshift
Length of output: 11518
🏁 Script executed:
Repository: openshift/microshift
Length of output: 11787
🏁 Script executed:
Repository: openshift/microshift
Length of output: 11787
🏁 Script executed:
Repository: openshift/microshift
Length of output: 50377
Use the required shebang and fix the RPM macro quoting.
#!/usr/bin/bash.rpm -E %{rhel}torpm -E '%{rhel}'to remove SC1083.shellcheck --external-sources test/bin/ci_phase_iso_build.sh.🧰 Tools
🪛 Shellcheck (0.11.0)
[warning] 215-215: This { is literal. Check expression (missing ;/\n?) or quote it.
(SC1083)
[warning] 215-215: This } is literal. Check expression (missing ;/\n?) or quote it.
(SC1083)
🤖 Prompt for AI Agents
Sources: Coding guidelines, Linters/SAST tools