Add tmt testcase for CI
This commit is contained in:
parent
7a51916e3b
commit
4a46401831
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
|||||||
|
1
|
5
plans/iso-codes.fmf
Normal file
5
plans/iso-codes.fmf
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
summary: Basic smoke test
|
||||||
|
discover:
|
||||||
|
how: fmf
|
||||||
|
execute:
|
||||||
|
how: tmt
|
7
tests/main.fmf
Normal file
7
tests/main.fmf
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
test: ./runtests.sh
|
||||||
|
duration: 10m
|
||||||
|
framework: beakerlib
|
||||||
|
require:
|
||||||
|
- iso-codes
|
||||||
|
- python3-jsonschema
|
||||||
|
- rpm-build
|
2
tests/smoke/runtest.sh → tests/run_test.sh
Normal file → Executable file
2
tests/smoke/runtest.sh → tests/run_test.sh
Normal file → Executable file
@ -3,8 +3,6 @@
|
|||||||
# If one of the commands below returns non-zero then exit immediately
|
# If one of the commands below returns non-zero then exit immediately
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
cd ../source
|
|
||||||
|
|
||||||
echo "Let's check the upstream data files timestamp"
|
echo "Let's check the upstream data files timestamp"
|
||||||
ls data/iso*.json -l
|
ls data/iso*.json -l
|
||||||
echo "Validating json data files written with correct syntax"
|
echo "Validating json data files written with correct syntax"
|
41
tests/runtests.sh
Executable file
41
tests/runtests.sh
Executable file
@ -0,0 +1,41 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||||
|
|
||||||
|
NAME=iso-codes
|
||||||
|
|
||||||
|
rlJournalStart
|
||||||
|
rlPhaseStartSetup
|
||||||
|
rlAssertRpm ${NAME}
|
||||||
|
rlShowPackageVersion ${NAME}
|
||||||
|
rlRun -t -l "VERSION=$(rpm -q ${NAME} --queryformat='%{version}')" 0 "Get VERSION"
|
||||||
|
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
|
||||||
|
rlRun "pushd $tmp"
|
||||||
|
rlFetchSrcForInstalled "${NAME}"
|
||||||
|
rlRun "rpm --define '_topdir $tmp' -i *src.rpm"
|
||||||
|
rlRun -t -l "mkdir BUILD" 0 "Creating BUILD directory"
|
||||||
|
rlRun -t -l "rpmbuild --noclean --nodeps --define '_topdir $tmp' -bp $tmp/SPECS/*spec"
|
||||||
|
if [ -d BUILD/${NAME}-${VERSION}-build ]; then
|
||||||
|
rlRun -t -l "pushd BUILD/${NAME}-${VERSION}-build/${NAME}-${VERSION}"
|
||||||
|
else
|
||||||
|
rlRun -t -l "pushd BUILD/${NAME}-v${VERSION}"
|
||||||
|
fi
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest
|
||||||
|
rlRun "set -o pipefail"
|
||||||
|
rlRun "ls data/iso*.json -l"
|
||||||
|
rlRun "python3 bin/validate_json_data.py"
|
||||||
|
rlRun "retval=$?"
|
||||||
|
rlRun "echo Test return value is $retval"
|
||||||
|
rlRun "ls data/iso*.json -l"
|
||||||
|
rlRun "retval2=$?"
|
||||||
|
rlRun "echo $retval2"
|
||||||
|
rlRun "popd" 0
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartCleanup
|
||||||
|
rlRun "popd"
|
||||||
|
rlRun "rm -r $tmp" 0 "Remove tmp directory"
|
||||||
|
rlPhaseEnd
|
||||||
|
rlJournalEnd
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
|
||||||
tags:
|
|
||||||
- classic
|
|
||||||
roles:
|
|
||||||
- role: standard-test-source
|
|
||||||
|
|
||||||
- hosts: localhost
|
|
||||||
tags:
|
|
||||||
- classic
|
|
||||||
roles:
|
|
||||||
- role: standard-test-basic
|
|
||||||
tests:
|
|
||||||
- smoke
|
|
||||||
required_packages:
|
|
||||||
- python3-jsonschema
|
|
Loading…
Reference in New Issue
Block a user