Extract smoke tests out of test plan

We want tests to be stored directly in the file system
instead of being embedded into tests plans.
This commit is contained in:
Mikolaj Izdebski 2024-06-26 13:45:39 +02:00
parent 4670cbf297
commit 0afbc535b5
4 changed files with 74 additions and 20 deletions

View File

@ -1,24 +1,5 @@
summary: Basic smoke test
discover:
how: shell
tests:
- name: /smoke/maven-version
test: /usr/libexec/javapackages-bootstrap/mvn --version
- name: /smoke/maven-home-version
test: /usr/share/javapackages-bootstrap/bin/mvn --version
- name: /smoke/xmvn-version
test: /usr/libexec/javapackages-bootstrap/xmvn --version
- name: /smoke/xmvn-install-help
test: /usr/libexec/javapackages-bootstrap/xmvn-install --help
- name: /smoke/xmvn-resolve-help
test: /usr/libexec/javapackages-bootstrap/xmvn-resolve --help
- name: /smoke/xmvn-subst-help
test: /usr/libexec/javapackages-bootstrap/xmvn-subst --help
- name: /smoke/ant-version
test: /usr/libexec/javapackages-bootstrap/ant -version
- name: /smoke/cup
test: echo 'non terminal bar; bar::=;' | /usr/libexec/javapackages-bootstrap/cup
- name: /smoke/jflex-version
test: /usr/libexec/javapackages-bootstrap/jflex -version
how: fmf
execute:
how: tmt

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