Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,28 @@ jobs:
context:
running_env: "packit"

# Run package-mode migration coverage on a single guest alongside the main
# tier-1 integration plan.
- job: tests
trigger: pull_request
identifier: package-mode-tier-1
require:
label:
present:
- ci/tier-1
targets:
- centos-stream-10-x86_64
- centos-stream-10-aarch64
- fedora-latest-stable-x86_64
- fedora-latest-stable-aarch64
tmt_plan: /tmt/plans/package-mode
tf_extra_params:
environments:
- tmt:
context:
running_env: "packit"
package_source: "artifacts"

# ci/merge: full target set
- job: tests
trigger: pull_request
Expand All @@ -124,6 +146,28 @@ jobs:
context:
running_env: "packit"

- job: tests
trigger: pull_request
identifier: package-mode-full
require:
label:
present:
- ci/merge
targets:
- centos-stream-9-x86_64
- centos-stream-9-aarch64
- centos-stream-10-x86_64
- centos-stream-10-aarch64
- fedora-all-x86_64
- fedora-all-aarch64
tmt_plan: /tmt/plans/package-mode
tf_extra_params:
environments:
- tmt:
context:
running_env: "packit"
package_source: "artifacts"

- job: propose_downstream
trigger: release
dist_git_branches:
Expand Down
27 changes: 27 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,33 @@ build-ukiboot-update-test-image: build-ukiboot-test-image
test-ukiboot: build-ukiboot-update-test-image
cargo xtask run-tmt --env=BOOTC_variant=composefs --filesystem=ext4 --boot-type=aboot --seal-state=unsealed --upgrade-image={{ukiboot_img}}:v2 {{ukiboot_img}}:v1 aboot

# Run the package-mode migration plan against the current checkout image.
# The VM cannot share controller Podman storage, so transfer it as an OCI archive.
[group('testing')]
test-tmt-package-mode:
#!/bin/bash
set -euo pipefail
just build
archive_dir=$(mktemp -d -- tmt/plans/.package-mode-local.XXXXXX)
cleanup() {
rm -rf -- "$archive_dir"
}
trap cleanup EXIT
trap 'cleanup; exit 130' INT
trap 'cleanup; exit 143' TERM
archive_path="$archive_dir/bootc.oci"
if [[ -e "$archive_path" ]]; then
echo "Refusing to overwrite existing archive: $archive_path" >&2
exit 1
fi
podman save --format oci-archive --output "$archive_path" localhost/bootc
tmt \
--context=running_env=packit \
--context=package_source=local \
--context="test_disk_image=${test_disk_image:-centos-stream-10}" \
run --environment "PACKAGE_MODE_IMAGE_ARCHIVE=$archive_path" \
plans --name '^/tmt/plans/package-mode$'

# Split out from `test-container` because, unlike the container integration tests,
# unit tests don't depend on variant/filesystem/bootloader/boot_type/seal_state, so
# CI runs this once per OS (in the `package` job) instead of once per test-integration
Expand Down
15 changes: 11 additions & 4 deletions crates/lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ pub(crate) enum InstallOpts {
/// the running host root filesystem. Currently, the host root filesystem's `/boot` partition
/// will be wiped, but the content of the existing root will otherwise be retained, and will
/// need to be cleaned up if desired when rebooted into the new root.
///
/// When migrating from a package-mode system, use `--preserve-var` to copy `/var` data
/// into the new deployment before rebooting.
ToExistingRoot(crate::install::InstallToExistingRootOpts),
/// Nondestructively create a fresh installation state inside an existing bootc system.
///
Expand Down Expand Up @@ -2400,10 +2403,14 @@ async fn run_from_opt(opt: Opt) -> Result<CliExitStatus> {
InstallOpts::Mount(opts) => crate::mount::mount(opts).await,
#[cfg(feature = "install-to-disk")]
InstallOpts::ToDisk(opts) => crate::install::install_to_disk(opts).await,
InstallOpts::ToFilesystem(opts) => {
crate::install::install_to_filesystem(opts, false, crate::install::Cleanup::Skip)
.await
}
InstallOpts::ToFilesystem(opts) => crate::install::install_to_filesystem(
opts,
false,
crate::install::Cleanup::Skip,
false,
)
.await
.map(|_| ()),
InstallOpts::ToExistingRoot(opts) => {
crate::install::install_to_existing_root(opts).await
}
Expand Down
Loading
Loading