Skip to content

Commit b11e497

Browse files
Add SAP Configuration Checks to STAF
1 parent 2f657b7 commit b11e497

34 files changed

+9519
-59
lines changed

.ansible-lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ exclude_paths:
44
- .github
55
- src/roles/ha_db_hana/tasks/files/
66
- src/roles/ha_scs/tasks/files/
7+
- src/roles/configuration_checks/tasks/files/
78

89
skip_list:
910
- no-handler

docs/HIGH_AVAILABILITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ TEST_TYPE: "SAPFunctionalTests"
6262
# The type of SAP functional test to be executed. Supported values are:
6363
# - DatabaseHighAvailability
6464
# - CentralServicesHighAvailability
65-
sap_functional_test_type: "DatabaseHighAvailability" # or "CentralServicesHighAvailability"
65+
SAP_FUNCTIONAL_TEST_TYPE: "DatabaseHighAvailability" # or "CentralServicesHighAvailability"
6666

6767
# The name of the SAP system configuration for which you want to execute the test cases.
6868
# It would be the name of the folder under 'WORKSPACE/SYSTEM/' where it could find hosts.yaml, sap-parameters.yaml files of the SAP system configuration

requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ansible-runner
77
azure-identity
88
azure-kusto-data
99
azure-kusto-ingest
10+
azure-mgmt-compute
1011
azure-mgmt-network
1112
azure-storage-blob
1213
azure-storage-queue

requirements.txt

Lines changed: 56 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,34 @@
44
#
55
# pip-compile requirements.in
66
#
7-
ansible-compat==25.8.1
7+
ansible-compat==25.8.2
88
# via ansible-lint
99
ansible-core==2.17.14
1010
# via
1111
# -r requirements.in
1212
# ansible-compat
1313
# ansible-lint
14-
ansible-lint==25.8.2
14+
ansible-lint==25.9.2
1515
# via -r requirements.in
1616
ansible-runner==2.4.1
1717
# via -r requirements.in
18-
astroid==3.3.11
18+
astroid==4.0.1
1919
# via pylint
20-
attrs==25.3.0
20+
attrs==25.4.0
2121
# via
2222
# jsonschema
2323
# referencing
2424
azure-common==1.1.28
2525
# via azure-mgmt-network
26-
azure-core==1.35.0
26+
azure-core==1.35.1
2727
# via
2828
# azure-identity
2929
# azure-kusto-data
3030
# azure-mgmt-core
3131
# azure-storage-blob
3232
# azure-storage-queue
33-
azure-identity==1.24.0
33+
# msrest
34+
azure-identity==1.25.1
3435
# via
3536
# -r requirements.in
3637
# azure-kusto-data
@@ -40,8 +41,12 @@ azure-kusto-data==5.0.5
4041
# azure-kusto-ingest
4142
azure-kusto-ingest==5.0.5
4243
# via -r requirements.in
44+
azure-mgmt-compute==37.0.1
45+
# via -r requirements.in
4346
azure-mgmt-core==1.6.0
44-
# via azure-mgmt-network
47+
# via
48+
# azure-mgmt-compute
49+
# azure-mgmt-network
4550
azure-mgmt-network==29.0.0
4651
# via -r requirements.in
4752
azure-storage-blob==12.23.0
@@ -52,43 +57,50 @@ azure-storage-queue==12.12.0
5257
# via
5358
# -r requirements.in
5459
# azure-kusto-ingest
55-
black==25.1.0
60+
black==25.9.0
5661
# via
5762
# -r requirements.in
5863
# ansible-lint
5964
bracex==2.6
6065
# via wcmatch
61-
certifi==2025.8.3
62-
# via requests
66+
certifi==2025.10.5
67+
# via
68+
# msrest
69+
# requests
6370
cffi==2.0.0
64-
# via cryptography
71+
# via
72+
# ansible-lint
73+
# cryptography
6574
charset-normalizer==3.4.3
6675
# via requests
67-
click==8.2.1
76+
click==8.3.0
6877
# via
6978
# -r requirements.in
7079
# black
71-
coverage[toml]==7.10.6
80+
coverage[toml]==7.10.7
7281
# via
7382
# -r requirements.in
7483
# pytest-cov
75-
cryptography==45.0.7
84+
cryptography==46.0.2
7685
# via
7786
# ansible-core
87+
# ansible-lint
7888
# azure-identity
7989
# azure-storage-blob
8090
# azure-storage-queue
8191
# msal
8292
# pyjwt
8393
dill==0.4.0
8494
# via pylint
95+
distro==1.9.0
96+
# via ansible-lint
8597
exceptiongroup==1.3.0
8698
# via pytest
87-
filelock==3.19.1
99+
filelock==3.20.0
88100
# via ansible-lint
89-
idna==3.10
101+
idna==3.11
90102
# via requests
91-
ijson==3.4.0
103+
ijson==3.4.0.post0
92104
# via azure-kusto-data
93105
importlib-metadata==8.7.0
94106
# via ansible-lint
@@ -99,7 +111,8 @@ isodate==0.7.2
99111
# azure-mgmt-network
100112
# azure-storage-blob
101113
# azure-storage-queue
102-
isort==6.0.1
114+
# msrest
115+
isort==7.0.0
103116
# via pylint
104117
jinja2==3.1.6
105118
# via
@@ -117,25 +130,29 @@ lockfile==0.12.2
117130
# via python-daemon
118131
markdown-it-py==4.0.0
119132
# via rich
120-
markupsafe==3.0.2
133+
markupsafe==3.0.3
121134
# via jinja2
122135
mccabe==0.7.0
123136
# via pylint
124137
mdurl==0.1.2
125138
# via markdown-it-py
126-
msal==1.33.0
139+
msal==1.34.0
127140
# via
128141
# azure-identity
129142
# azure-kusto-data
130143
# msal-extensions
131144
msal-extensions==1.3.1
132145
# via azure-identity
146+
msrest==0.7.1
147+
# via azure-mgmt-compute
133148
mypy-extensions==1.1.0
134149
# via black
135150
numpy==2.2.6
136151
# via
137152
# -r requirements.in
138153
# pandas
154+
oauthlib==3.3.1
155+
# via requests-oauthlib
139156
packaging==25.0
140157
# via
141158
# ansible-compat
@@ -153,7 +170,7 @@ pathspec==0.12.1
153170
# yamllint
154171
pexpect==4.9.0
155172
# via ansible-runner
156-
platformdirs==4.4.0
173+
platformdirs==4.5.0
157174
# via
158175
# black
159176
# pylint
@@ -173,7 +190,7 @@ pyjwt[crypto]==2.10.1
173190
# via
174191
# msal
175192
# pyjwt
176-
pylint==3.3.8
193+
pylint==4.0.0
177194
# via -r requirements.in
178195
pytest==8.4.2
179196
# via
@@ -182,25 +199,27 @@ pytest==8.4.2
182199
# pytest-mock
183200
pytest-cov==7.0.0
184201
# via -r requirements.in
185-
pytest-mock==3.15.0
202+
pytest-mock==3.15.1
186203
# via -r requirements.in
187204
python-daemon==3.1.2
188205
# via ansible-runner
189206
python-dateutil==2.9.0.post0
190207
# via
191208
# azure-kusto-data
192209
# pandas
210+
pytokens==0.1.10
211+
# via black
193212
pytz==2025.2
194213
# via pandas
195-
pyyaml==6.0.2
214+
pyyaml==6.0.3
196215
# via
197216
# -r requirements.in
198217
# ansible-compat
199218
# ansible-core
200219
# ansible-lint
201220
# ansible-runner
202221
# yamllint
203-
referencing==0.36.2
222+
referencing==0.37.0
204223
# via
205224
# ansible-lint
206225
# jsonschema
@@ -211,18 +230,24 @@ requests==2.32.5
211230
# azure-core
212231
# azure-kusto-data
213232
# msal
233+
# msrest
234+
# requests-oauthlib
235+
requests-oauthlib==2.0.0
236+
# via msrest
214237
resolvelib==1.0.1
215238
# via ansible-core
216-
rich==14.1.0
239+
rich==14.2.0
217240
# via -r requirements.in
218241
rpds-py==0.27.1
219242
# via
220243
# jsonschema
221244
# referencing
222245
ruamel-yaml==0.18.15
223246
# via ansible-lint
224-
ruamel-yaml-clib==0.2.12
225-
# via ruamel-yaml
247+
ruamel-yaml-clib==0.2.14
248+
# via
249+
# ansible-lint
250+
# ruamel-yaml
226251
six==1.17.0
227252
# via
228253
# azure-core
@@ -233,7 +258,7 @@ subprocess-tee==0.4.2
233258
# ansible-lint
234259
tenacity==9.1.2
235260
# via azure-kusto-ingest
236-
tomli==2.2.1
261+
tomli==2.3.0
237262
# via
238263
# black
239264
# coverage
@@ -246,10 +271,12 @@ typing-extensions==4.15.0
246271
# astroid
247272
# azure-core
248273
# azure-identity
274+
# azure-mgmt-compute
249275
# azure-mgmt-network
250276
# azure-storage-blob
251277
# azure-storage-queue
252278
# black
279+
# cryptography
253280
# exceptiongroup
254281
# referencing
255282
tzdata==2025.2

scripts/sap_automation_qa.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,18 @@ Options:
9292
-h, --help Show this help message
9393
9494
Examples:
95+
# High Availability Tests
9596
$0 --test_groups=HA_DB_HANA --test_cases=[ha-config,primary-node-crash]
9697
$0 --test_groups=HA_SCS
9798
$0 --test_groups=HA_DB_HANA --test_cases=[ha-config,primary-node-crash] -vv
9899
$0 --test_groups=HA_DB_HANA --test_cases=[ha-config,primary-node-crash] --extra-vars='{"key":"value"}'
99100
$0 --test_groups=HA_DB_HANA --test_cases=[ha-config] --offline
100101
102+
# Configuration Checks (requires SAP_FUNCTIONAL_TEST_TYPE: ConfigurationChecks in vars.yaml)
103+
$0 --extra-vars='{"configuration_test_type":"all"}'
104+
$0 --extra-vars='{"configuration_test_type":"high_availability"}'
105+
$0 --extra-vars='{"configuration_test_type":"Database"}' -vv
106+
101107
Available Test Cases for groups:
102108
$0 --test_groups=HA_DB_HANA
103109
ha-config => High Availability configuration
@@ -126,6 +132,13 @@ Available Test Cases for groups:
126132
manual-restart => Manual Restart
127133
ha-failover-to-node => HA Failover to Secondary Node
128134
135+
Configuration Checks (set SAP_FUNCTIONAL_TEST_TYPE: ConfigurationChecks in vars.yaml):
136+
configuration_test_type options (use with --extra-vars):
137+
all => Run all configuration checks
138+
Database => Database (HANA) configuration checks only
139+
CentralServiceInstances => ASCS/ERS configuration checks only
140+
ApplicationInstances => Application server configuration checks only
141+
129142
Configuration is read from vars.yaml file.
130143
EOF
131144
}
@@ -141,7 +154,7 @@ VARS_FILE="${cmd_dir}/../vars.yaml"
141154
# :return: None. Exits with a non-zero status if validation fails.
142155
validate_params() {
143156
local missing_params=()
144-
local params=("TEST_TYPE" "SYSTEM_CONFIG_NAME" "sap_functional_test_type" "AUTHENTICATION_TYPE")
157+
local params=("TEST_TYPE" "SYSTEM_CONFIG_NAME" "SAP_FUNCTIONAL_TEST_TYPE" "AUTHENTICATION_TYPE")
145158

146159
# Check if vars.yaml exists
147160
if [ ! -f "$VARS_FILE" ]; then
@@ -181,7 +194,7 @@ extract_error_message() {
181194
echo "$extracted_message"
182195
}
183196

184-
# Determine the playbook name based on the sap_functional_test_type.
197+
# Determine the playbook name based on the SAP_FUNCTIONAL_TEST_TYPE.
185198
# :param test_type: The type of SAP functional test.
186199
# :param offline_mode: Whether to use offline mode (optional).
187200
# :return: The name of the playbook.
@@ -204,8 +217,11 @@ get_playbook_name() {
204217
echo "playbook_00_ha_scs_functional_tests"
205218
fi
206219
;;
220+
"ConfigurationChecks")
221+
echo "playbook_00_configuration_checks"
222+
;;
207223
*)
208-
log "ERROR" "Unknown sap_functional_test_type: $test_type"
224+
log "ERROR" "Unknown SAP_FUNCTIONAL_TEST_TYPE: $test_type"
209225
exit 1
210226
;;
211227
esac
@@ -511,7 +527,7 @@ main() {
511527
log "INFO" "Found $cib_files CIB file(s) for offline analysis"
512528
fi
513529

514-
playbook_name=$(get_playbook_name "$sap_functional_test_type" "$OFFLINE_MODE")
530+
playbook_name=$(get_playbook_name "$SAP_FUNCTIONAL_TEST_TYPE" "$OFFLINE_MODE")
515531
log "INFO" "Using playbook: $playbook_name."
516532

517533
run_ansible_playbook "$playbook_name" "$SYSTEM_HOSTS" "$SYSTEM_PARAMS" "$AUTHENTICATION_TYPE" "$SYSTEM_CONFIG_FOLDER"

0 commit comments

Comments
 (0)