From 51a7a1265f363dad051ec085dab6e22a88aaa5a5 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Mon, 3 May 2021 15:27:10 -0700 Subject: [PATCH] tests: Add gating tests Run lorax with lorax-templates-rhel to build a boot.iso Resolves: rhbz#1956563 --- gating.yaml | 6 ++++++ tests/.fmf/version | 1 + tests/provision.fmf | 5 +++++ tests/scripts/run_tests.sh | 18 ++++++++++++++++++ tests/tests.yml | 16 ++++++++++++++++ 5 files changed, 46 insertions(+) create mode 100644 gating.yaml create mode 100644 tests/.fmf/version create mode 100644 tests/provision.fmf create mode 100755 tests/scripts/run_tests.sh create mode 100644 tests/tests.yml diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..6985029 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-8 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/.fmf/version b/tests/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/tests/provision.fmf b/tests/provision.fmf new file mode 100644 index 0000000..dd69f34 --- /dev/null +++ b/tests/provision.fmf @@ -0,0 +1,5 @@ +--- + +standard-inventory-qcow2: + qemu: + m: 4G diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh new file mode 100755 index 0000000..79e432b --- /dev/null +++ b/tests/scripts/run_tests.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -eux + +if [ ! -e /usr/share/lorax/templates.d/80-rhel/ ]; then + echo "Failed to find lorax-templates-rhel templates in /usr/share/lorax/templates.d/" + exit 1 +fi + +# Gather up the list of system repo files and use them for lorax +REPOS=$(for f in /etc/yum.repos.d/*repo; do echo -n "--repo $f "; done) +if [ -z "$REPOS" ]; then + echo "No system repos found" + exit 1 +fi + +# Run lorax using the host's repository configuration file +lorax --product="Red Hat Enterprise Linux" --version=9 --release=9 --volid="RHEL-9-test" \ + $REPOS --isfinal --nomacboot /var/tmp/lorax-rhel9-iso/ diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..e8f3de2 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,16 @@ +--- +# Run lorax with the new templates +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + + required_packages: + - lorax + - lorax-templates-rhel + + tests: + - simple: + dir: scripts + run: ./run_tests.sh