Sync tests from Fedora

This commit is contained in:
Mikolaj Izdebski 2024-12-12 07:00:25 +01:00
parent c5a1ee4231
commit 30de64c47f
9 changed files with 88 additions and 13 deletions

1
ci.fmf Normal file
View File

@ -0,0 +1 @@
resultsdb-testcase: separate

View File

@ -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}

View File

@ -1,4 +0,0 @@
discover:
how: fmf
execute:
how: tmt

7
plans/javapackages.fmf Normal file
View File

@ -0,0 +1,7 @@
summary: Run javapackages-specific tests
discover:
how: fmf
url: https://src.fedoraproject.org/tests/javapackages
ref: c9s
execute:
how: tmt

5
plans/smoke.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

View File

@ -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

View File

@ -0,0 +1,5 @@
summary: javapackages-bootstrap smoke test
description: |
Test basic functionality of javapackages-bootstrap.
require:
- javapackages-bootstrap

64
tests/Sanity/smoke/runtest.sh Executable file
View File

@ -0,0 +1,64 @@
#!/bin/bash
# Author: Mikolaj Izdebski <mizdebsk@redhat.com>
. /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

4
tests/main.fmf Normal file
View File

@ -0,0 +1,4 @@
contact: Mikolaj Izdebski <mizdebsk@redhat.com>
framework: beakerlib
test: ./runtest.sh
tier: 0