Skip to content

Commit

Permalink
Add a simple test
Browse files Browse the repository at this point in the history
Signed-off-by: Vector Li <[email protected]>
  • Loading branch information
Vector Li committed Jun 13, 2023
1 parent f4995d8 commit 7a16e89
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/test/script/data/.fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
9 changes: 9 additions & 0 deletions tests/test/script/data/tests/foo.fmf
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions tests/test/script/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
summary: Verify test metadata should be string
23 changes: 23 additions & 0 deletions tests/test/script/test.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7a16e89

Please sign in to comment.