From 46b2ea256ef2bd711a6c373b055618574da38525 Mon Sep 17 00:00:00 2001 From: Oyvind Albrigtsen Date: Mon, 14 Jun 2021 09:45:46 +0200 Subject: [PATCH] - Add CI gating tests Resolves: rhbz#1960247 --- .gitignore | 2 ++ gating.yaml | 6 ++++++ resource-agents-sap-hana.spec | 7 ++++++- tests/run_tests.sh | 16 ++++++++++++++++ tests/tests.yml | 14 ++++++++++++++ 5 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 gating.yaml create mode 100755 tests/run_tests.sh create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore index 2a441e4..4e9d322 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ /*.src.rpm /.build-*.log /*/ +!/tests/ +/tests/*.retry 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/resource-agents-sap-hana.spec b/resource-agents-sap-hana.spec index bb00dff..ebda1b2 100644 --- a/resource-agents-sap-hana.spec +++ b/resource-agents-sap-hana.spec @@ -49,7 +49,7 @@ Name: resource-agents-sap-hana Summary: SAP HANA cluster resource agents Epoch: 1 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+ URL: https://github.com/SUSE/SAPHanaSR Source0: %{upstream_prefix}-%{upstream_version}.tar.gz @@ -188,6 +188,11 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents %exclude /usr/src %changelog +* Mon Jun 14 2021 Oyvind Albrigtsen - 0.155.0-2 +- Add CI gating tests + + Resolves: rhbz#1960247 + * Mon Jun 7 2021 Oyvind Albrigtsen - 0.155.0-1 - Rebase to SAPHanaSR 0.155.0 upstream release. diff --git a/tests/run_tests.sh b/tests/run_tests.sh new file mode 100755 index 0000000..ae56ff2 --- /dev/null +++ b/tests/run_tests.sh @@ -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 diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..1393400 --- /dev/null +++ b/tests/tests.yml @@ -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