Related: rhbz#1978053 convert CI tests to tmt
This commit is contained in:
parent
6a4e64001a
commit
05a8bb7047
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
9
plans/basic.fmf
Normal file
9
plans/basic.fmf
Normal file
@ -0,0 +1,9 @@
|
||||
summary: Basic smoke test
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
||||
prepare:
|
||||
how: shell
|
||||
script:
|
||||
- dnf config-manager --enable rhel-CRB --enable rhel-buildroot
|
20
tests/main.fmf
Normal file
20
tests/main.fmf
Normal file
@ -0,0 +1,20 @@
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
duration: 10m
|
||||
require:
|
||||
- ibus
|
||||
- ibus-table
|
||||
- ibus-table-chinese
|
||||
- ibus-table-chinese-array
|
||||
- ibus-table-chinese-cangjie
|
||||
- ibus-table-chinese-cantonese
|
||||
- ibus-table-chinese-cantonyale
|
||||
- ibus-table-chinese-easy
|
||||
- ibus-table-chinese-erbi
|
||||
- ibus-table-chinese-quick
|
||||
- ibus-table-chinese-scj
|
||||
- ibus-table-chinese-stroke5
|
||||
- ibus-table-chinese-wu
|
||||
- ibus-table-chinese-wubi-haifeng
|
||||
- ibus-table-chinese-wubi-jidian
|
||||
- ibus-table-chinese-yong
|
65
tests/runtest.sh
Executable file
65
tests/runtest.sh
Executable file
@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
|
||||
rlRun "pushd $tmp"
|
||||
rlAssertRpm "ibus"
|
||||
rlAssertRpm "ibus-table"
|
||||
rlAssertRpm "ibus-table-chinese"
|
||||
rlAssertRpm "ibus-table-chinese-array"
|
||||
rlAssertRpm "ibus-table-chinese-cangjie"
|
||||
rlAssertRpm "ibus-table-chinese-cantonese"
|
||||
rlAssertRpm "ibus-table-chinese-cantonyale"
|
||||
rlAssertRpm "ibus-table-chinese-easy"
|
||||
rlAssertRpm "ibus-table-chinese-erbi"
|
||||
rlAssertRpm "ibus-table-chinese-quick"
|
||||
rlAssertRpm "ibus-table-chinese-scj"
|
||||
rlAssertRpm "ibus-table-chinese-stroke5"
|
||||
rlAssertRpm "ibus-table-chinese-wu"
|
||||
rlAssertRpm "ibus-table-chinese-wubi-haifeng"
|
||||
rlAssertRpm "ibus-table-chinese-wubi-jidian"
|
||||
rlAssertRpm "ibus-table-chinese-yong"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "ibus-daemon -v -r -d"
|
||||
rlRun "sleep 5" 0 "Give ibus-daemon some time to start properly."
|
||||
for name in \
|
||||
array30-big \
|
||||
array30 \
|
||||
cangjie-big \
|
||||
cangjie3 \
|
||||
cangjie5 \
|
||||
cantonese \
|
||||
cantonhk \
|
||||
cantonyale \
|
||||
easy-big \
|
||||
erbi-qs \
|
||||
erbi \
|
||||
jyutping \
|
||||
quick-classic \
|
||||
quick3 \
|
||||
quick5 \
|
||||
scj6 \
|
||||
stroke5 \
|
||||
wu \
|
||||
wubi-haifeng86 \
|
||||
wubi-jidian86 \
|
||||
yong
|
||||
do
|
||||
rlRun "/usr/libexec/ibus-engine-table --xml 2>/dev/null | grep '<name>table:${name}</name>'" \
|
||||
0 "checking whether 'ibus-engine-table --xml' can list table:${name}:"
|
||||
|
||||
rlRun "ibus list-engine --name-only | grep 'table:${name}$'" \
|
||||
0 "checking whether ibus can list table:${name}:"
|
||||
done
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "ibus exit" 0 "Exit ibus"
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $tmp" 0 "Remove tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalEnd
|
@ -1,85 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
FAIL_COUNTER=0
|
||||
|
||||
check_pkg() {
|
||||
local pkg=$1
|
||||
if rpm -q $pkg
|
||||
then
|
||||
echo "PASS"
|
||||
else
|
||||
echo "FAIL"
|
||||
let "FAIL_COUNTER=FAIL_COUNTER+1"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
check_pkg "ibus"
|
||||
check_pkg "ibus-table"
|
||||
check_pkg "ibus-table-chinese"
|
||||
check_pkg "ibus-table-chinese-array"
|
||||
check_pkg "ibus-table-chinese-cangjie"
|
||||
check_pkg "ibus-table-chinese-cantonese"
|
||||
check_pkg "ibus-table-chinese-cantonyale"
|
||||
check_pkg "ibus-table-chinese-easy"
|
||||
check_pkg "ibus-table-chinese-erbi"
|
||||
check_pkg "ibus-table-chinese-quick"
|
||||
check_pkg "ibus-table-chinese-scj"
|
||||
check_pkg "ibus-table-chinese-stroke5"
|
||||
check_pkg "ibus-table-chinese-wu"
|
||||
check_pkg "ibus-table-chinese-wubi-haifeng"
|
||||
check_pkg "ibus-table-chinese-wubi-jidian"
|
||||
check_pkg "ibus-table-chinese-yong"
|
||||
|
||||
echo "starting ibus-daemon."
|
||||
|
||||
ibus-daemon -v -r -d
|
||||
|
||||
if [ $? == 0 ]
|
||||
then
|
||||
echo "PASS"
|
||||
else
|
||||
echo "FAIL"
|
||||
let "FAIL_COUNTER=FAIL_COUNTER+1"
|
||||
fi
|
||||
|
||||
echo "give ibus-daemon some time to start properly."
|
||||
sleep 5
|
||||
|
||||
for name in \
|
||||
array30-big \
|
||||
array30 \
|
||||
cangjie-big \
|
||||
cangjie3 \
|
||||
cangjie5 \
|
||||
cantonese \
|
||||
cantonhk \
|
||||
cantonyale \
|
||||
easy-big \
|
||||
erbi-qs \
|
||||
erbi \
|
||||
jyutping \
|
||||
quick-classic \
|
||||
quick3 \
|
||||
quick5 \
|
||||
scj6 \
|
||||
stroke5 \
|
||||
wu \
|
||||
wubi-haifeng86 \
|
||||
wubi-jidian86 \
|
||||
yong
|
||||
do
|
||||
echo "checking whether ibus can list ${name}:"
|
||||
ibus list-engine --name-only | grep "table:${name}"
|
||||
if [ $? == 0 ]
|
||||
then
|
||||
echo "PASS"
|
||||
else
|
||||
echo "FAIL"
|
||||
let "FAIL_COUNTER=FAIL_COUNTER+1"
|
||||
fi
|
||||
done
|
||||
|
||||
ibus exit
|
||||
|
||||
exit ${FAIL_COUNTER}
|
@ -1,26 +0,0 @@
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: standard-test-basic
|
||||
tags:
|
||||
- classic
|
||||
required_packages:
|
||||
- ibus
|
||||
- ibus-table
|
||||
- ibus-table-chinese
|
||||
- ibus-table-chinese-array
|
||||
- ibus-table-chinese-cangjie
|
||||
- ibus-table-chinese-cantonese
|
||||
- ibus-table-chinese-cantonyale
|
||||
- ibus-table-chinese-easy
|
||||
- ibus-table-chinese-erbi
|
||||
- ibus-table-chinese-quick
|
||||
- ibus-table-chinese-scj
|
||||
- ibus-table-chinese-stroke5
|
||||
- ibus-table-chinese-wu
|
||||
- ibus-table-chinese-wubi-haifeng
|
||||
- ibus-table-chinese-wubi-jidian
|
||||
- ibus-table-chinese-yong
|
||||
tests:
|
||||
- simple:
|
||||
dir: ./scripts
|
||||
run: bash ./run.sh
|
Loading…
Reference in New Issue
Block a user