Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
279 commits
Select commit Hold shift + click to select a range
4a4f4b3
test: unify vm.run() implementations
achilleas-k Jan 9, 2024
0e91b43
testutil: AWS utility functions
achilleas-k Jan 8, 2024
2d1a62d
test/image_type_fixture: add upload options when building AMI
achilleas-k Jan 8, 2024
a110f32
test: add image type and metadata to ImageBuildResult
achilleas-k Jan 8, 2024
f60848d
test: add test_ami_boots_in_aws()
achilleas-k Jan 8, 2024
50ca5e5
test: skip or fail if AWS creds not set
achilleas-k Jan 9, 2024
355a81a
test: enable force-aws-upload for testing farm tests
achilleas-k Jan 10, 2024
0172e00
bib: add "raw" iamge format
mvo5 Jan 10, 2024
1d75616
bib: implemnt `bootc-image-builder manifest`
mvo5 Jan 11, 2024
86a15a3
testutil: remove "match" for centos8/9 compatbility
mvo5 Jan 18, 2024
acfbb2f
test: use last known goodl quay.io/centos-bootc/fedora-bootc in tests
mvo5 Jan 23, 2024
633249e
test: add new `pytest.ini` and use `--basetemp=/var/tmp` by default
mvo5 Jan 22, 2024
db07910
test: add container installer test
mvo5 Jan 11, 2024
a33dc62
tests: add new OSBUILD_TEST_QEMU_GUI env to make debugging easier
mvo5 Jan 25, 2024
0cf3651
test: re-enable quay.io/centos-bootc/fedora-bootc:eln
mvo5 Jan 25, 2024
d0d543e
tests: increase podman machine limits on macOS
mvo5 Jan 25, 2024
de8e050
github: move to newer golangci-lint
mvo5 Feb 2, 2024
a9590e1
github: add li{btrfs,devmapper}-dev to lint deps
mvo5 Feb 2, 2024
9cf0363
test: run tests with both fedora and centos images
mvo5 Jan 22, 2024
d2dce4c
workflow: add diskspace diagnosis
mvo5 Feb 6, 2024
9c97bca
test: cleanup after each image_type_fixture() run
mvo5 Feb 6, 2024
b7f3f7a
test: share images between tests if possible
mvo5 Feb 7, 2024
a1ce60e
test: add cross-arch build/boot test
mvo5 Jan 29, 2024
9062c25
github: setup custom basetemp in GH runners
mvo5 Feb 8, 2024
8403ff2
build(deps): bump golangci/golangci-lint-action from 3 to 4
dependabot[bot] Feb 12, 2024
9fdc884
Rename `iso` -> `anaconda-iso`
cgwalters Jan 31, 2024
6b0117c
test: disable anaconda-iso test because of issue#233
mvo5 Mar 5, 2024
7d85db9
bib: show progress on ami upload
mvo5 Jan 17, 2024
2990ea4
github: split test setup and the actual run
ondrejbudai Mar 7, 2024
47abbb6
test: use multi-image builds
achilleas-k Mar 7, 2024
d293588
test: clarify test_manifest_smoke parameters
mvo5 Mar 8, 2024
f668e9f
test: tweak docstrings/variable names
mvo5 Mar 8, 2024
35e6cd8
test: remove AMI test cases from "direct-boot"
mvo5 Mar 8, 2024
a8ee2e3
test: stop caching ami artifacts for now
mvo5 Mar 9, 2024
5ecb642
test: change build_images() to not assert because order is random
mvo5 Mar 9, 2024
9163c2f
workflow: cancel in-progress tests on PR updates (HMS-3697)
mvo5 Mar 11, 2024
3f620ca
workflow: make `pytest` less verbose
mvo5 Mar 6, 2024
c80fb3c
test: add integration tests for new --chown feature
mvo5 Mar 7, 2024
2ca953e
test/test_build: extract request params
kingsleyzissou Mar 11, 2024
62c190f
test/test_build: add local flag
kingsleyzissou Mar 11, 2024
e0ca48f
test/test_build: test local container builds
kingsleyzissou Mar 11, 2024
0bf08a3
github: don't run any workflows on push
ondrejbudai Mar 13, 2024
2ab4ed1
test: add test that ensures "vmdk" images are build
mvo5 Mar 8, 2024
d8d20b5
Revert "test: change build_images() to not assert because order is ra…
mvo5 Mar 11, 2024
b9ab78b
test: add CLOUD_BOOT_IMAGE_TYPES for images that boot in a cloud
mvo5 Mar 11, 2024
0adaeb4
test: build all disk image types in a single build
mvo5 Mar 14, 2024
1846725
main: switch to using containers-storage even without --local
ondrejbudai Mar 14, 2024
1935329
test: check the bib's return code in test_build
ondrejbudai Mar 14, 2024
bb4fb79
workflow: move to podman 4 in the tests
mvo5 Mar 20, 2024
3ca790f
bib: move to cheggaaa/pb/v3
mvo5 Mar 7, 2024
a77c635
test: add new make_container() helper
mvo5 Mar 20, 2024
c508349
test: add test that ensure disk space is doubled
mvo5 Mar 20, 2024
6a58d07
bib: check /var/lib/containers/storage when using "--local"
mvo5 Mar 20, 2024
29a07e0
github: disable tests on macos
ondrejbudai Mar 22, 2024
c6d5d5c
document that `customizations.kernel.append` exists
cgwalters Apr 12, 2024
006a8b8
test: map /var/lib/containers/storage when running bib
mvo5 Mar 21, 2024
15605b6
test: test that kernel commandline args are passed correctly
mvo5 Apr 15, 2024
7b6164e
Automatically pick up `/config.json` if it exists
cgwalters Apr 12, 2024
b98e215
test: check that `bootc status` contains the right container_ref
mvo5 Apr 16, 2024
68b8631
github: use go 1.20 for the lint job
achilleas-k Apr 17, 2024
3ff296d
github: run unittests as part of the CI
mvo5 Apr 18, 2024
f8f5812
main: decorate more errors with context and avoid panics
mvo5 Apr 17, 2024
759a639
bib: ignore --target-arch if it is the same as the running arch
mvo5 Apr 18, 2024
578eee2
github: put `/var/lib/containers` on `/mnt` via bind mount
mvo5 Apr 22, 2024
a82314c
workflow,tests: use `/var/tmp/osbuild-test-store` and cache that
mvo5 Apr 22, 2024
cf07dda
test: enable iso installer tests for both centos/fedora
mvo5 Apr 18, 2024
7834602
test: Make sure that the osbuild store exists
ondrejbudai Apr 23, 2024
079a7f3
Fix passing the --tls-verify flag to podman pull
ondrejbudai Apr 23, 2024
52ea42e
test: add `arch` argument to `make_container()` test helper
mvo5 Apr 18, 2024
784e7d8
bib: check that architecture is expected arch
mvo5 Apr 12, 2024
7e8f91b
test: add test (somewhat) for rootfs configuration from bootc
mvo5 Apr 23, 2024
09b291d
test: add integration test that checks that config.toml is loaded
mvo5 Apr 26, 2024
ea66c37
test: tweak itest for cross-arch manifest handline
kingsleyzissou Apr 26, 2024
4dc0c00
build(deps): bump golangci/golangci-lint-action from 4 to 5
dependabot[bot] Apr 29, 2024
47d7b76
test: add smoke test that checks that `--log-level` is honored
mvo5 Apr 25, 2024
831d807
test: use system container storage when running test_opts as root
mvo5 Apr 25, 2024
612e691
buildconfig: make buildconfig blueprint compatible and support legacy
mvo5 Apr 26, 2024
53f01b7
bib: add --roofs to be able to select the root fs type
ondrejbudai Apr 30, 2024
c29cd72
test: minor fix to image_type fixture
kingsleyzissou Mar 22, 2024
8ea1d7c
test: switch kargs to systemd.journald.forward_to_console=1
mvo5 Apr 18, 2024
2e5f382
test: update tests to allow ssh keys
mvo5 Mar 22, 2024
7d25a14
build(deps): bump golangci/golangci-lint-action from 5 to 6
dependabot[bot] May 13, 2024
341db87
workflow: run tests on "push" to "main" to populate cache
mvo5 May 8, 2024
fd43c77
README,bib: hide `--config` from users, remove from docs
mvo5 May 27, 2024
b28ea74
test: Check the qcow2 image filesystem changes
bcl Jan 16, 2024
2a0509b
test: Add a test for mountpoint policy violations
bcl Jan 24, 2024
86f2fbd
test: small pytest related tweaks
mvo5 May 28, 2024
99b7b01
image: only allow tweaks to /, /boot for now
mvo5 May 28, 2024
2caacdd
test: switch from Fedora ELN to Fedora 40
ondrejbudai Jun 21, 2024
f31819a
main: set `SilenceErrors` to avoid double error printing
mvo5 Jun 24, 2024
590f17b
bib: add (hidden) `bootc-image-builder version` command
mvo5 Jul 1, 2024
d54a4c5
test: add manifest smoke test for ISO
achilleas-k Jun 25, 2024
95cb337
test: add user kickstart content customization test
achilleas-k Jun 25, 2024
97284f6
github: update Go version used in workflows
achilleas-k Jul 4, 2024
c775a4f
test: unify how `--entrypoint=` is used
mvo5 Jul 1, 2024
2873c44
test/test_manifest: fix import order
achilleas-k Jun 19, 2024
1556c44
test: add new integration test for ValidateHasContainerTags()
mvo5 Jun 18, 2024
d06af09
bib: add btrfs support
ondrejbudai May 10, 2024
bb8332b
test: test btrfs as part of the fedora boot test
mvo5 Jul 4, 2024
979f774
test: rework how test cases are represented/generated
mvo5 Jul 4, 2024
92bb59a
test: switch to btrfs for fedora tests
mvo5 Jul 8, 2024
21d2b1c
main: allow running outside of a container
mvo5 Jul 4, 2024
2ef3c02
README: update to show that `config.{toml,yaml}` can be read-only
mvo5 Jul 10, 2024
7a78651
test: add new `test_manifest_target_arch_smoke` test
mvo5 Jul 29, 2024
596829c
test: introduce new `TestCase{Centos,Fedora}` classes
mvo5 Jul 5, 2024
bc6f4d9
test: drop rootfs arg from iso manifest smoke test
achilleas-k Aug 1, 2024
e3b04de
test: add pylint on our test
mvo5 Jul 4, 2024
d14cdf4
test: extract `testutil.podman_run_common`
mvo5 Jul 29, 2024
d5cafb1
test: fix test for `bootc-image-builder --version` when in non-git
mvo5 Aug 5, 2024
4aa93da
test: test for customizations.modules.{enable,disable}
mvo5 Aug 13, 2024
2ece8ac
test: add rootfs argument to ImageBuildResult
achilleas-k Aug 9, 2024
c1fc40b
test: add custom mountpoints for non-btrfs tests
achilleas-k Aug 8, 2024
234474b
test: verify filesystem sizes when boot testing
achilleas-k Aug 9, 2024
58e4cf6
bib: propagate error messages from policy.Check()
achilleas-k Aug 12, 2024
c90c047
test: manifest test for filesystem customizations
achilleas-k Aug 13, 2024
b7b9e3c
test: manifest test for filesystem customizations (cross-arch)
achilleas-k Aug 13, 2024
32fe65a
test: drop size comparison in assert_fs_customizations
achilleas-k Aug 15, 2024
99c728e
bib: make build the default subcommand
ondrejbudai Aug 14, 2024
7367b90
bib: update to images v0.78 and update for API changes
mvo5 Aug 19, 2024
4d4fa79
test: disable arm64 test until #691 is fixed
mvo5 Aug 28, 2024
472d525
bib: add `vhd` to supported image types
mvo5 Sep 5, 2024
06aff9e
test: add (failing) regression test for issue#655
mvo5 Sep 24, 2024
1431442
buildconfig: disable tests for undecoded keys for now
mvo5 Sep 24, 2024
78129be
test: move `target-arch-smoke` testcases to Fedora42 (for dnf5)
mvo5 Sep 25, 2024
d611f8c
bib: add a new `gce` image type
mvo5 Sep 12, 2024
fd68746
test: add a test to verify libosinfo detection
mmartinv Oct 9, 2024
bc3ac91
test: GCE output ends with .tar.gz
pastequo Oct 17, 2024
ce33c1c
test: add anaconda-iso build tests with signed containers
mmartinv Oct 22, 2024
bec5912
test: fix the testcase strings to not include `osinfo_template`
mvo5 Oct 17, 2024
bcfac5f
tests: drop (unsigned) fedora ISO testcase
mvo5 Nov 12, 2024
40c731e
workflow: move workflow to run on ubuntu-24.04
mvo5 Nov 11, 2024
9bfd3f6
test: add test that ensures fips customizations work
mvo5 Nov 12, 2024
070799c
bib: extract new partition table helpers and add new DiskCustomization
mvo5 Nov 21, 2024
60fc846
test: add disk-customization test
mvo5 Nov 21, 2024
89e3d26
test: add integration test for the new `swap` customization
mvo5 Dec 5, 2024
53d93c1
test: add regression test for gh748 swap space creation
mvo5 Dec 6, 2024
4438e89
test: run tests with centos-bootc:stream10 as well
achilleas-k Oct 28, 2024
dc12c74
test: tweak TestCaseC10S testcase and osinfo_for helper
mvo5 Nov 28, 2024
f6a818f
main,osbuildprogress: add `--progress=term,plain,debug` support
mvo5 Dec 5, 2024
2b397bd
progress: implement pb.Pool without raw terminal access
mvo5 Dec 11, 2024
43c7ae1
progress: auto-select progress based on if we run on a terminal
mvo5 Dec 12, 2024
b75f64b
test: disable the fedora iso test for now
mvo5 Dec 19, 2024
ec11df8
bootc-image-builder/main: extend version command
schuellerf Dec 17, 2024
d51b4b8
bib: remove usage of `BootcLegacyDiskImage` (for qemu-9.1)
mvo5 Oct 23, 2024
64bdf73
workflow: use qemu-user-static with openat2 patches
mvo5 Nov 8, 2024
e07f449
bib: use plain squashfs for the ISO rootfs
mvo5 Jan 6, 2025
4213b23
main,test: tweak cmdVersion
mvo5 Jan 9, 2025
7684beb
main: add --verbose,-v persistent flag that increases verbosity
mvo5 Jan 9, 2025
921176f
test: enable librepo as part of the test cases
mvo5 Jan 8, 2025
67f8c6d
bib: deprecate the `--local` flag
kingsleyzissou May 3, 2024
baeb2ee
tests: pull containers into local storage
kingsleyzissou May 7, 2024
b3bc1ad
bib: disable `--tls-verify` flag
kingsleyzissou Sep 3, 2024
4582bac
tests: update all tests to pull the container
ondrejbudai Dec 17, 2024
ccb7ba5
test: use `librepo` for `centos-9` too
mvo5 Feb 5, 2025
d2f31ad
github/workflows/tests: fix linter by adapting versions
schuellerf Feb 10, 2025
dc6ce01
test: add integration test for reporting errors from osbuild
mvo5 Feb 5, 2025
3e5de37
testutil: ensure podman runs with 8g mem max
mvo5 Feb 7, 2025
970c671
test: run the centos-9 test with an attached terminal
mvo5 Feb 7, 2025
c30a839
bib: add support for file/directory customizations
mvo5 Feb 17, 2025
1a551bb
test: add full integration test for bp files/dirs
mvo5 Feb 18, 2025
bad7f19
test: import build_container_fixture as _
achilleas-k Mar 27, 2025
4abba2d
test: update tests to look for mount units and not fstab
achilleas-k Mar 26, 2025
ce8a798
build(deps): bump golangci/golangci-lint-action from 6 to 7
dependabot[bot] Apr 7, 2025
95eee26
github: bump ubuntu runners to 24.04
achilleas-k Apr 8, 2025
84e59a8
test: convert test_manifest_disk_customization_lvm to TOML
mvo5 Apr 8, 2025
d843be3
test: enable `osinfo_for()` centos10
mvo5 Apr 28, 2025
3ab1c1f
test: split test_build.py into test_build_{disk,iso}
mvo5 Apr 29, 2025
60efb3d
workflow: run pytests via matrix to get more parallel runs
mvo5 Apr 29, 2025
030de4a
test: fix missing testutil.pull_container() in test_progress.py
mvo5 Apr 29, 2025
b5b2434
github: bump golangci-lint version
schuellerf Apr 9, 2025
1518d49
Makefile,github: implement `make lint` and centralize GOLANGCI_LINT_V…
schuellerf Apr 10, 2025
d5fd4ad
test: update test_mount_ostree_error
mvo5 Apr 30, 2025
6f71b50
build(deps): bump golangci/golangci-lint-action from 7 to 8
dependabot[bot] May 5, 2025
e88b212
test: split cross-arch test into its own file
mvo5 Apr 30, 2025
fcb3721
test: update testcases for fedora42/fedora43
mvo5 May 6, 2025
48cc7a4
main: drop rootfs cross-arch disable
supakeen May 7, 2025
dbf4954
test: set the cache-ttl to 1h in our tests
mvo5 May 7, 2025
0aae452
test: disable `fedora-43` bootc test for now
mvo5 May 21, 2025
96c4f4d
test_manifest: Add test for embedded disk and filesystem customization
alexlarsson May 20, 2025
9d4b48d
tests: Avoid running into docker.io rate limits
alexlarsson May 21, 2025
e789437
Clarify we build disk images
cgwalters May 27, 2025
8723cda
test: re-enable Fedora43 test
mvo5 Jun 3, 2025
4ce65af
test: disable anaconda-iso C10S test for now
mvo5 Jun 23, 2025
91cce1a
test: Add test of --build-container
alexlarsson May 26, 2025
6f0e6d7
Revert "test: disable anaconda-iso C10S test for now"
mvo5 Jun 24, 2025
3619c0e
test: use randomized password for test VMs
mvo5 Jun 7, 2025
6b0dd6c
test: skip the test_image_build_without_se_linux_denials
mvo5 Jul 4, 2025
c38f2d7
test: enable `OSBUILD_EXPERIMENTAL=debug-qemu-user`
mvo5 Jul 4, 2025
315d868
test: add manifest test for partition table type
achilleas-k Aug 1, 2025
8e51c17
test: disable centos9 iso test for now because kernel panic
mvo5 Aug 21, 2025
6416d8f
build(deps): bump actions/checkout from 4 to 5
dependabot[bot] Aug 25, 2025
df12e55
test: re-enable the fedora 42 iso test
mvo5 Aug 25, 2025
cc33616
test: update test_iso_manifest_smoke to include rootfs
mvo5 Aug 25, 2025
a57e1b1
Add test for aboot support
alexlarsson Aug 27, 2025
45628da
test: update architecutre mismatch error string
mvo5 Aug 7, 2025
e8f0b8b
test: update test for new `/usr/lib/bootc-image-builder/disk.yaml`
mvo5 Sep 5, 2025
39043ab
test: remove roots home customizations for ISOs
mvo5 Sep 5, 2025
d3b8968
test: disable cross arch test for now
mvo5 Sep 19, 2025
f373d53
test: run df with --all
mvo5 Sep 16, 2025
257775a
test: tweak error message for new images error
mvo5 Sep 16, 2025
f28eb3b
Revert "test: disable centos9 iso test for now because kernel panic"
mvo5 Aug 21, 2025
3bea4d3
test: update invalid cross arch test error msg
mvo5 Sep 26, 2025
96f3648
bib: expose new `ova` image type in bib
mvo5 Oct 7, 2025
02ffe61
bib: add support for `--type bootc-installer`
mvo5 Oct 29, 2025
ef2cb60
test: fix missing wait() when killing qemu
mvo5 Sep 25, 2025
8892a43
test: add bootc-installer image type test
mvo5 Sep 25, 2025
5ade5e0
test: refactor so that all vm related tests can be reused
mvo5 Nov 5, 2025
285f411
build(deps): bump golangci/golangci-lint-action from 8 to 9
dependabot[bot] Nov 10, 2025
981f549
pyproject: add missing depedencies
mvo5 Nov 8, 2025
e54d3f9
build(deps): bump actions/setup-python from 5 to 6
dependabot[bot] Sep 8, 2025
5900624
main: show validation warnings by default
mvo5 Nov 13, 2025
bbeb537
vm: drop paramiko
mvo5 Nov 18, 2025
e83b619
build(deps): bump actions/checkout from 5 to 6
dependabot[bot] Nov 24, 2025
6218aa6
test: use vmtest from images
mvo5 Nov 21, 2025
abe7b06
test: port to improve vmtest.vm.run() code
mvo5 Nov 24, 2025
fba04ac
workflow: adjust bib tests workflow
mvo5 Dec 8, 2025
61b7554
Initialize repository
ondrejbudai Nov 10, 2023
551f270
Make the container working on an SELinux-enforcing systems
ondrejbudai Nov 23, 2023
e405001
Containerfile: Install osbuild from COPR to pull a fix for the loop bug
ondrejbudai Nov 26, 2023
488ec97
Containerfile: copy binary from new location
achilleas-k Nov 24, 2023
9277149
Containerfile: build executable from source in repo
achilleas-k Nov 27, 2023
dbf9f5a
Containerfile: install osbuild-depsolve-dnf for dnf-json
achilleas-k Nov 27, 2023
adb3799
rename osbuild-deploy-container to bootc-image-builder
ondrejbudai Dec 4, 2023
4d5efaf
rename odc to bib
ondrejbudai Dec 4, 2023
b7395da
Containerfile: Enable basic caching of go deps
ondrejbudai Dec 15, 2023
1876524
Move `prepare.sh` into Go code
cgwalters Jan 5, 2024
e44d969
bib: use container based buildroot when building bootc disk images
mvo5 Jan 3, 2024
1b617e6
Add selinux-policy-targeted and distribution-gpg-keys
cgwalters Feb 6, 2024
31f9147
Drain logic from entrypoint into Go code
cgwalters Feb 9, 2024
d613e1c
build: remove build flags
kingsleyzissou Feb 28, 2024
850ebe9
build: fast-track newer rpm-ostree
cgwalters Mar 15, 2024
b17bb0d
bib: make /var/lib/containers/storage a volume
ondrejbudai Mar 19, 2024
6e1f7fc
Add additional metadata labels as required downstream
jeckersb Mar 22, 2024
6e602a4
Containerfile: Use GOPROXY to avoid CI problems HMS-3099
schuellerf Apr 2, 2024
19f3178
Containerfile: remove outdated rpm-ostree upgrade
ondrejbudai Apr 15, 2024
c68801d
bib: factor out the ISO packages into YAML definitions
ondrejbudai Apr 17, 2024
624ae8f
bib: detect missing qemu-user early
mvo5 Apr 8, 2024
da3d8d6
many: update to Fedora 40
ondrejbudai May 2, 2024
a54d8ff
Fix the linting error
mkumatag May 25, 2024
f27c1e8
build: include git revision in main "bootc-image-binary"
mvo5 Jul 1, 2024
ee7d2bd
Containerfile: copy the entire "." dir into /build
mvo5 Aug 5, 2024
3bf9bc9
bib: make build the default subcommand
ondrejbudai Aug 14, 2024
6e81388
build-sys: Bump to Fedora 41
cgwalters Jan 6, 2025
6438c41
container: fedora 42
supakeen May 7, 2025
a2fe942
Containerfile: fix io.openshift.tags
mvo5 Jul 4, 2025
5b9bb11
test: build bib tests using bib container
mvo5 Dec 8, 2025
fa962bd
bib: detect missing qemu-user early
mvo5 Dec 9, 2025
01872de
Containerfile.bib: adjust for the ibcli environment
mvo5 Dec 9, 2025
ada5694
workflow: adjust bibtest.yml to ibcli env
mvo5 Dec 12, 2025
d28c775
workflow: use jlumbroso/free-disk-space action
mvo5 Dec 12, 2025
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
118 changes: 118 additions & 0 deletions .github/workflows/bibtests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
name: Bib tests

on:

Check warning on line 4 in .github/workflows/bibtests.yaml

View workflow job for this annotation

GitHub Actions / Lint

4:1 [truthy] truthy value should be one of [false, true]
pull_request:
branches:
- "*"
push:
branches:
- "main"
# for merge queue
merge_group:

env:
GO_VERSION: 1.23

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
collect_tests:
runs-on: ubuntu-latest
outputs:
test_files: ${{ steps.collect.outputs.test_files }}
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Collect test files
id: collect
run: |
TEST_FILES=$(ls test/bib/test_*.py | sort)
JSON_FILES=$(echo "${TEST_FILES}" | jq -R | jq -cs )
echo "test_files=${JSON_FILES}" >> $GITHUB_OUTPUT

integration:
name: "Integration"
runs-on: ubuntu-24.04
needs: collect_tests
strategy:
matrix:
test_file: ${{ fromJson(needs.collect_tests.outputs.test_files) }}
steps:
- uses: actions/checkout@v6

Check failure on line 46 in .github/workflows/bibtests.yaml

View workflow job for this annotation

GitHub Actions / Lint

46:5 [indentation] wrong indentation: expected 6 but found 4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup up python
uses: actions/setup-python@v6
- name: Apt update
run: sudo apt update
- name: Install test dependencies
run: |
sudo apt update
sudo apt install -y python3-pytest python3-boto3 flake8 pylint libosinfo-bin squashfs-tools sshpass
- name: Diskspace (before)
run: |
df -h
sudo du -sh * /var/tmp /tmp /var/lib/containers | sort -sh
- name: Free Disk Space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
tool-cache: true
# The following line runs apt remove which is slow
large-packages: false
- name: Workaround podman issues in GH actions
run: |
# see https://github.com/osbuild/bootc-image-builder/issues/446
sudo rm -rf /var/lib/containers/storage
sudo mkdir -p /etc/containers
echo -e "[storage]\ndriver = \"overlay\"\nrunroot = \"/run/containers/storage\"\ngraphroot = \"/var/lib/containers/storage\"" | sudo tee /etc/containers/storage.conf
- name: Updating qemu-user
run: |
# get qemu-9 with openat2 patches via qemu-user-static, that
# has no dependencies so just install.
# XXX: remove once ubuntu ships qemu-9.1
sudo apt install -y software-properties-common
sudo apt-add-repository -y ppa:mvo/qemu
sudo apt install --no-install-recommends -y qemu-user-static
# Now remove ppa again, the metadata confuses apt. Then install
# qemu-system-* from the regular repo again.
sudo apt-add-repository --remove -y ppa:mvo/qemu
sudo apt install -y qemu-system-arm qemu-system-x86 qemu-efi-aarch64
- name: Install python test deps
run: |
# make sure test deps are available for root
sudo -E pip install --user -r test/bib/requirements.txt
- name: Workarounds for GH runner diskspace
run: |
# use custom basetemp here because /var/tmp is on a smaller disk
# than /mnt
sudo mkdir -p /mnt/var/tmp/bib-tests
# on GH runners /mnt has 70G free space, use that for our container
# storage
sudo mkdir -p /mnt/var/lib/containers
sudo mount -o bind /mnt/var/lib/containers /var/lib/containers
- run: |
mkdir -p /var/tmp/osbuild-test-store
- name: Cache osbuild env
uses: actions/cache@v4
with:
path: /var/tmp/osbuild-test-store
key: no-key-needed-here
- name: Run tests
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
# podman needs (parts of) the environment but will break when
# XDG_RUNTIME_DIR is set.
# TODO: figure out what exactly podman needs
sudo -E XDG_RUNTIME_DIR= PYTHONPATH=. pytest-3 -v --basetemp=/mnt/var/tmp/bib-tests ${{ matrix.test_file }}
- name: Diskspace (after)
if: ${{ always() }}
run: |
df -h
sudo du -sh * /var/tmp /tmp /var/lib/containers | sort -sh
46 changes: 46 additions & 0 deletions Containerfile.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM registry.fedoraproject.org/fedora:43 AS builder
RUN dnf install -y git-core golang gpgme-devel libassuan-devel libvirt-devel && mkdir -p /build/bib
COPY go.mod go.sum /build/bib/
ARG GOPROXY=https://proxy.golang.org,direct
RUN go env -w GOPROXY=$GOPROXY
RUN cd /build/bib && go mod download
# Copy the entire dir to avoid having to conditionally include ".git" as that
# will not be available when tests are run under tmt
COPY . /build
WORKDIR /build
# keep in sync with:
# https://github.com/containers/podman/blob/2981262215f563461d449b9841741339f4d9a894/Makefile#L51
# disable cgo as
# a) gcc crashes on fedora41/arm64 regularly
# b) we don't really need it
RUN --mount=type=cache,target=/root/.cache/go-build \
go build -tags "containers_image_openpgp exclude_graphdriver_btrfs exclude_graphdriver_devicemapper" ./cmd/image-builder
RUN --mount=type=cache,target=/root/.cache/go-build \
for arch in amd64 arm64; do \
[ "$arch" = "$(go env GOARCH)" ] && continue; \
GOARCH="$arch" go build -ldflags="-s -w" -o ../bin/bib-canary-"$arch" ./cmd/cross-arch/; \
done


FROM registry.fedoraproject.org/fedora:43
# Fast-track osbuild so we don't depend on the "slow" Fedora release process to implement new features in bib
RUN dnf install -y dnf-plugins-core \
&& dnf copr enable -y @osbuild/osbuild \
&& dnf install -y libxcrypt-compat wget osbuild osbuild-ostree osbuild-depsolve-dnf osbuild-lvm2 openssl subscription-manager libvirt-libs \
&& dnf clean all

# copy as bootc-image-builder
COPY --from=builder /build/image-builder /usr/bin/bootc-image-builder

ENTRYPOINT ["/usr/bin/bootc-image-builder"]
VOLUME /output
WORKDIR /output
VOLUME /store
VOLUME /rpmmd
VOLUME /var/lib/containers/storage

LABEL description="This tools allows to build and deploy disk-images from bootc container inputs."
LABEL io.k8s.description="This tools allows to build and deploy disk-images from bootc container inputs."
LABEL io.k8s.display-name="Bootc Image Builder"
LABEL io.openshift.tags="base fedora42"
LABEL summary="A container to create disk-images from bootc container inputs"
5 changes: 5 additions & 0 deletions cmd/cross-arch/canary.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package main

func main() {
println("ok")
}
21 changes: 21 additions & 0 deletions test/bib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Integration tests for bootc-image-builder
----------------------------------------------

This directory contains integration tests for bootc-image-builder.

They can be run in two ways
1. On the local machine:
By just running `sudo pytest -s -v` in the _top level folder_ of the project (where `Containerfile` is)
If you have set up `pip` only for your user, you might just want to run the test with elevated privileges
`sudo -E $(which pytest) -s -v`
2. Via `tmt` [0] which will spin up a clean VM and run the tests inside:

tmt run -vvv

[0] https://github.com/teemtee/tmt

To install `tmt` on fedora at least those packages are needed:

```shell
sudo dnf install tmt tmt+provision-virtual
```
29 changes: 29 additions & 0 deletions test/bib/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import pytest

# pylint: disable=wrong-import-order
from testcases import TestCase
from vmtest.util import get_free_port


def pytest_addoption(parser):
parser.addoption("--force-aws-upload", action="store_true", default=False,
help=("Force AWS upload when building AMI, failing if credentials are not set. "
"If not set, the upload will be performed only when credentials are available."))


@pytest.fixture(name="force_aws_upload", scope="session")
def force_aws_upload_fixture(request):
return request.config.getoption("--force-aws-upload")


# see https://hackebrot.github.io/pytest-tricks/param_id_func/ and
# https://docs.pytest.org/en/7.1.x/reference/reference.html#pytest.hookspec.pytest_make_parametrize_id
def pytest_make_parametrize_id(config, val): # pylint: disable=W0613
if isinstance(val, TestCase):
return f"{val}"
return None


@pytest.fixture(name="free_port")
def free_port_fixture():
return get_free_port()
148 changes: 148 additions & 0 deletions test/bib/containerbuild.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
import os
import platform
import random
import string
import subprocess
import textwrap
from contextlib import contextmanager

import pytest


@contextmanager
def make_container(container_path, arch=None):
# BIB only supports container tags, not hashes
container_tag = "bib-test-" + "".join(random.choices(string.digits, k=12))

if not arch:
# Always provide an architecture here because without that the default
# behavior is to pull whatever arch was pulled for this image ref
# last but we want "native" if nothing else is specified.
#
# Note: podman seems to translate kernel arch to go arches
# automatically it seems.
arch = platform.uname().machine

subprocess.check_call([
"podman", "build",
"--cache-ttl=1h",
"-t", container_tag,
"--arch", arch,
container_path], encoding="utf8")
yield container_tag
subprocess.check_call(["podman", "rmi", container_tag])


@pytest.fixture(name="build_container", scope="session")
def build_container_fixture():
"""Build a container from the Containerfile and returns the name"""
if tag_from_env := os.getenv("BIB_TEST_BUILD_CONTAINER_TAG"):
return tag_from_env

container_tag = "bootc-image-builder-test"
subprocess.check_call([
"podman", "build",
"--cache-ttl=1h",
"-f", "Containerfile.bib",
"-t", container_tag,
])
return container_tag


@pytest.fixture(name="build_fake_container", scope="session")
def build_fake_container_fixture(tmpdir_factory, build_container):
"""Build a container with a fake osbuild and returns the name"""
tmp_path = tmpdir_factory.mktemp("build-fake-container")

# see https://github.com/osbuild/osbuild/blob/main/osbuild/testutil/__init__.py#L91
tracing_podman_path = tmp_path / "tracing-podman"
tracing_podman_path.write_text(textwrap.dedent("""\
#!/bin/sh -e

TRACE_PATH=/output/"$(basename $0)".log
for arg in "$@"; do
echo "$arg" >> "$TRACE_PATH"
done
# extra separator to differenciate between calls
echo >> "$TRACE_PATH"
exec "$0".real "$@"
"""), encoding="utf8")

fake_osbuild_path = tmp_path / "fake-osbuild"
fake_osbuild_path.write_text(textwrap.dedent("""\
#!/bin/bash -e

# injest generated manifest from the images library, if we do not
# do this images may fail with "broken" pipe errors
cat - >/dev/null

mkdir -p /output/qcow2
echo "fake-disk.qcow2" > /output/qcow2/disk.qcow2

"""), encoding="utf8")

cntf_path = tmp_path / "Containerfile"

cntf_path.write_text(textwrap.dedent(f"""\n
FROM {build_container}
COPY fake-osbuild /usr/bin/osbuild
RUN chmod 755 /usr/bin/osbuild
COPY --from={build_container} /usr/bin/podman /usr/bin/podman.real
COPY tracing-podman /usr/bin/podman
RUN chmod 755 /usr/bin/podman
"""), encoding="utf8")

container_tag = "bootc-image-builder-test-faked-osbuild"
subprocess.check_call([
"podman", "build",
"-t", container_tag,
tmp_path,
])
return container_tag


@pytest.fixture(name="build_erroring_container", scope="session")
def build_erroring_container_fixture(tmpdir_factory, build_container):
"""Build a container with a erroring osbuild and returns the name"""
tmp_path = tmpdir_factory.mktemp("build-fake-container")

# this ensures there are messages from osbuild itself that
# we can reliably test for
wrapping_osbuild_path = tmp_path / "wrapping-osbuild"
wrapping_osbuild_path.write_text(textwrap.dedent("""\
#!/bin/sh -e
echo "output-from-osbuild-stdout"
>&2 echo "output-from-osbuild-stderr"

exec /usr/bin/osbuild.real "$@"
"""), encoding="utf8")

# this ensures we have a failing stage and failure messages
bad_stage_path = tmp_path / "bad-stage"
bad_stage_path.write_text(textwrap.dedent("""\
#!/bin/sh -e
echo osbuild-stage-stdout-output
>&2 echo osbuild-stage-stderr-output
exit 112
"""), encoding="utf8")

cntf_path = tmp_path / "Containerfile"
cntf_path.write_text(textwrap.dedent(f"""\n
FROM {build_container}
# ensure there is osbuild output
COPY --from={build_container} /usr/bin/osbuild /usr/bin/osbuild.real
COPY wrapping-osbuild /usr/bin/osbuild
RUN chmod 755 /usr/bin/osbuild

# we break org.osbuild.selinux as runs early and is used everywhere
COPY bad-stage /usr/lib/osbuild/stages/org.osbuild.selinux
RUN chmod +x /usr/lib/osbuild/stages/org.osbuild.selinux
"""), encoding="utf8")

container_tag = "bootc-image-builder-test--osbuild"
subprocess.check_call([
"podman", "build",
"-t", container_tag,
tmp_path,
])
return container_tag
6 changes: 6 additions & 0 deletions test/bib/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pytest==7.4.3
flake8==6.1.0
boto3==1.33.13
qmp==1.1.0
pylint==3.2.5
vmtest @ git+https://github.com/osbuild/images.git
Loading
Loading