mirror of
https://github.com/containers/bootc.git
synced 2026-02-05 15:45:53 +01:00
Run inside FCOS with kola test
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
/target
|
||||
Cargo.lock
|
||||
fastbuild*.qcow2
|
||||
_kola_temp
|
||||
|
||||
2
Makefile
2
Makefile
@@ -22,4 +22,4 @@ install-units: $(units)
|
||||
|
||||
.PHONY: install
|
||||
install: install-units
|
||||
install -D -t ${DESTDIR}$(PREFIX)/bin target/${PROFILE}/bootupd
|
||||
install -D -t ${DESTDIR}$(PREFIX)/libexec target/${PROFILE}/bootupd
|
||||
|
||||
16
README-devel.md
Normal file
16
README-devel.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Developing bootupd
|
||||
|
||||
Currently the focus is Fedora CoreOS.
|
||||
|
||||
You can use the normal Rust tools to build and run the unit tests:
|
||||
|
||||
`cargo build` and `cargo test`
|
||||
|
||||
For real e2e testing, use e.g.
|
||||
```
|
||||
export COSA_DIR=/path/to/fcos
|
||||
cosa build-fast
|
||||
kola run -E (pwd) --qemu-image fastbuild-fedora-coreos-bootupd-qemu.qcow2 --qemu-firmware uefi ext.bootupd
|
||||
```
|
||||
|
||||
See also [the coreos-assembler docs](https://github.com/coreos/coreos-assembler/blob/master/README-devel.md#using-overrides).
|
||||
1
tests/kola/data
Symbolic link
1
tests/kola/data
Symbolic link
@@ -0,0 +1 @@
|
||||
..
|
||||
33
tests/kola/test-bootupd
Executable file
33
tests/kola/test-bootupd
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
set -xeuo pipefail
|
||||
|
||||
. ${KOLA_EXT_DATA}/libtest.sh
|
||||
|
||||
tmpdir=$(mktemp -d)
|
||||
cd ${tmpdir}
|
||||
echo "using tmpdir: ${tmpdir}"
|
||||
touch .testtmp
|
||||
trap cleanup EXIT
|
||||
function cleanup () {
|
||||
if test -z "${TEST_SKIP_CLEANUP:-}"; then
|
||||
if test -f "${tmpdir}"/.testtmp; then
|
||||
cd /
|
||||
rm "${tmpdir}" -rf
|
||||
fi
|
||||
else
|
||||
echo "Skipping cleanup of ${tmpdir}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Shouldn't be started by default right now; distributions
|
||||
# should only enable when it was used at build time.
|
||||
runv systemctl show bootupd > out.txt
|
||||
assert_file_has_content_literal out.txt 'ActiveState=inactive'
|
||||
|
||||
runv /usr/libexec/bootupd status --component=EFI > out.txt
|
||||
assert_file_has_content_literal out.txt 'Component EFI'
|
||||
assert_file_has_content_literal out.txt ' Unmanaged: digest='
|
||||
assert_not_file_has_content_literal out.txt 'Update: Available:'
|
||||
|
||||
ok bootupd status
|
||||
tap_finish
|
||||
Reference in New Issue
Block a user