9daea46d66
Again, a lot going on here, but essentially, we adapt the compose tests to run either privileged or fully unprivileged via supermin, just like cosa. I actually got more than halfway through this initially using `cosa build` directly for testing. But in the end, we simply need more flexibility than that. We want to be able to manipulate exactly how rpm-ostree is called, and cosa is very opinionated about this (and may also change from under us in the future). (Another big difference for example is that cosa doesn't care about non-unified mode, whereas we *need* to have coverage for this until we fully kill it.) Really, the most important bit we want from there is the unprivileged-via-supermin bits. So we copy and adapt that here. One obvious improvement then is sharing this code more easily (e.g. a `cosa runasroot` or something?) However, we still use the FCOS manifest (frozen at a specific tag). It's a realistic example, and because of the lockfiles and pool, we get good reproducibility.
27 lines
685 B
Bash
Executable File
27 lines
685 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
dn=$(cd "$(dirname "$0")" && pwd)
|
|
topsrcdir=$(cd "$dn/.." && pwd)
|
|
commondir=$(cd "$dn/common" && pwd)
|
|
export topsrcdir commondir
|
|
|
|
# shellcheck source=common/libtest-core.sh
|
|
. "${commondir}/libtest-core.sh"
|
|
|
|
read -r -a tests <<< "$(filter_tests "${topsrcdir}/tests/vmcheck")"
|
|
if [ ${#tests[*]} -eq 0 ]; then
|
|
echo "No tests selected; mistyped filter?"
|
|
exit 0
|
|
fi
|
|
|
|
JOBS=${JOBS:-$(ncpus)}
|
|
|
|
echo "Running ${#tests[*]} tests ${JOBS} at a time"
|
|
|
|
outputdir="${topsrcdir}/vmcheck-logs"
|
|
echo "Test results outputting to ${outputdir}/"
|
|
|
|
echo -n "${tests[*]}" | parallel -d' ' -j "${JOBS}" --line-buffer \
|
|
"${topsrcdir}/tests/vmcheck/runtest.sh" "${outputdir}"
|