Resolves: rhbz#1978168 Convert CI tests to tmt and add gating.yaml

This commit is contained in:
Mike FABIAN 2021-07-01 10:23:19 +02:00
parent 012c735689
commit f1038a8388
7 changed files with 50 additions and 42 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

5
plans/basic.fmf Normal file
View File

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

6
tests/main.fmf Normal file
View File

@ -0,0 +1,6 @@
test: ./runtest.sh
framework: beakerlib
duration: 10m
require:
- langtable
- python3-langtable

32
tests/runtest.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PYTHON3_SITELIB=$(/usr/bin/python3 -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
rlJournalStart
rlPhaseStartSetup
rlAssertRpm langtable
rlAssertRpm python3-langtable
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
rlRun "pushd $tmp"
rlPhaseEnd
rlPhaseStartTest
for i in keyboards languages territories timezoneidparts timezones
do
rlRun "xmllint --noout --relaxng \
${PYTHON3_SITELIB}/langtable/schemas/${i}.rng \
${PYTHON3_SITELIB}/langtable/data/${i}.xml.gz \
" 0 "testing ${i}.xml"
done
rlRun "/usr/bin/python3 /usr/share/doc/langtable/test_cases.py" \
0 "Running test cases"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlPhaseEnd
rlJournalEnd

View File

@ -1,33 +0,0 @@
#!/bin/bash
check_return_value () {
if [ $1 != 0 ] ; then
exit $1
fi
}
PYTHON3_SITELIB=$(/usr/bin/python3 -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
xmllint --noout --relaxng \
${PYTHON3_SITELIB}/langtable/schemas/keyboards.rng \
${PYTHON3_SITELIB}/langtable/data/keyboards.xml.gz
check_return_value $?
xmllint --noout --relaxng \
${PYTHON3_SITELIB}/langtable/schemas/languages.rng \
${PYTHON3_SITELIB}/langtable/data/languages.xml.gz
check_return_value $?
xmllint --noout --relaxng \
${PYTHON3_SITELIB}/langtable/schemas/territories.rng \
${PYTHON3_SITELIB}/langtable/data/territories.xml.gz
check_return_value $?
xmllint --noout --relaxng \
${PYTHON3_SITELIB}/langtable/schemas/timezoneidparts.rng \
${PYTHON3_SITELIB}/langtable/data/timezoneidparts.xml.gz
check_return_value $?
xmllint --noout --relaxng \
${PYTHON3_SITELIB}/langtable/schemas/timezones.rng \
${PYTHON3_SITELIB}/langtable/data/timezones.xml.gz
check_return_value $?
/usr/bin/python3 /usr/share/doc/langtable/test_cases.py
check_return_value $?

View File

@ -1,9 +0,0 @@
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
tests:
- simple:
dir: scripts/
run: ./run_tests.sh