From d56081b2f998564429b2eaef55e4dd747cfbd3b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Fri, 14 Mar 2025 10:05:48 +0000 Subject: [PATCH] Add basic gating smoke test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel P. Berrangé --- .fmf/version | 1 + gating.yaml | 6 ++++++ plans/main.fmf | 7 +++++++ tests/main.fmf | 8 ++++++++ tests/smoke.sh | 26 ++++++++++++++++++++++++++ 5 files changed, 48 insertions(+) create mode 100644 .fmf/version create mode 100644 gating.yaml create mode 100644 plans/main.fmf create mode 100644 tests/main.fmf create mode 100755 tests/smoke.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 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/plans/main.fmf b/plans/main.fmf new file mode 100644 index 0000000..0f19e3c --- /dev/null +++ b/plans/main.fmf @@ -0,0 +1,7 @@ +summary: qemu tests +description: + Test qemu +discover: + how: fmf +execute: + how: tmt diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..2489626 --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,8 @@ +summary: Basic smoke test + +require: + - rpm-build + - sgx-rpm-macros + +/smoke: + test: ./smoke.sh diff --git a/tests/smoke.sh b/tests/smoke.sh new file mode 100755 index 0000000..0cbb004 --- /dev/null +++ b/tests/smoke.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +function evalmacro { + name=$1 + + dir=$(rpmbuild --eval "%$name") + + if test "$dir" == "%$name" + then + echo "$name is undefined" + exit 1 + fi + if test -z "$dir" + then + echo "$name is empty" + exit 1 + fi +} + +evalmacro sgx_prefix +evalmacro sgx_libdir +evalmacro sgx_includedir + +exit 0