diff --git a/tests/test/script/data/.fmf/version b/tests/test/script/data/.fmf/version new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/tests/test/script/data/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/tests/test/script/data/tests/foo.fmf b/tests/test/script/data/tests/foo.fmf new file mode 100644 index 0000000000..57f0b43eda --- /dev/null +++ b/tests/test/script/data/tests/foo.fmf @@ -0,0 +1,9 @@ +/pos: + summary: Normal test metadata should be accepted + test: 'false' + framework: shell + +/neg: + summary: Malformed test metadata should be rejected + test: false + framework: shell diff --git a/tests/test/script/main.fmf b/tests/test/script/main.fmf new file mode 100644 index 0000000000..01238c893c --- /dev/null +++ b/tests/test/script/main.fmf @@ -0,0 +1 @@ +summary: Verify test metadata should be string diff --git a/tests/test/script/test.sh b/tests/test/script/test.sh new file mode 100755 index 0000000000..755efb095c --- /dev/null +++ b/tests/test/script/test.sh @@ -0,0 +1,23 @@ +#!/bin/bash +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup + rlRun "pushd data" + rlRun "set -o pipefail" + rlPhaseEnd + + rlPhaseStartTest "Normal test metadata" + rlRun -s "tmt tests ls /pos" 0 + rlAssertGrep "/tests/foo/pos" $rlRun_LOG + rlPhaseEnd + + rlPhaseStartTest "Malformed test metadata" + rlRun -s "tmt tests ls /neg" "1-255" + rlAssertGrep "Field '/tests/foo/neg:test' must be a string, 'bool' found" $rlRun_LOG + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlPhaseEnd +rlJournalEnd