Skip to content

Commit

Permalink
Merge pull request #270 from fmherschel/angi-devel
Browse files Browse the repository at this point in the history
Angi devel
  • Loading branch information
fmherschel authored Dec 2, 2024
2 parents 5b833ac + c059aeb commit 4b9cfe0
Show file tree
Hide file tree
Showing 269 changed files with 7,646 additions and 2,178 deletions.
3 changes: 2 additions & 1 deletion SAPHanaSR-tester.spec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ License: GPL-2.0
Group: Productivity/Clustering/HA
AutoReqProv: on
Summary: Test suite for SAPHanaSR clusters
Version: 1.2.14
Version: 1.3.5
Release: 0
Url: https://www.suse.com/c/fail-safe-operation-of-sap-hana-suse-extends-its-high-availability-solution/

Expand Down Expand Up @@ -109,6 +109,7 @@ install -m 0444 man-tester-client/*.7.gz %{buildroot}%{_mandir}/man7
/usr/lib/%{name}/saphana_sr_*.py
/usr/bin/SAPHanaSR-testCluster
/usr/bin/SAPHanaSR-checkJson
/usr/bin/SAPHanaSR-testSelect
/usr/bin/sct_*
/usr/bin/callTest*
/usr/bin/loopTests*
Expand Down
15 changes: 7 additions & 8 deletions alert/SAPHanaSR-alert-fencing
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash
#
# SAPHanaSR-alert
# SAPHanaSR-alert-fencing
# Author: Lars Pinne Fabian Herschel, June 2024
# Support: [email protected]
# License: GNU General Public License (GPL)
# Copyright: (c) 2024 SUSE LLC
# Version: 2024-06-18-15:33
# Version: 2024-08-09-14:35
#
# crm configure alert nodes-1 "/usr/bin/SAPHanaSR-alert" select nodes
# crm configure alert fencing-1 "/usr/bin/SAPHanaSR-alert" select fencing attributes alert_uptime_threshold=300
# crm configure alert nodes-1 "/usr/bin/SAPHanaSR-alert-fencing" select nodes
# crm configure alert fencing-1 "/usr/bin/SAPHanaSR-alert-fencing" select fencing attributes alert_uptime_threshold=300
#

logger_tag="SAPHanaSR-alert-fencing"
Expand All @@ -20,13 +20,12 @@ crm_alert_kind="${CRM_alert_kind:-manual call}"
crm_alert_node="${CRM_alert_node:-$HOSTNAME}"
crm_alert_desc="${CRM_alert_desc:-no description provided}"

$logger -t "$logger_tag" "AH: begin event '$crm_alert_kind'"
cache_file="/run/crm/SAPHanaSR_site_cache"

alert_uptime_threshold="${alert_uptime_threshold:-300}"

IFS=. read -r sys_uptime REST </proc/uptime
/usr/bin/logger -t "$logger_tag" "AH: begin event '$crm_alert_kind' (uptime=$sys_uptime, alert_uptime_threshold=$alert_uptime_threshold)"
$logger -t "$logger_tag" "AH: begin event '$crm_alert_kind' (uptime=$sys_uptime, alert_uptime_threshold=$alert_uptime_threshold)"


function process_fencing()
Expand All @@ -43,9 +42,9 @@ function process_fencing()
if [[ "$local_site_name" != "" && "$fenced_site_name" == "$local_site_name" ]]; then
$logger -t "$logger_tag" "DEC: FENCE ($fenced_site_name == $local_site_name)"
sleep 10
/usr/sbin/crm --force node fence "${HOSTNAME}"; rc="$?"
sudo /usr/sbin/crm --force node fence "${HOSTNAME}"; rc="$?"
if [[ "$rc" != "0" ]]; then
$logger -t "$logger_tag" "ACT: /usr/sbin/crm --force node fence ${HOSTNAME}; rc=$rc"
$logger -t "$logger_tag" "ACT: sudo /usr/sbin/crm --force node fence ${HOSTNAME}; rc=$rc"
fi
else
$logger -t "$logger_tag" "DEC: NO FENCE ($fenced_site_name != $local_site_name)"
Expand Down
2 changes: 1 addition & 1 deletion crm_cfg/angi-ScaleUp/010_basics_crm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ property cib-bootstrap-options: \
cluster-name=SAP@@SID@@_@@INO@@ \
stonith-enabled=true \
stonith-action=reboot \
stonith-timeout=90 \
stonith-timeout=150 \
priority-fencing-delay=30
rsc_defaults rsc-options: \
migration-threshold=5000 \
Expand Down
17 changes: 17 additions & 0 deletions crm_cfg/angi-ScaleUp/050_clone_con_fence_crm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# promotable clone (5)
#
primitive rsc_SAPHanaCon_@@SID@@_HDB@@INO@@ ocf:suse:SAPHanaController \
op start interval=0 timeout=3600 \
op stop interval=0 timeout=3600 \
op promote interval=0 timeout=900 \
op monitor interval=60 role=Promoted timeout=700 \
op monitor interval=61 role=Unpromoted timeout=700 \
params SID=@@SID@@ InstanceNumber=@@INO@@ PREFER_SITE_TAKEOVER=yes DUPLICATE_PRIMARY_TIMEOUT=600 AUTOMATED_REGISTER=yes ON_FAIL_ACTION=fence\
meta priority=100
#
clone mst_SAPHanaCon_@@SID@@_HDB@@INO@@ rsc_SAPHanaCon_@@SID@@_HDB@@INO@@ \
meta clone-max=2 clone-node-max=1 interleave=true promotable=true maintenance=true
#
####################################################################
#
96 changes: 96 additions & 0 deletions man-tester/SAPHanaSR-checkJson.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
.\" Version: 1.2.4
.\"
.TH SAPHanaSR-checkJson 8 "26 Nov 2024" "" "SAPHanaSR-angi"
.\" TODO SAPHanaSR-testJson ?
.\"
.SH NAME
SAPHanaSR-checkJson \- Check syntax of SAPHanaSR-tester JSON file.
.PP
.\"
.SH SYNOPSIS
.PP
\fBSAPHanaSR-checkJson\fR [ --help | --version ]
.br
\fBSAPHanaSR-checkJson\fR --file \fIFILE\fR [ --quiet ]
.PP
.\"
.SH DESCRIPTION
.PP
SAPHanaSR-checkJson is a tool for checking SAPHanaSR-tester JSON files for
formally correct syntax.
.PP
.\"
.SH OPTIONS
.TP
--help
print help message and exit.
.TP
--file \fIFILE\fP
specify the JSON file to check.
.TP
--quiet
do not output JSON data on success.
.TP
--version
print version and exit.
.PP
.\"
.SH RETURN CODES
.PP
.B 0
Successful program execution.
.br
.B >0
Usage, syntax or execution errors.
.PP
.\"
.PP
.\"
.SH EXAMPLES
.PP
\fB*\fP Check one of the predefined files.
.PP
.RS 2
# SAPHanaSR-checkJson --file /usr/share/SAPHanaSR-tester/json/angi-ScaleUp/maintenance_cluster_hana_running.json
.RE
.PP
.\"
.SH FILES
.TP
/usr/bin/SAPHanaSR-checkJson
the program itself.
.PP
.\"
.SH REQUIREMENTS
.PP
See REQUIREMENTS section in SAPHanaSR-tester(7) and SAPHanaSR-tests-syntax(5).
.PP
.\"
.SH BUGS
.PP
In case of any problem, please use your favourite SAP support process to open
a request for the component BC-OP-LNX-SUSE.
Please report any other feedback and suggestions to [email protected].
.PP
.\"
.SH SEE ALSO
.PP
\fBSAPHanaSR-tester\fP(7) , \fBSAPHanaSR-tests-syntax\fP(5) ,
\fBSAPHanaSR-tests-classic-ScaleUp\fP(7) ,
\fBSAPHanaSR-tests-angi-ScaleUp\fP(7) , \fBSAPHanaSR-tests-angi-ScaleOut\fP(7)
.PP
.\"
.SH AUTHORS
.PP
F.Herschel, L.Pinne.
.PP
.\"
.SH COPYRIGHT
.PP
(c) 2023-2024 SUSE LLC
.br
The package SAPHanaSR-tester comes with ABSOLUTELY NO WARRANTY.
.br
For details see the GNU General Public License at
http://www.gnu.org/licenses/gpl.html
.\"
37 changes: 22 additions & 15 deletions man-tester/SAPHanaSR-testCluster.8
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.\" Version: 1.001
.\" Version: 1.2.4
.\"
.TH SAPHanaSR-testCluster 8 "03 Apr 2024" "" "SAPHanaSR-angi"
.TH SAPHanaSR-testCluster 8 "24 Nov 2024" "" "SAPHanaSR-angi"
.\"
.SH NAME
SAPHanaSR-testCluster \- Run functional tests for SAPHanaSR clusters.
.PP
.\"
.SH SYNOPSIS
.\"
.PP
\fBSAPHanaSR-testCluster\fR [ --help | --version ]
.br
\fBSAPHanaSR-testCluster\fR \fIOPTION\fR [ \fIOPTION\fR ... ]
.PP
.\"
.SH DESCRIPTION
.\"
.PP
SAPHanaSR-testCluster is a tool to run one of the predefined test cases on a
given test cluster. For that purpose it is called with options specifying the
test case and the properties of the cluster to be tested.
Expand All @@ -23,7 +23,6 @@ and test automation frameworks.
.PP
.\"
.SH OPTIONS
.\"
.TP
--help
print help message and exit.
Expand All @@ -40,6 +39,9 @@ print and log debug messages.
--logFile \fIFILE\fP
path to log file.
.TP
--password \fIPASSWORD\fP
remote root user´s password (for debugging only).
.TP
--printTestProperties
print test properties and exit.
.TP
Expand All @@ -60,10 +62,10 @@ path to testcase description file.
.TP
--version
print version and exit.

.PP
.\"
.SH RETURN CODES
.PP
.B 0
Successful program execution.
.br
Expand All @@ -72,7 +74,6 @@ Usage, syntax or execution errors.
.PP
.\"
.SH EXAMPLES
.\"
.PP
\fB*\fR Running a very basic functional test.
.PP
Expand Down Expand Up @@ -118,7 +119,6 @@ Test ID is 8585, logfile is test.log, debug output is omitted.
.PP
.\"
.SH FILES
.\"
.TP
/usr/bin/SAPHanaSR-testCluster
the program itself.
Expand All @@ -127,10 +127,10 @@ the program itself.
functional tests for SAPHanaSR-angi scale-up scenarios.
.TP
/usr/share/SAPHanaSR-tester/json/angi-ScaleOut/
functional tests for SAPHanaSR-angi scale-out ERP scenarios, without HANA host auto-autofailover.
functional tests for SAPHanaSR-angi scale-out ERP scenarios, without HANA host auto-failover.
.TP
/usr/share/SAPHanaSR-tester/json/angi-ScaleOut-BW/
functional tests for SAPHanaSR-angi scale-out BW scenarios, with HANA host auto-autofailover. Not yet implemented.
functional tests for SAPHanaSR-angi scale-out BW scenarios, with HANA host auto-failover. Not yet implemented.
.TP
/usr/share/SAPHanaSR-tester/json/classic-ScaleUp/
functional tests for SAPHanaSR classic scale-up scenarios.
Expand All @@ -144,36 +144,43 @@ not yet implemented.
$PWD/.test_properties
auto-generated properties file for called shell scripts. No need to touch.
.TP
/usr/bin/
TODO
/usr/bin/SAPHanaSR-showAttr
script SAPHanaSR-showAttr from SAPHanaSR-angi.
.TP
/usr/bin/sct_test_*
shell scripts for un-easy tasks on the cluster nodes.
.PP
.\"
.SH REQUIREMENTS
.\"
.PP
See the REQUIREMENTS section in SAPHanaSR-tester(7) and SAPHanaSR-angi(7).
Of course, HANA database and Linux cluster have certain requirements.
Please refer to the product documentation.
.PP
.\"
.SH BUGS
.PP
In case of any problem, please use your favourite SAP support process to open
a request for the component BC-OP-LNX-SUSE.
Please report any other feedback and suggestions to [email protected].
.PP
.\"
.SH SEE ALSO
.PP
\fBSAPHanaSR-tester\fP(7) , \fBSAPHanaSR-tests-syntax\fP(5) ,
\fBSAPHanaSR-tests-description\fP(7) ,
\fBSAPHanaSR-tests-description\fP(7) , \fBSAPHanaSR-tests-classic-ScaleUp\fP(7) ,
\fBSAPHanaSR-tests-angi-ScaleUp\fP(7) , \fBSAPHanaSR-tests-angi-ScaleOut\fP(7) ,
\fBSAPHanaSR-angi\fP(7) , \fBSAPHanaSR-showAttr\fP(8) ,
\fBcrm_mon\fP(8) , \fBcrm\fP(8) , \fBcs_clusterstate\fP(8)
\fBcrm_mon\fP(8) , \fBcrm\fP(8) , \fBcs_clusterstate\fP(8) , \fBcs_show_cluster_actions\fP(8) ,
.PP
.\"
.SH AUTHORS
.PP
F.Herschel, L.Pinne.
.PP
.\"
.SH COPYRIGHT
.PP
(c) 2023-2024 SUSE LLC
.br
The package SAPHanaSR-tester comes with ABSOLUTELY NO WARRANTY.
Expand Down
Loading

0 comments on commit 4b9cfe0

Please sign in to comment.