From 30de64c47f5caf812f0000dcd50537237569270d Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Thu, 12 Dec 2024 07:00:25 +0100 Subject: [PATCH] Sync tests from Fedora --- ci.fmf | 1 + gating.yaml | 5 ++- plans.fmf | 4 --- plans/javapackages.fmf | 7 ++++ plans/smoke.fmf | 5 +++ smoke.fmf | 6 ---- tests/Sanity/smoke/main.fmf | 5 +++ tests/Sanity/smoke/runtest.sh | 64 +++++++++++++++++++++++++++++++++++ tests/main.fmf | 4 +++ 9 files changed, 88 insertions(+), 13 deletions(-) create mode 100644 ci.fmf delete mode 100644 plans.fmf create mode 100644 plans/javapackages.fmf create mode 100644 plans/smoke.fmf delete mode 100644 smoke.fmf create mode 100644 tests/Sanity/smoke/main.fmf create mode 100755 tests/Sanity/smoke/runtest.sh create mode 100644 tests/main.fmf diff --git a/ci.fmf b/ci.fmf new file mode 100644 index 0000000..c5aa0e0 --- /dev/null +++ b/ci.fmf @@ -0,0 +1 @@ +resultsdb-testcase: separate diff --git a/gating.yaml b/gating.yaml index 9214b2f..7f72400 100644 --- a/gating.yaml +++ b/gating.yaml @@ -4,6 +4,5 @@ product_versions: decision_contexts: - osci_compose_gate rules: - - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} - # https://docs.engineering.redhat.com/display/RHELPLAN/Maven+Bootstrap+manual+gating+test - - !PassingTestCaseRule {test_case_name: manual.sst_cs_apps.maven.bootstrap} + - !PassingTestCaseRule {test_case_name: osci.brew-build./plans/smoke.functional} + - !PassingTestCaseRule {test_case_name: osci.brew-build./plans/javapackages.functional} diff --git a/plans.fmf b/plans.fmf deleted file mode 100644 index e6427de..0000000 --- a/plans.fmf +++ /dev/null @@ -1,4 +0,0 @@ -discover: - how: fmf -execute: - how: tmt diff --git a/plans/javapackages.fmf b/plans/javapackages.fmf new file mode 100644 index 0000000..8ba3510 --- /dev/null +++ b/plans/javapackages.fmf @@ -0,0 +1,7 @@ +summary: Run javapackages-specific tests +discover: + how: fmf + url: https://src.fedoraproject.org/tests/javapackages + ref: c9s +execute: + how: tmt diff --git a/plans/smoke.fmf b/plans/smoke.fmf new file mode 100644 index 0000000..a1e7bfd --- /dev/null +++ b/plans/smoke.fmf @@ -0,0 +1,5 @@ +summary: Basic smoke test +discover: + how: fmf +execute: + how: tmt diff --git a/smoke.fmf b/smoke.fmf deleted file mode 100644 index 5e9e2b2..0000000 --- a/smoke.fmf +++ /dev/null @@ -1,6 +0,0 @@ -description: | - Run xmvn version provided by javapackages-bootstrap (similar as %check in spec does) -framework: shell -require: -- javapackages-bootstrap -test: $(rpm -ql javapackages-bootstrap | grep /xmvn$) --version diff --git a/tests/Sanity/smoke/main.fmf b/tests/Sanity/smoke/main.fmf new file mode 100644 index 0000000..0a0133d --- /dev/null +++ b/tests/Sanity/smoke/main.fmf @@ -0,0 +1,5 @@ +summary: javapackages-bootstrap smoke test +description: | + Test basic functionality of javapackages-bootstrap. +require: + - javapackages-bootstrap diff --git a/tests/Sanity/smoke/runtest.sh b/tests/Sanity/smoke/runtest.sh new file mode 100755 index 0000000..a30050d --- /dev/null +++ b/tests/Sanity/smoke/runtest.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# Author: Mikolaj Izdebski +. /usr/share/beakerlib/beakerlib.sh + +rlJournalStart + + PATH="/usr/libexec/javapackages-bootstrap:$PATH" + + rlPhaseStartTest "check for presence of libexec binaries" + rlAssertRpm javapackages-bootstrap + rlAssertBinaryOrigin mvn javapackages-bootstrap + rlAssertBinaryOrigin xmvn javapackages-bootstrap + rlAssertBinaryOrigin xmvn-install javapackages-bootstrap + rlAssertBinaryOrigin xmvn-resolve javapackages-bootstrap + rlAssertBinaryOrigin xmvn-subst javapackages-bootstrap + rlAssertBinaryOrigin ant javapackages-bootstrap + rlAssertBinaryOrigin cup javapackages-bootstrap + rlAssertBinaryOrigin jflex javapackages-bootstrap + rlPhaseEnd + + rlPhaseStartTest "display mvn version" + rlRun -s "mvn --version" + rlAssertGrep "Red Hat XMvn" $rlRun_LOG + rlAssertGrep "XMvn home: /usr/share/javapackages-bootstrap" $rlRun_LOG + rlPhaseEnd + + rlPhaseStartTest "display xmvn version" + rlRun -s "xmvn --version" + rlAssertGrep "Red Hat XMvn" $rlRun_LOG + rlAssertGrep "XMvn home: /usr/share/javapackages-bootstrap" $rlRun_LOG + rlPhaseEnd + + rlPhaseStartTest "display xmvn-install help" + rlRun -s "xmvn-install --help" + rlAssertGrep "Usage: xmvn-install" $rlRun_LOG + rlPhaseEnd + + rlPhaseStartTest "display xmvn-resolve help" + rlRun -s "xmvn-resolve --help" + rlAssertGrep "Usage: xmvn-resolve" $rlRun_LOG + rlPhaseEnd + + rlPhaseStartTest "display xmvn-subst help" + rlRun -s "xmvn-subst --help" + rlAssertGrep "Usage: xmvn-subst" $rlRun_LOG + rlPhaseEnd + + rlPhaseStartTest "display ant version" + rlRun -s "ant -version" + rlAssertGrep "Apache Ant(TM) version" $rlRun_LOG + rlPhaseEnd + + rlPhaseStartTest "display cup version" + rlRun -s "cup -version" 1 + rlAssertGrep "CUP v" $rlRun_LOG + rlPhaseEnd + + rlPhaseStartTest "display jflex version" + rlRun -s "jflex --version" + rlAssertGrep "This is JFlex" $rlRun_LOG + rlPhaseEnd + +rlJournalEnd +rlJournalPrintText diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..99fd67e --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,4 @@ +contact: Mikolaj Izdebski +framework: beakerlib +test: ./runtest.sh +tier: 0