Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exclude_paths:
- .github
- src/roles/ha_db_hana/tasks/files/
- src/roles/ha_scs/tasks/files/
- src/roles/configuration_checks/tasks/files/

skip_list:
- no-handler
Expand Down
2 changes: 1 addition & 1 deletion docs/HIGH_AVAILABILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ TEST_TYPE: "SAPFunctionalTests"
# The type of SAP functional test to be executed. Supported values are:
# - DatabaseHighAvailability
# - CentralServicesHighAvailability
sap_functional_test_type: "DatabaseHighAvailability" # or "CentralServicesHighAvailability"
SAP_FUNCTIONAL_TEST_TYPE: "DatabaseHighAvailability" # or "CentralServicesHighAvailability"

# The name of the SAP system configuration for which you want to execute the test cases.
# 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
Expand Down
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ansible-runner
azure-identity
azure-kusto-data
azure-kusto-ingest
azure-mgmt-compute
azure-mgmt-network
azure-storage-blob
azure-storage-queue
Expand Down
85 changes: 56 additions & 29 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,34 @@
#
# pip-compile requirements.in
#
ansible-compat==25.8.1
ansible-compat==25.8.2
# via ansible-lint
ansible-core==2.17.14
# via
# -r requirements.in
# ansible-compat
# ansible-lint
ansible-lint==25.8.2
ansible-lint==25.9.2
# via -r requirements.in
ansible-runner==2.4.1
# via -r requirements.in
astroid==3.3.11
astroid==4.0.1
# via pylint
attrs==25.3.0
attrs==25.4.0
# via
# jsonschema
# referencing
azure-common==1.1.28
# via azure-mgmt-network
azure-core==1.35.0
azure-core==1.35.1
# via
# azure-identity
# azure-kusto-data
# azure-mgmt-core
# azure-storage-blob
# azure-storage-queue
azure-identity==1.24.0
# msrest
azure-identity==1.25.1
# via
# -r requirements.in
# azure-kusto-data
Expand All @@ -40,8 +41,12 @@ azure-kusto-data==5.0.5
# azure-kusto-ingest
azure-kusto-ingest==5.0.5
# via -r requirements.in
azure-mgmt-compute==37.0.1
# via -r requirements.in
azure-mgmt-core==1.6.0
# via azure-mgmt-network
# via
# azure-mgmt-compute
# azure-mgmt-network
azure-mgmt-network==29.0.0
# via -r requirements.in
azure-storage-blob==12.23.0
Expand All @@ -52,43 +57,50 @@ azure-storage-queue==12.12.0
# via
# -r requirements.in
# azure-kusto-ingest
black==25.1.0
black==25.9.0
# via
# -r requirements.in
# ansible-lint
bracex==2.6
# via wcmatch
certifi==2025.8.3
# via requests
certifi==2025.10.5
# via
# msrest
# requests
cffi==2.0.0
# via cryptography
# via
# ansible-lint
# cryptography
charset-normalizer==3.4.3
# via requests
click==8.2.1
click==8.3.0
# via
# -r requirements.in
# black
coverage[toml]==7.10.6
coverage[toml]==7.10.7
# via
# -r requirements.in
# pytest-cov
cryptography==45.0.7
cryptography==46.0.2
# via
# ansible-core
# ansible-lint
# azure-identity
# azure-storage-blob
# azure-storage-queue
# msal
# pyjwt
dill==0.4.0
# via pylint
distro==1.9.0
# via ansible-lint
exceptiongroup==1.3.0
# via pytest
filelock==3.19.1
filelock==3.20.0
# via ansible-lint
idna==3.10
idna==3.11
# via requests
ijson==3.4.0
ijson==3.4.0.post0
# via azure-kusto-data
importlib-metadata==8.7.0
# via ansible-lint
Expand All @@ -99,7 +111,8 @@ isodate==0.7.2
# azure-mgmt-network
# azure-storage-blob
# azure-storage-queue
isort==6.0.1
# msrest
isort==7.0.0
# via pylint
jinja2==3.1.6
# via
Expand All @@ -117,25 +130,29 @@ lockfile==0.12.2
# via python-daemon
markdown-it-py==4.0.0
# via rich
markupsafe==3.0.2
markupsafe==3.0.3
# via jinja2
mccabe==0.7.0
# via pylint
mdurl==0.1.2
# via markdown-it-py
msal==1.33.0
msal==1.34.0
# via
# azure-identity
# azure-kusto-data
# msal-extensions
msal-extensions==1.3.1
# via azure-identity
msrest==0.7.1
# via azure-mgmt-compute
mypy-extensions==1.1.0
# via black
numpy==2.2.6
# via
# -r requirements.in
# pandas
oauthlib==3.3.1
# via requests-oauthlib
packaging==25.0
# via
# ansible-compat
Expand All @@ -153,7 +170,7 @@ pathspec==0.12.1
# yamllint
pexpect==4.9.0
# via ansible-runner
platformdirs==4.4.0
platformdirs==4.5.0
# via
# black
# pylint
Expand All @@ -173,7 +190,7 @@ pyjwt[crypto]==2.10.1
# via
# msal
# pyjwt
pylint==3.3.8
pylint==4.0.0
# via -r requirements.in
pytest==8.4.2
# via
Expand All @@ -182,25 +199,27 @@ pytest==8.4.2
# pytest-mock
pytest-cov==7.0.0
# via -r requirements.in
pytest-mock==3.15.0
pytest-mock==3.15.1
# via -r requirements.in
python-daemon==3.1.2
# via ansible-runner
python-dateutil==2.9.0.post0
# via
# azure-kusto-data
# pandas
pytokens==0.1.10
# via black
pytz==2025.2
# via pandas
pyyaml==6.0.2
pyyaml==6.0.3
# via
# -r requirements.in
# ansible-compat
# ansible-core
# ansible-lint
# ansible-runner
# yamllint
referencing==0.36.2
referencing==0.37.0
# via
# ansible-lint
# jsonschema
Expand All @@ -211,18 +230,24 @@ requests==2.32.5
# azure-core
# azure-kusto-data
# msal
# msrest
# requests-oauthlib
requests-oauthlib==2.0.0
# via msrest
resolvelib==1.0.1
# via ansible-core
rich==14.1.0
rich==14.2.0
# via -r requirements.in
rpds-py==0.27.1
# via
# jsonschema
# referencing
ruamel-yaml==0.18.15
# via ansible-lint
ruamel-yaml-clib==0.2.12
# via ruamel-yaml
ruamel-yaml-clib==0.2.14
# via
# ansible-lint
# ruamel-yaml
six==1.17.0
# via
# azure-core
Expand All @@ -233,7 +258,7 @@ subprocess-tee==0.4.2
# ansible-lint
tenacity==9.1.2
# via azure-kusto-ingest
tomli==2.2.1
tomli==2.3.0
# via
# black
# coverage
Expand All @@ -246,10 +271,12 @@ typing-extensions==4.15.0
# astroid
# azure-core
# azure-identity
# azure-mgmt-compute
# azure-mgmt-network
# azure-storage-blob
# azure-storage-queue
# black
# cryptography
# exceptiongroup
# referencing
tzdata==2025.2
Expand Down
24 changes: 20 additions & 4 deletions scripts/sap_automation_qa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,18 @@ Options:
-h, --help Show this help message

Examples:
# High Availability Tests
$0 --test_groups=HA_DB_HANA --test_cases=[ha-config,primary-node-crash]
$0 --test_groups=HA_SCS
$0 --test_groups=HA_DB_HANA --test_cases=[ha-config,primary-node-crash] -vv
$0 --test_groups=HA_DB_HANA --test_cases=[ha-config,primary-node-crash] --extra-vars='{"key":"value"}'
$0 --test_groups=HA_DB_HANA --test_cases=[ha-config] --offline

# Configuration Checks (requires SAP_FUNCTIONAL_TEST_TYPE: ConfigurationChecks in vars.yaml)
$0 --extra-vars='{"configuration_test_type":"all"}'
$0 --extra-vars='{"configuration_test_type":"high_availability"}'
$0 --extra-vars='{"configuration_test_type":"Database"}' -vv

Available Test Cases for groups:
$0 --test_groups=HA_DB_HANA
ha-config => High Availability configuration
Expand Down Expand Up @@ -126,6 +132,13 @@ Available Test Cases for groups:
manual-restart => Manual Restart
ha-failover-to-node => HA Failover to Secondary Node

Configuration Checks (set SAP_FUNCTIONAL_TEST_TYPE: ConfigurationChecks in vars.yaml):
configuration_test_type options (use with --extra-vars):
all => Run all configuration checks
Database => Database (HANA) configuration checks only
CentralServiceInstances => ASCS/ERS configuration checks only
ApplicationInstances => Application server configuration checks only

Configuration is read from vars.yaml file.
EOF
}
Expand All @@ -141,7 +154,7 @@ VARS_FILE="${cmd_dir}/../vars.yaml"
# :return: None. Exits with a non-zero status if validation fails.
validate_params() {
local missing_params=()
local params=("TEST_TYPE" "SYSTEM_CONFIG_NAME" "sap_functional_test_type" "AUTHENTICATION_TYPE")
local params=("TEST_TYPE" "SYSTEM_CONFIG_NAME" "SAP_FUNCTIONAL_TEST_TYPE" "AUTHENTICATION_TYPE")

# Check if vars.yaml exists
if [ ! -f "$VARS_FILE" ]; then
Expand Down Expand Up @@ -181,7 +194,7 @@ extract_error_message() {
echo "$extracted_message"
}

# Determine the playbook name based on the sap_functional_test_type.
# Determine the playbook name based on the SAP_FUNCTIONAL_TEST_TYPE.
# :param test_type: The type of SAP functional test.
# :param offline_mode: Whether to use offline mode (optional).
# :return: The name of the playbook.
Expand All @@ -204,8 +217,11 @@ get_playbook_name() {
echo "playbook_00_ha_scs_functional_tests"
fi
;;
"ConfigurationChecks")
echo "playbook_00_configuration_checks"
;;
*)
log "ERROR" "Unknown sap_functional_test_type: $test_type"
log "ERROR" "Unknown SAP_FUNCTIONAL_TEST_TYPE: $test_type"
exit 1
;;
esac
Expand Down Expand Up @@ -511,7 +527,7 @@ main() {
log "INFO" "Found $cib_files CIB file(s) for offline analysis"
fi

playbook_name=$(get_playbook_name "$sap_functional_test_type" "$OFFLINE_MODE")
playbook_name=$(get_playbook_name "$SAP_FUNCTIONAL_TEST_TYPE" "$OFFLINE_MODE")
log "INFO" "Using playbook: $playbook_name."

run_ansible_playbook "$playbook_name" "$SYSTEM_HOSTS" "$SYSTEM_PARAMS" "$AUTHENTICATION_TYPE" "$SYSTEM_CONFIG_FOLDER"
Expand Down
Loading
Loading