This is similar to how other osbuild packages are testing: everything that's needed for testing is included in the tests package or a dependency of it. The test runner then runs every executable in /usr/libexec/tests/<packagename>. This gives a simple test API to projects depending on this package (notably osbuild-composer). The local development workflow described in HACKING.md is meant to continue to work. To ensure this, all relevant scripts gained a TEST_DATA variable, which defaults to `./test`, but is set from $1 to the installed path from integration.sh.
36 lines
818 B
Bash
Executable file
36 lines
818 B
Bash
Executable file
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
# this script must be run as root
|
|
if [ $UID != 0 ]; then
|
|
echo This script must be run as root.
|
|
exit 1
|
|
fi
|
|
|
|
TEST_PATH=${1:-test}
|
|
TEST_DATA=${TEST_PATH}/data
|
|
SHARE_DIR=${SHARE_DIR:-/tmp/osbuild-composer-koji-test}
|
|
|
|
mkdir -p "${SHARE_DIR}"
|
|
|
|
mkdir -p /etc/osbuild-composer
|
|
mkdir -p /etc/osbuild-worker
|
|
|
|
echo "Copying kerberos keytabs"
|
|
cp ${SHARE_DIR}/client.keytab \
|
|
/etc/osbuild-composer/client.keytab
|
|
|
|
cp ${SHARE_DIR}/client.keytab \
|
|
/etc/osbuild-worker/client.keytab
|
|
|
|
echo "Copying composer kerberos configuration"
|
|
cp ${TEST_DATA}/osbuild-composer.toml \
|
|
/etc/osbuild-composer/
|
|
|
|
mkdir -p /etc/osbuild-worker
|
|
cp ${TEST_DATA}/osbuild-worker.toml \
|
|
/etc/osbuild-worker/
|
|
|
|
echo "Copying system kerberos configuration"
|
|
cp ${TEST_DATA}/krb5.local.conf \
|
|
/etc/krb5.conf.d/local
|