Add tests using tmt

epel9
Ewoud Kohl van Wijngaarden 2 years ago
parent 65dda53fbe
commit 786139b961
No known key found for this signature in database
GPG Key ID: C6EC8F04A934BAB1

1
.gitignore vendored

@ -5,3 +5,4 @@
/puppet-*/
/.build*.log
results_puppet/
/tests/*/log.txt

@ -0,0 +1,7 @@
summary: Run puppet lookup
prepare:
how: install
package: puppet
execute:
how: tmt
script: puppet lookup --explain foo

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

@ -0,0 +1,4 @@
summary: Basic smoke testing
require: puppet
test: ./test.sh
framework: beakerlib

@ -0,0 +1,25 @@
#!/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"
rlAssertRpm puppet
rlPhaseEnd
rlPhaseStartTest
rlRun -s "puppet --help" 0 "Check help message"
rlAssertNotGrep "warning" $rlRun_LOG -i
rlRun "echo \"file { '${tmp}/applied-file': ensure => file, content => 'Hello World' }\" | puppet apply" 0 "Apply manifest"
rlAssertGrep "Hello World" "applied-file"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlPhaseEnd
rlJournalEnd
Loading…
Cancel
Save