Skip to content

Commit

Permalink
Enable simple smoke test in the testing farm
Browse files Browse the repository at this point in the history
  • Loading branch information
psss committed Dec 9, 2019
1 parent fd752cf commit e01e3dc
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions .fmf/version
@@ -0,0 +1 @@
1
8 changes: 8 additions & 0 deletions .packit.yaml
Expand Up @@ -21,3 +21,11 @@ jobs:
- fedora-31-x86_64
- fedora-rawhide-x86_64
trigger: pull_request

- job: tests
metadata:
targets:
- fedora-30-x86_64
- fedora-31-x86_64
- fedora-rawhide-x86_64
trigger: pull_request
6 changes: 6 additions & 0 deletions plans/smoke.fmf
@@ -0,0 +1,6 @@
summary:
Basic smoke test
discover:
how: fmf
execute:
how: beakerlib
3 changes: 3 additions & 0 deletions tests/help/main.fmf
@@ -0,0 +1,3 @@
summary: Basic smoke test
description: Create a minimal config and check the help message.
test: ./test.sh
30 changes: 30 additions & 0 deletions tests/help/test.sh
@@ -0,0 +1,30 @@
#!/bin/bash

# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1

PACKAGE="tmt"

CONFIG="
[general]
email = email@example.com
"

rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TMP=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TMP"
rlRun "echo $CONFIG > config"
rlPhaseEnd

rlPhaseStartTest
rlRun "did --help --config $TMP/config | tee output" 0 "Check help"
rlAssertGrep "week|month|quarter|year" "output"
rlPhaseEnd

rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TMP" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalEnd

0 comments on commit e01e3dc

Please sign in to comment.