Resolves: #2047196 (Copy gating tests from RHEL 8)

This commit is contained in:
Milan Crha 2022-01-27 12:37:25 +01:00 committed by Stepan Oksanichenko
parent fbdf44c6c4
commit d2726ead06
5 changed files with 90 additions and 1 deletions

1
.bogofilter.metadata Normal file
View File

@ -0,0 +1 @@
c779c3afb3e57ae0208ee503a854aff716b0cafd bogofilter-1.2.5.tar.xz

View File

@ -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}

49
tests/builtin-tests.patch Normal file
View File

@ -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

16
tests/builtin.sh Executable file
View File

@ -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

23
tests/tests.yml Normal file
View File

@ -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