diff --git a/.gitignore b/.gitignore index 7393c06a..d02d3a0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target Cargo.lock fastbuild*.qcow2 +_kola_temp diff --git a/Makefile b/Makefile index c271db6c..dc1be15a 100644 --- a/Makefile +++ b/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 diff --git a/README-devel.md b/README-devel.md new file mode 100644 index 00000000..e7057c36 --- /dev/null +++ b/README-devel.md @@ -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). \ No newline at end of file diff --git a/tests/kola/data b/tests/kola/data new file mode 120000 index 00000000..a96aa0ea --- /dev/null +++ b/tests/kola/data @@ -0,0 +1 @@ +.. \ No newline at end of file diff --git a/tests/kola/test-bootupd b/tests/kola/test-bootupd new file mode 100755 index 00000000..4309f452 --- /dev/null +++ b/tests/kola/test-bootupd @@ -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