-
Couldn't load subscription status.
- Fork 40
WIP: Add TMT gating test and workflow for bootupd #967
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
Open
aaradhak
wants to merge
5
commits into
coreos:main
Choose a base branch
from
aaradhak:gatingtestbootupd
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 1 |
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,50 @@ | ||
| name: TMT Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
| inputs: | ||
| plan_filter: | ||
| description: | | ||
| Test plan filter name, ie: tag:smoke. | ||
| If provided, only tests matching this filter will be run, otherwise all tests will be run. | ||
| required: false | ||
| default: '' | ||
| use_built_from_src: | ||
| description: 'Built bootupd from source instead of install distro package' | ||
| required: false | ||
| default: 'true' | ||
|
|
||
| jobs: | ||
| tmt-tests: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| set -x -e -o pipefail | ||
| sudo apt-get update | ||
| sudo apt-get install -y podman libblkid-dev rsync | ||
| pip install --user tmt | ||
|
|
||
| - name: Run TMT tests | ||
| run: | | ||
| set -x -e -o pipefail | ||
| if [ "$ACT" = "true" ]; then | ||
| echo "Running locally using ACT" | ||
| TMT_PROVISION_OPTS="--how local --feeling-safe" | ||
| else | ||
| TMT_PROVISION_OPTS="--how container" | ||
| fi | ||
| if [ -n "${{ github.event.inputs.plan_filter }}" ]; then | ||
| PLAN_FILTER_PARAM="plan --filter '${{ github.event.inputs.plan_filter }}'" | ||
| fi | ||
| eval "tmt run --all --debug -vvvv provision $TMT_PROVISION_OPTS $PLAN_FILTER_PARAM" |
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,32 @@ | ||
| summary: check bootupd package installation and basic functionality | ||
| tag: | ||
| - smoke | ||
| test: | | ||
| set -x -e -o pipefail | ||
|
|
||
| # Check if bootupctl is available | ||
| if ! command -v bootupctl &> /dev/null; then | ||
| echo "bootupctl command not found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Get architecture | ||
| arch="$(uname --machine)" | ||
|
|
||
| # Run bootupctl status and check output | ||
| output=$(bootupctl status | tr -d '\r') | ||
|
|
||
| if [[ "${arch}" == "x86_64" ]]; then | ||
| expected_components='Available components: BIOS EFI' | ||
| else | ||
| # Assume aarch64 for now | ||
| expected_components='Available components: EFI' | ||
| fi | ||
|
|
||
| if [ "${expected_components}" != "${output}" ]; then | ||
| echo "Expected: ${expected_components}" | ||
| echo "Got: ${output}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "bootupd package and bootupctl status test passed" |
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,32 @@ | ||
| # This prepare is used to control when bootupd is installed using | ||
| # the distribution package or when it is built from source in the test environment | ||
| prepare: | ||
| - name: Set BOOTUPD_BIN_DIR when built from source | ||
| when: use_built_from_src is defined and use_built_from_src == true | ||
| how: shell | ||
| script: | | ||
| set -x -e -o pipefail | ||
| echo "Preparing the test environment" | ||
| BOOTUPD_BIN_NAME="bootupd" | ||
| PARENT_DIR=$(dirname "${TMT_TREE}") | ||
| BOOTUPD_BIN_FULL_PATH=$(find "${PARENT_DIR}" -type f -name "${BOOTUPD_BIN_NAME}") | ||
| if [ -z "${BOOTUPD_BIN_FULL_PATH}" ]; then | ||
| echo "bootupd file not found." | ||
| exit 1 | ||
| elif [ "$(echo "${BOOTUPD_BIN_FULL_PATH}" | wc -l)" -gt 1 ]; then | ||
| echo "error: found multiple 'bootupd' binaries:" >&2 | ||
| echo "${BOOTUPD_BIN_FULL_PATH}" >&2 | ||
| exit 1 | ||
| fi | ||
| BOOTUPD_BIN_DIR=$(dirname "${BOOTUPD_BIN_FULL_PATH}") | ||
| echo "BOOTUPD_BIN_DIR=${BOOTUPD_BIN_DIR}" > /tmp/bootupd_bin_dir | ||
| - name: Install bootupd package | ||
| when: use_built_from_src is not defined or use_built_from_src == false | ||
| how: install | ||
| package: bootupd | ||
| - name: Set BOOTUPD_BIN_DIR when installed package | ||
| when: use_built_from_src is not defined or use_built_from_src == false | ||
| how: shell | ||
| script: | | ||
| set -x -e -o pipefail | ||
| echo "BOOTUPD_BIN_DIR=/usr/libexec" > /tmp/bootupd_bin_dir | ||
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,8 @@ | ||
| summary: Basic smoke test | ||
| tag: | ||
| - smoke | ||
| discover: | ||
| how: fmf | ||
| filter: "tag: smoke" | ||
| execute: | ||
| how: tmt |
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.
Uh oh!
There was an error while loading. Please reload this page.