1
0
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:
Colin Walters
2020-06-23 22:01:43 +00:00
parent 37c2f166f6
commit e3ff407f9e
5 changed files with 52 additions and 1 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
/target
Cargo.lock
fastbuild*.qcow2
_kola_temp

View File

@@ -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
View 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
View File

@@ -0,0 +1 @@
..

33
tests/kola/test-bootupd Executable file
View 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