From 07e40808066b01c44277d09749193a2cd0812d15 Mon Sep 17 00:00:00 2001 From: Mike FABIAN Date: Thu, 13 May 2021 20:23:13 +0200 Subject: [PATCH] Add CI tests --- tests/scripts/run.sh | 70 ++++++++++++++++++++++++++++++++++++++++++++ tests/tests.yml | 18 ++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 tests/scripts/run.sh create mode 100644 tests/tests.yml diff --git a/tests/scripts/run.sh b/tests/scripts/run.sh new file mode 100644 index 0000000..e96ab56 --- /dev/null +++ b/tests/scripts/run.sh @@ -0,0 +1,70 @@ +#!/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-code" +check_pkg "ibus-table-cyrillic" +check_pkg "ibus-table-latin" +check_pkg "ibus-table-translit" +check_pkg "ibus-table-tv" +check_pkg "ibus-table-mathwriter" + +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 \ + cns11643 \ + emoji-table \ + latex \ + rusle \ + rustrad \ + yawerty \ + compose \ + hu-old-hungarian-rovas \ + ipa-x-sampa \ + translit-ua \ + translit \ + telex \ + thai \ + viqr \ + vni \ + mathwriter-ibus +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 + +exit ${FAIL_COUNTER} diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..3c51928 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,18 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + required_packages: + - ibus + - ibus-table + - ibus-table-code + - ibus-table-cyrillic + - ibus-table-latin + - ibus-table-translit + - ibus-table-tv + - ibus-table-mathwriter + tests: + - simple: + dir: scripts + run: bash run.sh