Add gating tests

This commit is contained in:
Jakub Martisko 2022-02-07 15:46:53 +01:00 committed by Stepan Oksanichenko
parent e29c76823f
commit 1f383000c9
7 changed files with 73 additions and 1 deletions

1
.zstd.metadata Normal file
View File

@ -0,0 +1 @@
e6a51ef3f7d5be5b74ac74d88bf3850057e00adb zstd-1.5.1.tar.gz

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}

21
tests/gating/all.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
passed=0
subtests=(./compress ./decompress)
total=${#subtests[@]}
for subtest in ${subtests[@]}
do
pushd $subtest >/dev/null
./test.sh
result=$?
echo "Test $subtest result: $result"
if [ "$result" == "0" ]
then
((passed++))
fi
popd >/dev/null
done
echo "Passed $passed/$total tests"
[[ $total == $passed ]] || exit 1

10
tests/gating/compress/test.sh Executable file
View File

@ -0,0 +1,10 @@
rm -rf ./in ./out
echo "Hello world" > ./in
zstd ./in -o ./out || exit 1
ls ./out || exit 1
rm -rf ./in ./out
exit 0

15
tests/gating/decompress/test.sh Executable file
View File

@ -0,0 +1,15 @@
rm -rf in out exp
echo "Hello World" > in
echo "Hello World" > exp
zstd ./in -o ./out
rm in
zstd -d ./out -o ./in
diff ./in ./exp || exit 1
rm -rf in out exp
exit 0

15
tests/tests.yml Normal file
View File

@ -0,0 +1,15 @@
---
- hosts: localhost
vars:
- artifacts: ./artifacts
remote_user: root
roles:
- role: standard-test-basic
tags:
- atomic
- classic
- container
tests:
- simple:
dir: gating
run: ./all.sh

View File

@ -34,7 +34,7 @@
Name: zstd
Version: 1.5.1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Zstd compression library
License: BSD and GPLv2
@ -163,6 +163,10 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1
%ldconfig_scriptlets -n lib%{name}
%changelog
* Mon Feb 07 2022 Jakub Martisko <jamartis@redhat.com> - 1.5.1-2
- Add some basic gating tests
Resolves: rhbz#2050272
* Wed Jan 12 2022 Michel Alexandre Salim <salimma@centosproject.org> - 1.5.1-1
- Rebase to the latest upstream version
- Enable optional gz, xz/lzma, and lz4 support in the zstd tool