debian-forge-composer/test/cases/generation.sh
Thomas Lavocat 53cb1b952e Tests: generation works with dnf-json.socket down
Test that the test cases generation will properly start the
dnf-json.socket when needed.
2021-12-15 09:41:32 +01:00

44 lines
992 B
Bash
Executable file

#!/usr/bin/bash
set -euxo pipefail
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
# Get OS data
source /usr/libexec/osbuild-composer-test/set-env-variables.sh
# Colorful timestamped output.
function greenprint {
echo -e "\033[1;32m[$(date -Isecond)] ${1}\033[0m"
}
# install requirements
sudo dnf -q -y install make \
git \
go \
ranger \
openssl \
rpm-build \
aws \
qemu \
setools-console \
setroubleshoot \
container-selinux \
lvm2
# stop dnf-json socket
sudo systemctl stop osbuild-dnf-json.socket
# test the test cases generation
WORKDIR=$(mktemp -d -p /var/tmp)
OSBUILD_LABEL=$(matchpathcon -n "$(which osbuild)")
chcon "$OSBUILD_LABEL" tools/image-info
# test the test case generation when dnf-json socket is stopped
sudo ./tools/test-case-generators/generate-test-cases\
--output test/data/manifests\
--arch x86_64\
--distro rhel-8\
--image-type qcow2\
--store "$WORKDIR"