From ccd8dd4894a6c393cd38e0b64dcd1d880c123ed5 Mon Sep 17 00:00:00 2001 From: Tomas Halman Date: Tue, 5 Oct 2021 15:38:55 +0200 Subject: [PATCH] Adding gating to jq Resolves: rhbz#2010871 --- gating.yaml | 6 ++++++ tests/jqtests.sh | 30 ++++++++++++++++++++++++++++++ tests/tests.yml | 18 ++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 gating.yaml create mode 100755 tests/jqtests.sh create mode 100644 tests/tests.yml diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..648918d --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/jqtests.sh b/tests/jqtests.sh new file mode 100755 index 0000000..da87561 --- /dev/null +++ b/tests/jqtests.sh @@ -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 diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..c729600 --- /dev/null +++ b/tests/tests.yml @@ -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"]