From 8d9864494a5304e9204a380038eb117e7510da2f Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Tue, 13 Aug 2024 11:26:17 +0900 Subject: [PATCH] Add tmt based test cases --- .fmf/version | 1 + plans/basic.fmf | 10 ++++++++++ tests/basic/main.fmf | 3 +++ tests/basic/test.sh | 23 +++++++++++++++++++++++ 4 files changed, 37 insertions(+) create mode 100644 .fmf/version create mode 100644 plans/basic.fmf create mode 100644 tests/basic/main.fmf create mode 100755 tests/basic/test.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/basic.fmf b/plans/basic.fmf new file mode 100644 index 0000000..a27c75a --- /dev/null +++ b/plans/basic.fmf @@ -0,0 +1,10 @@ +summary: Basic smoke test +discover: + how: fmf +prepare: + name: tmt + how: install + package: + - fonts-rpm-macros +execute: + how: tmt diff --git a/tests/basic/main.fmf b/tests/basic/main.fmf new file mode 100644 index 0000000..4b2193c --- /dev/null +++ b/tests/basic/main.fmf @@ -0,0 +1,3 @@ +summary: Basic test +test: ./test.sh +framework: beakerlib diff --git a/tests/basic/test.sh b/tests/basic/test.sh new file mode 100755 index 0000000..0c22694 --- /dev/null +++ b/tests/basic/test.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup + rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" + rlRun "pushd $tmp" + rlRun "set -o pipefail" + rlPhaseEnd + + rlPhaseStartTest + rlRun "fc-weight --help | tee output" 0 "Check help message for fc-weight" + rlAssertGrep "fontconfig weight" "output" + rlRun "gen-fontconf --help | tee output" 0 "Check help message for gen-fontconf" + rlAssertGrep "fontconfig syntax" "output" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $tmp" 0 "Remove tmp directory" + rlPhaseEnd +rlJournalEnd