- Add CI gating tests

Resolves: rhbz#1960247
This commit is contained in:
Oyvind Albrigtsen 2021-06-14 09:45:46 +02:00
parent c928cd9e8a
commit 46b2ea256e
5 changed files with 44 additions and 1 deletions

2
.gitignore vendored
View File

@ -2,3 +2,5 @@
/*.src.rpm /*.src.rpm
/.build-*.log /.build-*.log
/*/ /*/
!/tests/
/tests/*.retry

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}

View File

@ -49,7 +49,7 @@ Name: resource-agents-sap-hana
Summary: SAP HANA cluster resource agents Summary: SAP HANA cluster resource agents
Epoch: 1 Epoch: 1
Version: 0.155.0 Version: 0.155.0
Release: 1%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} Release: 2%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
License: GPLv2+ License: GPLv2+
URL: https://github.com/SUSE/SAPHanaSR URL: https://github.com/SUSE/SAPHanaSR
Source0: %{upstream_prefix}-%{upstream_version}.tar.gz Source0: %{upstream_prefix}-%{upstream_version}.tar.gz
@ -188,6 +188,11 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents
%exclude /usr/src %exclude /usr/src
%changelog %changelog
* Mon Jun 14 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.155.0-2
- Add CI gating tests
Resolves: rhbz#1960247
* Mon Jun 7 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.155.0-1 * Mon Jun 7 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.155.0-1
- Rebase to SAPHanaSR 0.155.0 upstream release. - Rebase to SAPHanaSR 0.155.0 upstream release.

16
tests/run_tests.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
err=0
agents=$(pcs resource list ocf:heartbeat 2>&1)
if [ $(echo "$agents" | wc -l) -lt 2 ]; then
echo "ERROR: pcs: agents available:\n$agents"
err=$((err+1))
else
echo "INFO: pcs: agents available..."
fi
if [ $err -ge 1 ]; then
echo -e "\nERROR: $err tests FAILED..."
exit 1
fi

14
tests/tests.yml Normal file
View File

@ -0,0 +1,14 @@
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
- container
required_packages:
- resource-agents-sap-hana
- pcs
tests:
- subpackage_tests:
dir: .
run: ./run_tests.sh