From de97470f189de987b0ea2c79fc3e49711a48be8c Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Tue, 2 Jul 2024 11:36:06 +0200 Subject: [PATCH] Backport tests from Fedora --- plans/smoke.fmf | 17 +-------------- tests/Sanity/smoke/main.fmf | 6 +++++ tests/Sanity/smoke/runtest.sh | 29 +++++++++++++++++++++++++ {plans => tests/Sanity/smoke}/smoke.mdo | 0 tests/main.fmf | 4 ++++ 5 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 tests/Sanity/smoke/main.fmf create mode 100755 tests/Sanity/smoke/runtest.sh rename {plans => tests/Sanity/smoke}/smoke.mdo (100%) create mode 100644 tests/main.fmf diff --git a/plans/smoke.fmf b/plans/smoke.fmf index 72ff510..a1e7bfd 100644 --- a/plans/smoke.fmf +++ b/plans/smoke.fmf @@ -1,20 +1,5 @@ summary: Basic smoke test discover: - how: shell - tests: - - name: /smoke/generate-stax-reader - test: | - set -x - PATH=/usr/lib/jvm/java-11-openjdk/bin:${PATH} - modello plans/smoke.mdo java test-src 1.0.0 foo 8 - javac -d test-bin test-src/smoke/* - modello plans/smoke.mdo stax-reader test-src 1.0.0 foo 8 - javac -d test-bin -cp test-bin test-src/smoke/io/stax/* - find test-src test-bin - test -f test-bin/smoke/SomeBean.class - test -f test-bin/smoke/io/stax/SmokeStaxReader.class -prepare: - how: install - package: java-11-openjdk-devel + how: fmf execute: how: tmt diff --git a/tests/Sanity/smoke/main.fmf b/tests/Sanity/smoke/main.fmf new file mode 100644 index 0000000..bd1bd91 --- /dev/null +++ b/tests/Sanity/smoke/main.fmf @@ -0,0 +1,6 @@ +summary: modello smoke test +description: | + Test basic functionality of modello. +require: + - modello + - java-21-openjdk-devel diff --git a/tests/Sanity/smoke/runtest.sh b/tests/Sanity/smoke/runtest.sh new file mode 100755 index 0000000..c5cca84 --- /dev/null +++ b/tests/Sanity/smoke/runtest.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Author: Mikolaj Izdebski +. /usr/share/beakerlib/beakerlib.sh + +rlJournalStart + + PATH=/usr/lib/jvm/java-21-openjdk/bin:${PATH} + + rlPhaseStartTest "check for presence of modello command" + rlAssertRpm modello + rlAssertBinaryOrigin modello modello + rlPhaseEnd + + rlPhaseStartTest "display modello usage" + rlRun -s "modello" 1 + rlAssertGrep "Usage: modello" $rlRun_LOG + rlPhaseEnd + + rlPhaseStartTest "generate STAX reader" + rlRun "modello smoke.mdo java test-src 1.0.0 foo 8" + rlRun "javac -d test-bin test-src/smoke/*" + rlAssertExists test-bin/smoke/SomeBean.class + rlRun "modello smoke.mdo stax-reader test-src 1.0.0 foo 8" + rlRun "javac -d test-bin -cp test-bin test-src/smoke/io/stax/*" + rlAssertExists test-bin/smoke/io/stax/SmokeStaxReader.class + rlPhaseEnd + +rlJournalEnd +rlJournalPrintText diff --git a/plans/smoke.mdo b/tests/Sanity/smoke/smoke.mdo similarity index 100% rename from plans/smoke.mdo rename to tests/Sanity/smoke/smoke.mdo 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