Add basic test

This commit is contained in:
Tomas Korbar 2020-11-19 09:44:23 +01:00
commit ecf46535cf
3 changed files with 21 additions and 0 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

3
tests/basic/main.fmf Normal file
View file

@ -0,0 +1,3 @@
summary: Concise summary describing what the test does
test: ./test.sh
framework: beakerlib

17
tests/basic/test.sh Executable file
View file

@ -0,0 +1,17 @@
#!/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 "echo 'test string' > /usr/share/cheat/whatever" 0 "Add test cheatsheet"
rlPhaseEnd
rlPhaseStartTest
rlRun "cheat whatever | grep 'test string'" 0 "Assert that test cheatsheet is properly read"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "rm /usr/share/cheat/whatever"
rlPhaseEnd
rlJournalEnd