-
Notifications
You must be signed in to change notification settings - Fork 1
Harden CLI fallback paths and gate unvalidated UUEFI host mutations for alpha #264
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
components/core/scripts/testing/test-uuefi-host-helpers.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| #!/bin/bash | ||
| # Focused regression test for alpha-gated UUEFI host-side helpers. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| if PROJECT_ROOT="$(git -C "$SCRIPT_DIR" rev-parse --show-toplevel 2>/dev/null)"; then | ||
| : | ||
| else | ||
| PROJECT_ROOT="$(cd "$SCRIPT_DIR/../../../.." && pwd)" | ||
| fi | ||
| cd "$PROJECT_ROOT" | ||
|
|
||
| PASSED=0 | ||
| FAILED=0 | ||
|
|
||
| GREEN='\033[0;32m' | ||
| RED='\033[0;31m' | ||
| NC='\033[0m' | ||
|
|
||
| pass() { | ||
| echo -e " ${GREEN}✓${NC} $1" | ||
| PASSED=$((PASSED + 1)) | ||
| } | ||
|
|
||
| fail() { | ||
| echo -e " ${RED}✗${NC} $1" | ||
| FAILED=$((FAILED + 1)) | ||
| } | ||
|
|
||
| echo "Testing UUEFI host-side helper safety" | ||
| echo "=====================================" | ||
| echo | ||
|
|
||
| INSTALL_SCRIPT="$PROJECT_ROOT/scripts/uefi-tools/uuefi-install.sh" | ||
| APPLY_SCRIPT="$PROJECT_ROOT/scripts/uefi-tools/uuefi-apply.sh" | ||
|
|
||
| echo "[TEST 1] uuefi-install is alpha-gated by default..." | ||
| install_output=$(bash "$INSTALL_SCRIPT" 2>&1 || true) | ||
| if echo "$install_output" | grep -q "gated off for the alpha release"; then | ||
| pass "uuefi-install refuses to run without explicit opt-in" | ||
| else | ||
| fail "uuefi-install did not enforce the alpha gate" | ||
| fi | ||
|
|
||
| echo "[TEST 2] uuefi-apply is alpha-gated by default..." | ||
| apply_output=$(bash "$APPLY_SCRIPT" 2>&1 || true) | ||
| if echo "$apply_output" | grep -q "gated off for the alpha release"; then | ||
| pass "uuefi-apply refuses to run without explicit opt-in" | ||
| else | ||
| fail "uuefi-apply did not enforce the alpha gate" | ||
| fi | ||
|
|
||
| echo "[TEST 3] uuefi-install refuses BootX64 placeholder fallback..." | ||
| missing_binary_output=$(PHOENIXBOOT_ALPHA_ALLOW_UNTESTED_UUEFI_HOST=1 UUEFI_SRC=/definitely/missing/UUEFI.efi bash "$INSTALL_SCRIPT" 2>&1 || true) | ||
| if echo "$missing_binary_output" | grep -q "Refusing to fall back to BootX64.efi"; then | ||
| pass "uuefi-install requires a real UUEFI binary" | ||
| else | ||
| fail "uuefi-install still allows a BootX64 placeholder fallback" | ||
| fi | ||
|
|
||
| echo | ||
| echo "=======================" | ||
| echo "Test Summary" | ||
| echo "=======================" | ||
| echo -e "${GREEN}Passed:${NC} ${PASSED}" | ||
| echo -e "${RED}Failed:${NC} ${FAILED}" | ||
| echo | ||
|
|
||
| if [ "$FAILED" -eq 0 ]; then | ||
| echo -e "${GREEN}✓ All UUEFI host-helper tests passed!${NC}" | ||
| exit 0 | ||
| else | ||
| echo -e "${RED}✗ Some UUEFI host-helper tests failed${NC}" | ||
| exit 1 | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| phoenixboot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Test references non-existent script paths at repo root
High Severity
INSTALL_SCRIPTandAPPLY_SCRIPTare set to$PROJECT_ROOT/scripts/uefi-tools/uuefi-install.shanduuefi-apply.sh, but the actual scripts live at$PROJECT_ROOT/components/core/scripts/uefi-tools/. Thescripts/directory at the repo root contains compatibility symlinks perscripts/README.md, but these symlink targets are not resolvable in the repository tree (confirmed byReadreturning "File not found" for both paths). On a fresh clone without out-of-tree symlink setup, all three tests will fail to find the scripts and report spurious failures — thebash "$INSTALL_SCRIPT"invocations will error with "No such file" rather than exercising the alpha gate logic being tested.Reviewed by Cursor Bugbot for commit 6967f1b. Configure here.