From eabe634cb0cf09e6fcad9b4934faa6c3b79c8e52 Mon Sep 17 00:00:00 2001 From: sturivny Date: Jul 03 2018 09:41:38 +0000 Subject: Add CI tests using the standard test interface --- diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..d88bb3f --- /dev/null +++ b/tests/tests.yml @@ -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 diff --git a/tests/upstream-testset/runtest.sh b/tests/upstream-testset/runtest.sh new file mode 100644 index 0000000..766e56e --- /dev/null +++ b/tests/upstream-testset/runtest.sh @@ -0,0 +1,60 @@ +#!/bin/bash -x + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Description: upstream-testset +# Author: Tomas Pelka +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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