From 5a9b0dd1e39e4af00d668c2a8bd0bf4a662fc4f2 Mon Sep 17 00:00:00 2001 From: Oyvind Albrigtsen Date: Wed, 12 Jun 2024 13:27:39 +0200 Subject: [PATCH] - Add CI gating tests --- gating.yaml | 6 ++++++ resource-agents.spec | 4 ++-- tests/run_tests.sh | 26 ++++++++++++++++++++++++++ tests/tests.yml | 15 +++++++++++++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 gating.yaml create mode 100755 tests/run_tests.sh create mode 100644 tests/tests.yml diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..4ca9235 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-10 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/resource-agents.spec b/resource-agents.spec index 6842f70..4cdd57c 100644 --- a/resource-agents.spec +++ b/resource-agents.spec @@ -45,7 +45,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.13.0 -Release: 3%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 4%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} License: GPL-2.0-or-later AND LGPL-2.1-or-later URL: https://github.com/ClusterLabs/resource-agents Source0: %{upstream_prefix}-%{upstream_version}.tar.gz @@ -514,7 +514,7 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents %{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm %changelog -* Wed Jun 12 2024 Oyvind Albrigtsen - 4.13.0-3 +* Wed Jun 12 2024 Oyvind Albrigtsen - 4.13.0-4 - cloud agents: set support library path - pgsqlms: add to -paf subpackage diff --git a/tests/run_tests.sh b/tests/run_tests.sh new file mode 100755 index 0000000..9c731bb --- /dev/null +++ b/tests/run_tests.sh @@ -0,0 +1,26 @@ +#!/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 + +for bin in "/usr/lib/fence-agents/support/aliyun/aliyun-cli/aliyun version"; do + output="$($bin 2>&1)" + if [ $? -ne 0 ]; then + echo -e "ERROR: $bin failed:\n$output" + err=$((err+1)) + else + echo "INFO: $bin works..." + fi +done + +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..2a95d4a --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,15 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + - container + required_packages: + - resource-agents-cloud + - resource-agents-paf + - pcs + + tests: + - subpackage_tests: + dir: . + run: ./run_tests.sh