diff --git a/.gitignore b/.gitignore index e69de29..4e9d322 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,6 @@ +/*.tar.gz +/*.src.rpm +/.build-*.log +/*/ +!/tests/ +/tests/*.retry 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/sap-cluster-connector.spec b/sap-cluster-connector.spec new file mode 100644 index 0000000..eea6210 --- /dev/null +++ b/sap-cluster-connector.spec @@ -0,0 +1,80 @@ +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. +# + +# Below is the script used to generate a new source file +# from the sap_cluster_connector upstream git repo. +# +# TAG=$(git log --pretty="format:%h" -n 1) +# distdir="sap_cluster_connector-${TAG}" +# TARFILE="${distdir}.tar.gz" +# rm -rf $TARFILE $distdir +# git archive --prefix=$distdir/ HEAD | gzip > $TARFILE +# + +%global sap_script_prefix sap_cluster_connector +%global sap_script_hash 42d6ce2 + +Name: sap-cluster-connector +Summary: SAP cluster connector script +Version: 3.0.1 +Release: 8%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +License: GPLv2+ +URL: https://github.com/fdanapfel/sap_cluster_connector +%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} +Group: System Environment/Base +%else +Group: Productivity/Clustering/HA +%endif +Source0: %{sap_script_prefix}-%{sap_script_hash}.tar.gz + +BuildArch: noarch + +BuildRequires: perl-generators + +Requires: resource-agents-sap >= 4.8.0 +Requires: perl-interpreter + +%description +The SAP connector script interface with Pacemaker to allow SAP +instances to be managed in a cluster environment. + +%prep +%setup -q -n %{sap_script_prefix}-%{sap_script_hash} + +%build + +%install +rm -rf %{buildroot} +test -d %{buildroot}/%{_bindir} || mkdir -p %{buildroot}/%{_bindir} +mkdir -p %{buildroot}/%{_datadir}/sap_cluster_connector +mkdir -p %{buildroot}/%{_mandir}/man8 +cp redhat/sap_cluster_connector %{buildroot}/%{_bindir} +cp -rv redhat/{run_checks,checks} %{buildroot}/%{_datadir}/sap_cluster_connector +gzip redhat/man/*.8 +cp redhat/man/*.8.gz %{buildroot}/%{_mandir}/man8 + +%files +%defattr(-,root,root) +%{_bindir}/sap_cluster_connector +%{_mandir}/man8/sap_cluster_connector* +%{_datadir}/sap_cluster_connector + +%changelog +* Tue Jul 02 2024 Janine Fuchs - 3.0.1-8 +- Add package to RHEL 10. + + Resolves: RHEL-40576 + +- Changed perl dependency to perl-interpreter. + + Resolves: RHEL-45726 + +# vim:set ai ts=4 sw=4 sts=4 et: diff --git a/sources b/sources new file mode 100644 index 0000000..bc56580 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (sap_cluster_connector-42d6ce2.tar.gz) = aed98615d4e4b679eead842ac4cac4d3ce155f33f24e0470067e06706fd916efc8d0546a8af93783b6de568e05bc32230b1fc0ab4991ef1b4a1cf9e624989767 diff --git a/tests/run_tests.sh b/tests/run_tests.sh new file mode 100755 index 0000000..26456d2 --- /dev/null +++ b/tests/run_tests.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +err=0 + +for bin in "sap_cluster_connector help"; 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..599794d --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,13 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + - container + required_packages: + - sap-cluster-connector + + tests: + - subpackage_tests: + dir: . + run: ./run_tests.sh