From a3a0d7713d89e67874a7d0b734c7d6528f5e8ead Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Tue, 2 Jul 2024 11:35:59 +0200 Subject: [PATCH] Backport tests from Fedora --- plans/smoke.fmf | 11 +---------- {plans => tests/Sanity/smoke}/Smoke.java | 0 tests/Sanity/smoke/main.fmf | 6 ++++++ tests/Sanity/smoke/runtest.sh | 18 ++++++++++++++++++ tests/main.fmf | 4 ++++ 5 files changed, 29 insertions(+), 10 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 ef02451..a1e7bfd 100644 --- a/plans/smoke.fmf +++ b/plans/smoke.fmf @@ -1,14 +1,5 @@ summary: Basic smoke test discover: - how: shell - tests: - - name: /smoke/log-events - test: | - PATH=/usr/lib/jvm/java-1.8.0-openjdk/bin:${PATH} - javac -cp /usr/share/java/disruptor.jar plans/Smoke.java - java -cp /usr/share/java/disruptor.jar:plans Smoke -prepare: - how: install - package: java-1.8.0-openjdk-devel + 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..a551c7f --- /dev/null +++ b/tests/Sanity/smoke/main.fmf @@ -0,0 +1,6 @@ +summary: disruptor smoke test +description: | + Test basic functionality of disruptor. +require: + - disruptor + - java-21-openjdk-devel diff --git a/tests/Sanity/smoke/runtest.sh b/tests/Sanity/smoke/runtest.sh new file mode 100755 index 0000000..8116d4e --- /dev/null +++ b/tests/Sanity/smoke/runtest.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Author: Mikolaj Izdebski +. /usr/share/beakerlib/beakerlib.sh + +rlJournalStart + + rlPhaseStartTest "log events" + rlAssertRpm disruptor + java_home=/usr/lib/jvm/java-21-openjdk/bin + jar=/usr/share/java/disruptor.jar + rlRun "${java_home}/javac -cp ${jar} -d bin Smoke.java" + rlRun -s "${java_home}/java -cp ${jar}:bin Smoke" + rlAssertGrep "Event: LongEvent" $rlRun_LOG + rlAssertGrep "SMOKE TEST COMPLETE" $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