Add tmt testcase for CI
This commit is contained in:
parent
75f193d808
commit
d0fb46d365
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
5
plans/hyphen.fmf
Normal file
5
plans/hyphen.fmf
Normal file
@ -0,0 +1,5 @@
|
||||
summary: Basic smoke test
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
13
tests/main.fmf
Normal file
13
tests/main.fmf
Normal file
@ -0,0 +1,13 @@
|
||||
test: ./runtests.sh
|
||||
duration: 10m
|
||||
framework: beakerlib
|
||||
require:
|
||||
- hyphen
|
||||
- autoconf
|
||||
- automake
|
||||
- libtool
|
||||
- m4
|
||||
- gcc
|
||||
- sed
|
||||
- make
|
||||
- rpm-build
|
39
tests/runtests.sh
Executable file
39
tests/runtests.sh
Executable file
@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
NAME=hyphen
|
||||
|
||||
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}-${VERSION}"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "set -o pipefail"
|
||||
rlRun "autoreconf -i"
|
||||
rlRun "automake --foreign -Wall"
|
||||
rlRun "./configure && make && make check"
|
||||
rlRun "retval=$?"
|
||||
rlRun "echo $retval"
|
||||
rlRun "popd" 0
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $tmp" 0 "Remove tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalEnd
|
||||
|
@ -1,32 +0,0 @@
|
||||
#!/bin/bash
|
||||
############################################################################
|
||||
#Developed for hyphen
|
||||
#This script is used to check sanity for hyphen package
|
||||
#Usage : ./make_check.sh
|
||||
#
|
||||
############################################################################
|
||||
|
||||
file_count=13
|
||||
pkg="hyphen"
|
||||
|
||||
check_return_value () {
|
||||
if [ $1 != 0 ] ; then
|
||||
exit $1
|
||||
fi
|
||||
}
|
||||
|
||||
check_files_count(){
|
||||
no_of_files=`rpm -qlv $pkg | wc -l`
|
||||
if [ $no_of_files == $file_count ]
|
||||
then
|
||||
echo "PASS"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
}
|
||||
|
||||
cd ../source
|
||||
autoreconf -i
|
||||
automake --foreign -Wall
|
||||
./configure && make && make check
|
||||
check_files_count
|
@ -1,24 +0,0 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
tags:
|
||||
- classic
|
||||
roles:
|
||||
- role: standard-test-source
|
||||
|
||||
- hosts: localhost
|
||||
tags:
|
||||
- classic
|
||||
roles:
|
||||
- role: standard-test-basic
|
||||
tests:
|
||||
- make-check:
|
||||
dir: scripts
|
||||
run: bash ./make_check.sh
|
||||
required_packages:
|
||||
- autoconf
|
||||
- automake
|
||||
- libtool
|
||||
- m4
|
||||
- gcc
|
||||
- sed
|
||||
- make
|
Loading…
Reference in New Issue
Block a user