diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..648918d --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/run_tests.sh b/tests/run_tests.sh new file mode 100755 index 0000000..3d858f7 --- /dev/null +++ b/tests/run_tests.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# fail the whole test set if any of the command pipelines fail +set -ex + +# when running this in 1minutetip the PATH must be specified to execute +# in the local directory. +echo "Setting path to local directory" +PATH=$PATH:$(pwd) + +# simple version test +version.sh diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..b83c0a1 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,9 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + tests: + - simple: + dir: . # switch to subfolder. This parameter is REQUIRED, use `dir: .` for current folder + run: ./run_tests.sh # this is your test command, its exit code is the outcome of the test diff --git a/tests/version.sh b/tests/version.sh new file mode 100755 index 0000000..4765ecb --- /dev/null +++ b/tests/version.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# +# Thermald is a systemd unit file that requires specific hardware and +# firmware. As such it is difficult to test in an automated fashion. + +# fail the whole test if any of the command pipelines below fails +set -ex + +rpmversion=$(rpm -q --queryformat '%{VERSION}' thermald) +version=$(thermald --version) +if [ "$version" != "$rpmversion" ]; then + echo "reported thermald version (${version}) does not match rpm version (${rpmversion})" + exit 1 +fi + +# if we get here, it's OK +