Bootstrap CI tests from internal RHEL dist-git branch
Resolves: rhbz#2174845 Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
2afed9bb24
commit
6bb05396df
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
9
plans/integration-tests.fmf
Normal file
9
plans/integration-tests.fmf
Normal file
@ -0,0 +1,9 @@
|
||||
summary: Build simple image using osbuild
|
||||
prepare:
|
||||
how: install
|
||||
package:
|
||||
- osbuild
|
||||
execute:
|
||||
script: ./tests/scripts/build-images.sh ./tests/manifests
|
||||
duration: 4h
|
||||
|
14
plans/unit-tests.fmf
Normal file
14
plans/unit-tests.fmf
Normal file
@ -0,0 +1,14 @@
|
||||
summary: Run osbuild unit tests from source
|
||||
prepare:
|
||||
how: install
|
||||
package:
|
||||
- git
|
||||
- make
|
||||
- python3-mako
|
||||
- python3-pytest
|
||||
- osbuild
|
||||
discover:
|
||||
how: fmf
|
||||
dist-git-source: true
|
||||
execute:
|
||||
how: tmt
|
7202
tests/manifests/centos-8.json
Normal file
7202
tests/manifests/centos-8.json
Normal file
File diff suppressed because it is too large
Load Diff
6799
tests/manifests/centos-9.json
Normal file
6799
tests/manifests/centos-9.json
Normal file
File diff suppressed because it is too large
Load Diff
7021
tests/manifests/fedora.json
Normal file
7021
tests/manifests/fedora.json
Normal file
File diff suppressed because it is too large
Load Diff
4083
tests/manifests/rhel-8.json
Normal file
4083
tests/manifests/rhel-8.json
Normal file
File diff suppressed because it is too large
Load Diff
7021
tests/manifests/rhel-9.json
Normal file
7021
tests/manifests/rhel-9.json
Normal file
File diff suppressed because it is too large
Load Diff
49
tests/scripts/build-images.sh
Executable file
49
tests/scripts/build-images.sh
Executable file
@ -0,0 +1,49 @@
|
||||
#!/usr/bin/bash
|
||||
set -euxo pipefail
|
||||
|
||||
MANIFESTS_DIR=$1
|
||||
# check that MANIFESTS_DIR is a directory
|
||||
if [ ! -d "$MANIFESTS_DIR" ]; then
|
||||
echo "Error: $MANIFESTS_DIR is not a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ensure that we are running on x86_64 architecture
|
||||
if [ "$(uname -m)" != "x86_64" ]; then
|
||||
echo "Error: this script is only supported on x86_64 architecture"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. /etc/os-release
|
||||
|
||||
case "${ID}-${VERSION_ID}" in
|
||||
fedora-*)
|
||||
IMAGE_MANIFEST="${MANIFESTS_DIR}/fedora.json"
|
||||
;;
|
||||
rhel-8.*)
|
||||
IMAGE_MANIFEST="${MANIFESTS_DIR}/rhel-8.json"
|
||||
;;
|
||||
rhel-9.*)
|
||||
IMAGE_MANIFEST="${MANIFESTS_DIR}/rhel-9.json"
|
||||
;;
|
||||
centos-8)
|
||||
IMAGE_MANIFEST="${MANIFESTS_DIR}/centos-8.json"
|
||||
;;
|
||||
centos-9)
|
||||
IMAGE_MANIFEST="${MANIFESTS_DIR}/centos-9.json"
|
||||
;;
|
||||
*)
|
||||
echo "Error: unsupported OS: ${ID}-${VERSION_ID}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
OUTPUT_DIR=/var/tmp/osbuild-output
|
||||
STORE_DIR=/var/tmp/osbuild-store
|
||||
sudo mkdir -p "${OUTPUT_DIR}"
|
||||
sudo mkdir -p "${STORE_DIR}"
|
||||
|
||||
# all the images are built with qcow2 format, so export it
|
||||
EXPORT_PIPELINE="qcow2"
|
||||
|
||||
sudo osbuild --output-directory "${OUTPUT_DIR}" --store "${STORE_DIR}" --export "${EXPORT_PIPELINE}" "${IMAGE_MANIFEST}"
|
2
tests/unit.fmf
Normal file
2
tests/unit.fmf
Normal file
@ -0,0 +1,2 @@
|
||||
summary: Run unit tests using upstream source
|
||||
test: cd ../osbuild-*/ && python3 -m pytest test/mod
|
Loading…
Reference in New Issue
Block a user