Convert test to tmt and beakerlib

This commit is contained in:
Petr Šplíchal 2021-06-17 17:28:03 +02:00
parent 06e068bcd1
commit 88d0a1f993
5 changed files with 206 additions and 231 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

5
plans/basic.fmf Normal file
View File

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

18
tests/smoke/main.fmf Normal file
View File

@ -0,0 +1,18 @@
test: ./runtest.sh
framework: beakerlib
require:
- gcc
- make
- gnome-common
- autoconf
- automake
- gettext-devel
- ibus
- ibus-devel
- gtk3-devel
- pkgconfig
- libtool
- m17n-lib-devel
- m17n-db
- ibus-m17n
- rpm-build

385
tests/smoke/runtest.sh Normal file → Executable file
View File

@ -1,207 +1,186 @@
#!/bin/bash #!/bin/bash
. /usr/share/beakerlib/beakerlib.sh || exit 1
FAIL_COUNTER=0 rlJournalStart
rlPhaseStartSetup
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
rlRun "pushd $tmp"
rlFetchSrcForInstalled "ibus-m17n"
rlRun "rpm --define '_topdir $tmp' -i *src.rpm"
rlRun "mkdir BUILD" 0 "Creating BUILD directory"
rlRun "rpmbuild --nodeps --define '_topdir $tmp' -bp $tmp/SPECS/*spec"
rlRun "pushd BUILD/ibus-m17n*"
rlRun "set -o pipefail"
rlRun "NOCONFIGURE=1 ./autogen.sh"
rlRun "./configure --disable-static --with-gtk=3.0"
rlRun "make check"
rlAssertRpm "ibus"
rlAssertRpm "m17n-db"
rlPhaseEnd
check_pkg() { rlPhaseStartTest
local pkg=$1 rlRun "ibus-daemon -v -r -d"
if rpm -q $pkg rlRun "sleep 5" 0 "Give ibus-daemon some time to start properly."
then for name in \
echo "PASS" am:sera \
else ar:kbd \
echo "FAIL" ar:translit \
let "FAIL_COUNTER=FAIL_COUNTER+1" as:inscript \
fi as:inscript2 \
} as:itrans \
as:phonetic \
check_return_value () { ath:phonetic \
if [ $1 == 0 ] bla:phonetic \
then bn:disha \
echo "PASS" bn:inscript \
else bn:inscript2 \
echo "FAIL" bn:itrans \
let "FAIL_COUNTER=FAIL_COUNTER+1" bn:probhat \
fi bo:ewts \
} bo:tcrc \
bo:wylie \
pushd ../source brx:inscript2 \
cr:western \
echo "---Start autogen.sh---" da:post \
NOCONFIGURE=1 ./autogen.sh doi:inscript2 \
echo "---End autogen.sh---" dv:phonetic \
echo "--------------------" eo:h-fundamente \
eo:h-sistemo \
./configure --disable-static --with-gtk=3.0 eo:plena \
make check eo:q-sistemo \
check_return_value $? eo:vi-sistemo \
popd eo:x-sistemo \
fa:isiri \
check_pkg "ibus" fr:azerty \
check_pkg "m17n-db" grc:mizuochi \
gu:inscript \
ibus-daemon -v -r -d gu:inscript2 \
check_return_value $? gu:itrans \
gu:phonetic \
echo "give ibus-daemon some time to start properly." hi:inscript \
sleep 5 hi:inscript2 \
hi:itrans \
for name in \ hi:optitransv2 \
am:sera \ hi:phonetic \
ar:kbd \ hi:remington \
ar:translit \ hi:typewriter \
as:inscript \ hi:vedmata \
as:inscript2 \ hu:rovas-post \
as:itrans \ ii:phonetic \
as:phonetic \ iu:phonetic \
ath:phonetic \ kk:arabic \
bla:phonetic \ km:yannis \
bn:disha \ kn:inscript \
bn:inscript \ kn:inscript2 \
bn:inscript2 \ kn:itrans \
bn:itrans \ kn:kgp \
bn:probhat \ kn:optitransv2 \
bo:ewts \ kn:typewriter \
bo:tcrc \ kok:inscript2 \
bo:wylie \ ks:inscript \
brx:inscript2 \ ks:kbd \
cr:western \ lo:lrt \
da:post \ mai:inscript \
doi:inscript2 \ mai:inscript2 \
dv:phonetic \ ml:enhanced-inscript \
eo:h-fundamente \ ml:inscript \
eo:h-sistemo \ ml:inscript2 \
eo:plena \ ml:itrans \
eo:q-sistemo \ ml:mozhi \
eo:vi-sistemo \ ml:remington \
eo:x-sistemo \ ml:swanalekha \
fa:isiri \ mni:inscript2-beng \
fr:azerty \ mni:inscript2-mtei \
grc:mizuochi \ mr:inscript \
gu:inscript \ mr:inscript2 \
gu:inscript2 \ mr:itrans \
gu:itrans \ mr:phonetic \
gu:phonetic \ mr:remington \
hi:inscript \ mr:typewriter \
hi:inscript2 \ ne:inscript2 \
hi:itrans \ ne:rom \
hi:optitransv2 \ ne:rom-translit \
hi:phonetic \ ne:trad \
hi:remington \ ne:trad-ttf \
hi:typewriter \ nsk:phonetic \
hi:vedmata \ oj:phonetic \
hu:rovas-post \ or:inscript \
ii:phonetic \ or:inscript2 \
iu:phonetic \ or:itrans \
kk:arabic \ or:phonetic \
km:yannis \ pa:anmollipi \
kn:inscript \ pa:inscript \
kn:inscript2 \ pa:inscript2 \
kn:itrans \ pa:itrans \
kn:kgp \ pa:jhelum \
kn:optitransv2 \ pa:phonetic \
kn:typewriter \ ps:phonetic \
kok:inscript2 \ ru:phonetic \
ks:inscript \ ru:translit \
ks:kbd \ ru:yawerty \
lo:lrt \ sa:IAST \
mai:inscript \ sa:harvard-kyoto \
mai:inscript2 \ sa:inscript2 \
ml:enhanced-inscript \ sa:itrans \
ml:inscript \ sat:inscript2-deva \
ml:inscript2 \ sat:inscript2-olck \
ml:itrans \ sd:inscript \
ml:mozhi \ sd:inscript2 \
ml:remington \ si:phonetic-dynamic \
ml:swanalekha \ si:samanala \
mni:inscript2-beng \ si:sayura \
mni:inscript2-mtei \ si:singlish \
mr:inscript \ si:sumihiri \
mr:inscript2 \ si:transliteration \
mr:itrans \ si:wijesekera \
mr:phonetic \ sv:post \
mr:remington \ t:latn-post \
mr:typewriter \ t:latn-pre \
ne:inscript2 \ t:latn1-pre \
ne:rom \ t:lsymbol \
ne:rom-translit \ t:math-latex \
ne:trad \ t:rfc1345 \
ne:trad-ttf \ t:ssymbol \
nsk:phonetic \ t:syrc-phonetic \
oj:phonetic \ t:unicode \
or:inscript \ ta:inscript \
or:inscript2 \ ta:inscript2 \
or:itrans \ ta:itrans \
or:phonetic \ ta:lk-renganathan \
pa:anmollipi \ ta:phonetic \
pa:inscript \ ta:tamil99 \
pa:inscript2 \ ta:typewriter \
pa:itrans \ ta:vutam \
pa:jhelum \ tai:sonla-kbd \
pa:phonetic \ te:apple \
ps:phonetic \ te:inscript \
ru:phonetic \ te:inscript2 \
ru:translit \ te:itrans \
ru:yawerty \ te:pothana \
sa:IAST \ te:rts \
sa:harvard-kyoto \ te:sarala \
sa:inscript2 \ th:kesmanee \
sa:itrans \ th:pattachote \
sat:inscript2-deva \ th:tis820 \
sat:inscript2-olck \ ur:phonetic \
sd:inscript \ vi:han \
sd:inscript2 \ vi:nomtelex \
si:phonetic-dynamic \ vi:nomvni \
si:samanala \ vi:tcvn \
si:sayura \ vi:telex \
si:singlish \ vi:viqr \
si:sumihiri \ vi:vni \
si:transliteration \ yi:yivo
si:wijesekera \ do
sv:post \ rlRun "/usr/libexec/ibus-engine-m17n --xml 2>/dev/null | grep '<name>m17n:${name}</name>'" \
t:latn-post \ 0 "checking whether 'ibus-engine-m17n --xml' can list m17n:${name}:"
t:latn-pre \ rlRun "ibus list-engine --name-only | grep 'm17n:${name}$'" \
t:latn1-pre \ 0 "checking whether ibus can list m17n:${name}:"
t:lsymbol \ done
t:math-latex \ rlPhaseEnd
t:rfc1345 \
t:ssymbol \
t:syrc-phonetic \
t:unicode \
ta:inscript \
ta:inscript2 \
ta:itrans \
ta:lk-renganathan \
ta:phonetic \
ta:tamil99 \
ta:typewriter \
ta:vutam \
tai:sonla-kbd \
te:apple \
te:inscript \
te:inscript2 \
te:itrans \
te:pothana \
te:rts \
te:sarala \
th:kesmanee \
th:pattachote \
th:tis820 \
ur:phonetic \
vi:han \
vi:nomtelex \
vi:nomvni \
vi:tcvn \
vi:telex \
vi:viqr \
vi:vni \
yi:yivo
do
echo "checking whether 'ibus-engine-m17n --xml' can list m17n:${name}:"
/usr/libexec/ibus-engine-m17n --xml 2>/dev/null | grep "<name>m17n:${name}</name>"
check_return_value $?
echo "checking whether ibus can list m17n:${name}:"
ibus list-engine --name-only | grep "m17n:${name}$"
check_return_value $?
done
exit ${FAIL_COUNTER}
rlPhaseStartCleanup
rlRun "popd; popd"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlPhaseEnd
rlJournalEnd

View File

@ -1,28 +0,0 @@
---
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-source
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-basic
tests:
- smoke
required_packages:
- gcc
- make
- gnome-common
- autoconf
- automake
- gettext-devel
- ibus
- ibus-devel
- gtk3-devel
- pkgconfig
- libtool
- m17n-lib-devel
- m17n-db