From 795c289e3d3dce0ecaf72aaff763455e8548babb Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Tue, 2 Jul 2024 11:40:51 +0200 Subject: [PATCH] Backport tests from Fedora --- plans/smoke.fmf | 14 +------------- {plans => tests/Sanity/smoke}/Smoke.java | 0 tests/Sanity/smoke/main.fmf | 7 +++++++ tests/Sanity/smoke/runtest.sh | 16 ++++++++++++++++ tests/main.fmf | 5 +++++ 5 files changed, 29 insertions(+), 13 deletions(-) rename {plans => tests/Sanity/smoke}/Smoke.java (100%) 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/plans/smoke.fmf b/plans/smoke.fmf index b6f90d0..a1e7bfd 100644 --- a/plans/smoke.fmf +++ b/plans/smoke.fmf @@ -1,17 +1,5 @@ summary: Basic smoke test -prepare: - how: install - package: - - java-11-openjdk-devel - - xmvn-tools discover: - how: shell - tests: - - name: /smoke/classpath-import - test: | - CLASSPATH+=":$(xmvn-resolve com.sun.xml.dtd-parser:dtd-parser)" - export CLASSPATH - /usr/lib/jvm/java-11-openjdk/bin/javac plans/Smoke.java - /usr/lib/jvm/java-11-openjdk/bin/java -cp "${CLASSPATH}:plans" Smoke + how: fmf execute: how: tmt diff --git a/plans/Smoke.java b/tests/Sanity/smoke/Smoke.java similarity index 100% rename from plans/Smoke.java rename to tests/Sanity/smoke/Smoke.java diff --git a/tests/Sanity/smoke/main.fmf b/tests/Sanity/smoke/main.fmf new file mode 100644 index 0000000..dd5a73c --- /dev/null +++ b/tests/Sanity/smoke/main.fmf @@ -0,0 +1,7 @@ +summary: jaxb-dtd-parser smoke test +description: | + Test basic functionality of jaxb-dtd-parser. +require: + - jaxb-dtd-parser + - java-21-openjdk-devel + - xmvn-tools diff --git a/tests/Sanity/smoke/runtest.sh b/tests/Sanity/smoke/runtest.sh new file mode 100755 index 0000000..f16aa8e --- /dev/null +++ b/tests/Sanity/smoke/runtest.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Author: Marian Koncek +. /usr/share/beakerlib/beakerlib.sh + +rlJournalStart + + rlPhaseStartTest "compile Smoke.java and run it" + CLASSPATH+=":$(xmvn-resolve com.sun.xml.dtd-parser:dtd-parser)" + export CLASSPATH + rlRun "/usr/lib/jvm/java-21-openjdk/bin/javac Smoke.java" + rlRun -s "/usr/lib/jvm/java-21-openjdk/bin/java -cp \"${CLASSPATH}:plans\" Smoke" + rlAssertGrep "com.sun.xml.dtdparser.DTDParser" $rlRun_LOG + rlPhaseEnd + +rlJournalEnd +rlJournalPrintText diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..543e68e --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,5 @@ +contact: Marian Koncek +framework: beakerlib +test: ./runtest.sh +tier: 0 +component: jaxb-dtd-parser