diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/basic.fmf b/plans/basic.fmf new file mode 100644 index 0000000..574bc78 --- /dev/null +++ b/plans/basic.fmf @@ -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 diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..13bcca5 --- /dev/null +++ b/tests/main.fmf @@ -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 diff --git a/tests/runtest.sh b/tests/runtest.sh new file mode 100755 index 0000000..cbd5b29 --- /dev/null +++ b/tests/runtest.sh @@ -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 'table:${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 diff --git a/tests/scripts/run.sh b/tests/scripts/run.sh deleted file mode 100644 index ea22956..0000000 --- a/tests/scripts/run.sh +++ /dev/null @@ -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} diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 3696912..0000000 --- a/tests/tests.yml +++ /dev/null @@ -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