Adding gating to jq

Resolves: rhbz#2010871
This commit is contained in:
Tomas Halman 2021-10-05 15:38:55 +02:00
parent 0663542d14
commit ccd8dd4894
3 changed files with 54 additions and 0 deletions

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

30
tests/jqtests.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
die () {
echo "$1" >&2
exit 1
}
# link jq binary. This make the tests to use
# installed binary instead of compiled one
cd source || die "missing source directory"
rm -f jq tests/*.log 2>/dev/null
ln -s /usr/bin/jq || die "failed to link jq binary"
# run the tests
# List of tests is taken from Makefile, skipping "mantest"
TESTS="tests/optionaltest tests/jqtest tests/onigtest tests/shtest tests/utf8test tests/base64test"
for t in $TESTS; do
echo -n "Test $t ... "
./${t} >"${t}.log" 2>&1
RET=$?
if [ $RET = 0 ]; then
echo "ok"
else
echo "failed"
cat "${t}.log"
die "Test ${t} failed"
fi
done
exit 0

18
tests/tests.yml Normal file
View File

@ -0,0 +1,18 @@
---
- hosts: localhost
roles:
- role: standard-test-source
tags:
- always
- role: standard-test-basic
tags:
- classic
required_packages:
- jq
- valgrind
tests:
- jqtests:
dir: .
run: ./jqtests.sh
save-files: ["source/tests/*.log"]