Skip to content

Commit e7ff6c9

Browse files
Johan-Liebert1cgwalters
authored andcommitted
composefs/tests: Add tests for filesystems
Add filesystems ext4 and xfs in github CI matrix so that we test systems with and without fs-verity enabled Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
1 parent edc933f commit e7ff6c9

4 files changed

Lines changed: 33 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ jobs:
162162
# No fedora-44 due to https://bugzilla.redhat.com/show_bug.cgi?id=2429501
163163
test_os: [fedora-43, centos-9, centos-10]
164164
variant: [ostree, composefs-sealeduki-sdboot, composefs-sdboot, composefs-grub]
165+
filesystem: ["ext4", "xfs"]
165166
exclude:
166167
# centos-9 UKI is experimental/broken (https://github.com/bootc-dev/bootc/issues/1812)
167168
- test_os: centos-9
@@ -172,6 +173,10 @@ jobs:
172173
variant: composefs-sdboot
173174
- test_os: centos-9
174175
variant: composefs-grub
176+
# We only test filesystems for composefs to test if composefs backend will work on fs
177+
# without fsverity
178+
- variant: ostree
179+
filesystem: ext4
175180

176181
runs-on: ubuntu-24.04
177182

@@ -190,6 +195,7 @@ jobs:
190195
echo "BOOTC_base=${BASE}" >> $GITHUB_ENV
191196
echo "RUST_BACKTRACE=full" >> $GITHUB_ENV
192197
echo "RUST_LOG=trace" >> $GITHUB_ENV
198+
echo "BOOTC_filesystem=${{ matrix.filesystem }}" >> $GITHUB_ENV
193199
194200
case "${{ matrix.variant }}" in
195201
composefs-grub)
@@ -213,8 +219,6 @@ jobs:
213219
;;
214220
esac
215221
216-
217-
218222
if [ "${{ matrix.variant }}" = "composefs-sealeduki-sdboot" ]; then
219223
BUILDROOTBASE=$(just pullspec-for-os buildroot-base ${{ matrix.test_os }})
220224
echo "BOOTC_buildroot_base=${BUILDROOTBASE}" >> $GITHUB_ENV
@@ -244,7 +248,7 @@ jobs:
244248
- name: Run TMT integration tests
245249
run: |
246250
if [[ "${{ matrix.variant }}" = composefs* ]]; then
247-
just "test-${{ matrix.variant }}"
251+
just "test-${{ matrix.variant }}" "${{ matrix.filesystem }}"
248252
else
249253
just test-tmt integration
250254
fi
@@ -255,7 +259,7 @@ jobs:
255259
if: always()
256260
uses: actions/upload-artifact@v6
257261
with:
258-
name: tmt-log-PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ matrix.variant }}-${{ env.ARCH }}
262+
name: tmt-log-PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ matrix.variant }}-${{ matrix.filesystem }}-${{ env.ARCH }}
259263
path: /var/tmp/tmt
260264

261265
# Test bootc install on Fedora CoreOS (separate job to avoid disk space issues

Justfile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ upgrade_img := base_img + "-upgrade"
2121
# Build variant: ostree (default) or composefs-sealeduki-sdboot (sealed UKI)
2222
variant := env("BOOTC_variant", "ostree")
2323
bootloader := env("BOOTC_bootloader", "grub")
24+
# Only used for composefs tests
25+
filesystem := env("BOOTC_filesystem", "ext4")
2426
# Base container image to build from
2527
base := env("BOOTC_base", "quay.io/centos-bootc/centos-bootc:stream10")
2628
# Buildroot base image
@@ -106,23 +108,26 @@ test-container: build build-units
106108

107109
# Build and test sealed composefs images
108110
[group('core')]
109-
test-composefs-sealeduki-sdboot:
110-
just variant=composefs-sealeduki-sdboot test-tmt readonly local-upgrade-reboot
111+
test-composefs-sealeduki-sdboot filesystem:
112+
just variant=composefs-sealeduki-sdboot filesystem={{filesystem}} test-tmt readonly local-upgrade-reboot
111113

112114
[group('core')]
113-
test-composefs bootloader:
114-
just variant=composefs bootloader={{bootloader}} \
115-
test-tmt --composefs-backend --bootloader {{bootloader}} integration
115+
test-composefs bootloader filesystem:
116+
just variant=composefs bootloader={{bootloader}} filesystem={{filesystem}} \
117+
test-tmt --composefs-backend \
118+
--bootloader {{bootloader}} \
119+
--filesystem {{filesystem}} \
120+
integration
116121

117122
# Build and test composefs images booted using Type1 boot entries and systemd-boot as the bootloader
118123
[group('core')]
119-
test-composefs-sdboot:
120-
just test-composefs systemd
124+
test-composefs-sdboot filesystem:
125+
just test-composefs systemd {{filesystem}}
121126

122127
# Build and test composefs images booted using Type1 boot entries and grub as the bootloader
123128
[group('core')]
124-
test-composefs-grub:
125-
just test-composefs grub
129+
test-composefs-grub filesystem:
130+
just test-composefs grub {{filesystem}}
126131

127132
# Run cargo fmt and clippy checks in container
128133
[group('core')]

crates/xtask/src/tmt.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,15 @@ pub(crate) fn run_tmt(sh: &Shell, args: &RunTmtArgs) -> Result<()> {
485485
}
486486

487487
if args.composefs_backend {
488-
// TODO(Johan-Liebert1): Filesystem should be a parameter and we should test
489-
// insecure with xfs
490-
opts.push("--filesystem=ext4".into());
488+
let filesystem = args.filesystem.as_deref().unwrap_or("ext4");
489+
opts.push(format!("--filesystem={}", filesystem));
491490
opts.push("--composefs-backend".into());
491+
492+
if filesystem == "xfs" {
493+
// As xfs doesn't support fsverity
494+
opts.push("--allow-missing-verity".into());
495+
}
496+
492497
opts.extend(COMPOSEFS_KERNEL_ARGS.map(|x| x.into()));
493498
}
494499

crates/xtask/src/xtask.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ pub(crate) struct RunTmtArgs {
127127

128128
#[arg(long, requires = "composefs_backend")]
129129
pub(crate) bootloader: Option<Bootloader>,
130+
131+
#[arg(long, requires = "composefs_backend")]
132+
pub(crate) filesystem: Option<String>,
130133
}
131134

132135
/// Arguments for tmt-provision command

0 commit comments

Comments
 (0)