From d2726ead06a6a03b0d6a6c26f805338d67f30572 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 27 Jan 2022 12:37:25 +0100 Subject: [PATCH] Resolves: #2047196 (Copy gating tests from RHEL 8) --- .bogofilter.metadata | 1 + gating.yaml | 2 +- tests/builtin-tests.patch | 49 +++++++++++++++++++++++++++++++++++++++ tests/builtin.sh | 16 +++++++++++++ tests/tests.yml | 23 ++++++++++++++++++ 5 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 .bogofilter.metadata create mode 100644 tests/builtin-tests.patch create mode 100755 tests/builtin.sh create mode 100644 tests/tests.yml diff --git a/.bogofilter.metadata b/.bogofilter.metadata new file mode 100644 index 0000000..e7d8dbf --- /dev/null +++ b/.bogofilter.metadata @@ -0,0 +1 @@ +c779c3afb3e57ae0208ee503a854aff716b0cafd bogofilter-1.2.5.tar.xz diff --git a/gating.yaml b/gating.yaml index 4124226..648918d 100644 --- a/gating.yaml +++ b/gating.yaml @@ -3,4 +3,4 @@ product_versions: - rhel-9 decision_context: osci_compose_gate rules: - - !PassingTestCaseRule {test_case_name: desktop-qe.desktop-ci.tier1-gating.functional} + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/builtin-tests.patch b/tests/builtin-tests.patch new file mode 100644 index 0000000..3e31bb2 --- /dev/null +++ b/tests/builtin-tests.patch @@ -0,0 +1,49 @@ +diff -up bogofilter-1.2.4/src/tests/t.bogoutil.orig bogofilter-1.2.4/src/tests/t.bogoutil +--- bogofilter-1.2.4/src/tests/t.bogoutil.orig 2013-06-29 16:52:45.000000000 +0200 ++++ bogofilter-1.2.4/src/tests/t.bogoutil 2020-02-10 11:24:34.754000000 +0100 +@@ -78,7 +78,7 @@ if [ $DB_TYPE = db ] ; then + fi + + #test with wordlist in current directory +-BOGOUTIL="$VAL`pwd`/${relpath}/bogoutil$EXE_EXT" ++#BOGOUTIL="$VAL`pwd`/${relpath}/bogoutil$EXE_EXT" + WORDLIST="wordlist.${DB_EXT}" + OPC=$PRINTCORE + case $srcdir in +diff -up bogofilter-1.2.4/src/tests/t.config.orig bogofilter-1.2.4/src/tests/t.config +--- bogofilter-1.2.4/src/tests/t.config.orig 2020-02-10 11:20:55.340000000 +0100 ++++ bogofilter-1.2.4/src/tests/t.config 2020-02-10 11:21:00.668000000 +0100 +@@ -3,3 +3,4 @@ DB_EXT=".db" + DB_TYPE="db" + USE_TRANSACTIONS="" + USE_UNICODE="" ++USE_PREFIX=/usr/bin +diff -up bogofilter-1.2.4/src/tests/t.frame.orig bogofilter-1.2.4/src/tests/t.frame +--- bogofilter-1.2.4/src/tests/t.frame.orig 2020-02-10 11:20:47.446000000 +0100 ++++ bogofilter-1.2.4/src/tests/t.frame 2020-02-10 11:21:00.671000000 +0100 +@@ -15,7 +15,7 @@ set -e + fi + + : ${srcdir=.} +-: ${relpath=..} ++: ${relpath=} + : ${BF_TESTDIR=.} + + # suck in EXE_EXT and DB_TYPE, export the latter. +@@ -24,11 +24,11 @@ export DB_TYPE + DB_EXT=${DB_EXT#.} + export DB_EXT + +-BOGOFILTER="$VAL${relpath}/bogofilter$EXE_EXT" +-BOGOLEXER="$VAL${relpath}/bogolexer$EXE_EXT" +-BOGOTUNE="$VAL${relpath}/bogotune$EXE_EXT" +-BOGOUTIL="$VAL${relpath}/bogoutil$EXE_EXT" +-BF_COMPACT="${relpath}/bf_compact" ++BOGOFILTER="${USE_PREFIX}/bogofilter$EXE_EXT" ++BOGOLEXER="${USE_PREFIX}/bogolexer$EXE_EXT" ++BOGOTUNE="${USE_PREFIX}/bogotune$EXE_EXT" ++BOGOUTIL="${USE_PREFIX}/bogoutil$EXE_EXT" ++BF_COMPACT="${USE_PREFIX}/bf_compact" + + export BOGOFILTER + export BOGOLEXER diff --git a/tests/builtin.sh b/tests/builtin.sh new file mode 100755 index 0000000..ac8e8f5 --- /dev/null +++ b/tests/builtin.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# without this, when OpenShift has LC_CTYPE=C.UTF-8, some tests fail +export LC_CTYPE='' + +cd source/ && \ +./configure --disable-rpath --prefix=/tmp/bogofilter && \ +make && \ +cd src/tests/ && \ +make check && \ +cd ../../ && \ +patch -p1 <../builtin-tests.patch && \ +cd src/ && \ +rm ./bogo*.o ./bf*.o bogofilter bogolexer bogotune bogoupgrade bogoutil && \ +cd tests/ && \ +make check-TESTS diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..dff9b2d --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,23 @@ +- hosts: localhost + roles: + - role: standard-test-source + tags: + - always + + - role: standard-test-basic + tags: + - atomic + - classic + required_packages: + - bogofilter + - flex + - gcc + - gsl-devel + - libdb-devel + - make + - perl-generators + - xmlto + tests: + - builtin: + dir: . + run: ./builtin.sh