ci: support testing from brew builds - #20
Conversation
knecasov
left a comment
There was a problem hiding this comment.
I added several comments.
I tested the changes using commands in the PR description.
I think that the following command should include BOOTC_BASE_IMAGE and DOWNLOAD_NODE for an easy local testing.
# Compose repository (bootc deployment)
sudo env COMPOSE_BASE_URL="http://<host>/.../RHEL-10.2-<date>/compose" \
./test/bootc/test-onboarding.sh
1c6579d to
df91657
Compare
Done @knecasov, thanks. |
knecasov
left a comment
There was a problem hiding this comment.
LGTM, thank you very much for incorporating my notes!
mmartinv
left a comment
There was a problem hiding this comment.
I think we need to simplify this PR and scope it to support installations from brew RPMs only. Some changes are not related and deserve their own PR and some other changes are already done in a different PR.
Also before doing any further changes to rpm/bootc tests we need to add github workflows to trigger the corresponding tmt tests or we won't be able to see the test results of those changes.
df91657 to
e80f7c3
Compare
The PR has been simplified to support installations from brew RPMs only. |
| local rhel_repo_file="" | ||
| if [[ "${ID}" == "rhel" ]] && [ -n "${DOWNLOAD_NODE:-}" ]; then | ||
| local major_ver="${VERSION_ID%%.*}" # e.g. "10" from "10.2" | ||
| rhel_repo_file="files/rhel-${VERSION_ID}.repo" | ||
| mkdir -p files | ||
| cat > "${rhel_repo_file}" << EOF | ||
| [RHEL-${VERSION_ID}-NIGHTLY-BaseOS] | ||
| name=baseos | ||
| baseurl=http://${DOWNLOAD_NODE}/rhel-${major_ver}/nightly/RHEL-${major_ver}/latest-RHEL-${VERSION_ID}/compose/BaseOS/\$basearch/os | ||
| enabled=1 | ||
| # Nightly compose builds are not GPG-signed; gpgcheck=0 is intentional. | ||
| gpgcheck=0 | ||
| sslverify=0 | ||
| [RHEL-${VERSION_ID}-NIGHTLY-AppStream] | ||
| name=appstream | ||
| baseurl=http://${DOWNLOAD_NODE}/rhel-${major_ver}/nightly/RHEL-${major_ver}/latest-RHEL-${VERSION_ID}/compose/AppStream/\$basearch/os | ||
| enabled=1 | ||
| # Nightly compose builds are not GPG-signed; gpgcheck=0 is intentional. | ||
| gpgcheck=0 | ||
| sslverify=0 | ||
| EOF | ||
| fi |
There was a problem hiding this comment.
Why is this needed? the client RPMs has no dependencies AFAIK
There was a problem hiding this comment.
Done, the rhel_repo_file block (and the corresponding COPY step) have been removed from test/bootc/utils.sh, since nothing in the current install_client-only Containerfile path needs it @knecasov
There was a problem hiding this comment.
@mcattamoredhat, did you try to run the tests, please?
There was a problem hiding this comment.
@knecasov @mmartinv after running the tests locally, I've seen that we need this code snippet back, otherwise anaconda-iso fails due to the following issue:
+ generate_iso_from_bootc
+ rm -fr output
+ mkdir -pv output
mkdir: created directory 'output'
++ pwd
+ sudo podman run --rm -it --privileged --pull=newer --security-opt label=type:unconfined_t -v /home/admin/go-fdo-ci/output:/output -v /var/lib/containers/storage:/var/lib/containers/storage quay.io/centos-bootc/bootc-image-builder:latest --type anaconda-iso --rootfs xfs --use-librepo=true localhost/fdo-bootc:latest
Trying to pull quay.io/centos-bootc/bootc-image-builder:latest...
Getting image source signatures
Copying blob 7f84c9a39298 done |
Copying blob 419b79a05f4b done |
Copying config ba9dec3a9a done |
Writing manifest to image destination
NoReposError: There was a problem finding repositories: There are no enabled repositories
[-] Manifest generation step
Message: Generating manifest manifest-anaconda-iso.json
2026/08/04 14:58:55 error: cannot build manifest: cannot depsolve: DNF error occurred: NoReposError: There was a problem finding repositories: There are no enabled repositories
+ on_failure
+ trap - EXIT
I've included the code again, and the tests are ok.
e80f7c3 to
52450b7
Compare
Add support for installing go-fdo-client/go-fdo-server RPMs from an
internal brew build in test/rpm and test/bootc, in addition to the
existing COPR/Packit/local-build paths.
Set BREW_CLIENT_RPMS_URL / BREW_SERVER_RPMS_URL to a build's
version/release directory in brew to install the client/server RPMs
straight from an internal brew server. Self-signed certs and unsigned
builds are expected on internal brew servers, so --nogpgcheck
--setopt=sslverify=false is used intentionally.
rpms_from_brew_url() (test/ci/utils.sh) lists the RPM URLs actually
published under a brew build's ${arch}/ and noarch/ directories,
rather than hardcoding each sub-package's name, so it doesn't need to
be kept in sync whenever brew's package layout changes.
test/bootc also recognizes rhel-10* as a base image (overridable via
BOOTC_BASE_IMAGE) and generates a RHEL nightly-compose repo file at
runtime when DOWNLOAD_NODE is set, so the container build can reach
RHEL packages while installing go-fdo-client.
Assisted-by: Claude (claude-sonnet-5)
Signed-off-by: Mario Cattamo <mcattamo@redhat.com>
52450b7 to
5537c70
Compare
run_test() (test/ci/test-onboarding.sh) generated service certificates before installing go-fdo-client/go-fdo-server. That ordering never mattered for the default generate_service_certs(), which just runs openssl locally with no dependency on either package being installed. test/rpm/test-onboarding-defaults.sh overrides generate_service_certs() to instead call the go-fdo-server RPM's own /usr/libexec/go-fdo-server/generate-go-fdo-server-certs.sh, which only exists after install_server() has installed the package. Because run_test() called it first, the override always failed with "command not found", and every step downstream failed in turn. Swap the two steps: install_client/install_server now run before generate_service_certs. Safe for every existing caller of this shared run_test(), since neither direction of dependency exists for the default cert generation. Assisted-by: Claude (claude-sonnet-5) Signed-off-by: Mario Cattamo <mcattamo@redhat.com>
djach7
left a comment
There was a problem hiding this comment.
LGTM, ran through this one and didn't hit any blockers on my end.
knecasov
left a comment
There was a problem hiding this comment.
LGTM, thank you very much for the changes!
Summary
This PR ports the brew-build test support introduced in fido-device-onboard/go-fdo-server#239 into go-fdo-ci's shared test infrastructure (
test/ci/utils.sh,test/rpm/utils.sh,test/bootc/utils.sh), sotest/rpmandtest/bootcdeployments here can install packages from an internal brew build, in addition to the existing COPR/Packit/local-build paths.What's new
BREW_CLIENT_RPMS_URL/BREW_SERVER_RPMS_URLto a build's version/release directory to install go-fdo-client/go-fdo-server RPMs straight from an internal brew server (self-signed certs and unsigned builds are expected, so--nogpgcheck --setopt=sslverify=falseis used intentionally).test/bootcnow recognizesrhel-10*as a base image (overridable viaBOOTC_BASE_IMAGE) and generates a RHEL nightly-compose repo file at runtime whenDOWNLOAD_NODEis set, so the container build can reach RHEL packages.Usage:
Notes
rpms_from_brew_url()lives intest/ci/utils.shsince bothtest/rpm/utils.shandtest/bootc/utils.shsource down to it (bootc → rpm → ci); it lists the RPM URLs actually published under a brew build's${arch}/andnoarch/directories rather than hardcoding each sub-package's name/version/release, so it doesn't need a code change when brew's package layout changes.test/rpm/utils.shretains its existing SELinux AVC-denial collection logic, which doesn't exist in go-fdo-server's copy of this file — the brew changes were merged around it rather than patched blindly.PACKIT_COPR_RPMS-driven Packit/Testing Farm runs and the default local/CI flows never setBREW_CLIENT_RPMS_URL/BREW_SERVER_RPMS_URL, so they're unaffected.COMPOSE_BASE_URL/COMPOSE_STREAMS) and thetest/bootcfirewalld D-Bus readiness workaround were dropped from this PR per review feedback — compose support is already covered by test: restructure directories, refactor rvto2addr, and add retry-loop tests #14, and the firewalld fix will land in its own PR.Origin
Ports fido-device-onboard/go-fdo-server#239 (brew-build support only; compose support intentionally excluded, see Notes).
Fixes
run_test()(test/ci/test-onboarding.sh) now installs go-fdo-client/go-fdo-server before generating service certificates.test/rpm/test-onboarding-defaults.sh's overriddengenerate_service_certs()calls the RPM's own/usr/libexec/go-fdo-server/generate-go-fdo-server-certs.sh, which doesn't exist until the package is installed — the old ordering broke that test unconditionally.Test plan
test/rpm/test-onboarding.shwithBREW_SERVER_RPMS_URL/BREW_CLIENT_RPMS_URLsettest/bootc/test-onboarding.shon RHEL 10 withDOWNLOAD_NODE/BREW_SERVER_RPMS_URL/BREW_CLIENT_RPMS_URLAssisted-by: Claude (claude-sonnet-5)