Add CI tests using the standard test interface

This commit is contained in:
sturivny 2018-07-03 12:41:38 +03:00
parent 9db41c0d02
commit eabe634cb0
2 changed files with 138 additions and 0 deletions

78
tests/tests.yml Normal file
View File

@ -0,0 +1,78 @@
---
# Tests for classic and container
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
- container
tests:
- glib-networking-certificate.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/certificate.test
- glib-networking-connection.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/connection.test
- glib-networking-file-database.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/file-database.test
- glib-networking-gnome.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/gnome.test
- glib-networking-libproxy.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/libproxy.test
- glib-networking-pkcs11-array.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/pkcs11-array.test
- glib-networking-pkcs11-pin.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/pkcs11-pin.test
- glib-networking-pkcs11-slot.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/pkcs11-slot.test
- glib-networking-pkcs11-util.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/pkcs11-util.test
required_packages:
- glib-networking-tests # required by upstream-testset
- gnome-desktop-testing # required by upstream-testset
- sudo # required by upstream-testset
# Tests for atomic
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- atomic
tests:
- glib-networking-certificate.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/certificate.test
- glib-networking-connection.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/connection.test
- glib-networking-file-database.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/file-database.test
- glib-networking-gnome.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/gnome.test
- glib-networking-libproxy.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/libproxy.test
- glib-networking-pkcs11-array.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/pkcs11-array.test
- glib-networking-pkcs11-pin.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/pkcs11-pin.test
- glib-networking-pkcs11-slot.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/pkcs11-slot.test
- glib-networking-pkcs11-util.test:
dir: upstream-testset
run: ./runtest.sh glib-networking/pkcs11-util.test
required_packages:
- glib-networking-tests # required by upstream-testset
- gnome-desktop-testing # required by upstream-testset

View File

@ -0,0 +1,60 @@
#!/bin/bash -x
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Description: upstream-testset
# Author: Tomas Pelka <tpelka@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2006 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set -x
ARCH=$(uname -m)
LOG=/tmp/$TEST
T=$1
user=test
#Check if test user exists
grep -e "^$user:" /etc/passwd > /dev/null
if [ $? -ne 0 ]; then
adduser $user
fi
sudo -u $user ginsttest-runner $T 2>&1 >$LOG
rc=$?
RESULT=FAIL
if [ $rc -eq 0 ]; then
RESULT="PASS"
fi
#If test is not installed it won't run, but ginsttest-runner does not exit with error
grep "SUMMARY: total=0;" $LOG
if [ $? -eq 0 ]; then
RESULT="FAIL"
rc=1
fi
echo "Result is: $RESULT"
if which rhts-report-result &> /dev/null; then
rhts-report-result $TEST $RESULT $LOG
fi
exit $rc