Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
a5b18a2
Add unit tests for ConfigurationCheckModule
devanshjainms Oct 21, 2025
cf52097
Enhance HAClusterValidator to support multiple DR provider configurat…
devanshjainms Oct 21, 2025
1c4e82b
Fix parameter logging in HAClusterValidator and update global INI con…
devanshjainms Oct 21, 2025
28174e8
Refactor conditionals in configuration checks and update Azure Load B…
devanshjainms Oct 22, 2025
a96cd4e
Enhance configuration checks to support IBM DB2 alongside SAP HANA, u…
devanshjainms Oct 22, 2025
025b38e
Standardize DB2 naming across configuration files to ensure consisten…
devanshjainms Oct 22, 2025
c6c46e1
Standardize naming for DB2 to Db2 across configuration files for cons…
devanshjainms Oct 22, 2025
de7b627
Enhance Azure Load Balancer module to handle various IP address forma…
devanshjainms Oct 22, 2025
53e2e11
Refactor user parameter handling in CommandCollector and update DB2 u…
devanshjainms Oct 22, 2025
2e871f8
Add min_list validation for kernel parameters and update related tests
devanshjainms Oct 22, 2025
5aaa577
Improve validation logic in ConfigurationCheckModule to handle intege…
devanshjainms Oct 22, 2025
6ab09fa
Update DB2 user handling and command execution in db2.yml; include db…
devanshjainms Oct 22, 2025
468f84f
Enhance min_list validation in ConfigurationCheckModule to handle exc…
devanshjainms Oct 22, 2025
9ba6b87
Update documentation and improve configuration check reporting; enhan…
devanshjainms Oct 22, 2025
495116e
Refactor test cases in get_azure_lb_test.py to streamline frontend_ip…
devanshjainms Oct 23, 2025
9c1e470
Refactor AzureLoadBalancer to simplify private IP address retrieval; …
devanshjainms Oct 23, 2025
e1f159a
Add Azure login instructions to CONFIGURATION_CHECKS.md; update secti…
devanshjainms Oct 23, 2025
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
14 changes: 8 additions & 6 deletions docs/CONFIGURATION_CHECKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ Configuration validation serves as a critical quality gate in the SAP deployment
- Storage account redundancy settings
- Disk caching policies

**SAP HANA Configuration**
- Memory allocation
- System replication parameters
**SAP Database Configuration**
- SAP HANA: Memory allocation, system replication parameters
- IBM DB2: Hardware requirements, system language, OS tuning parameters

**Pacemaker Cluster**
**Pacemaker Cluster (HANA only)**
- Resource agent versions and parameters
- Fencing (STONITH) configuration
- Resource constraints and colocation rules
- Cluster communication settings

**SAP HA Resources**
**SAP HA Resources (HANA only)**
- Virtual hostname configuration
- File system mount options
- Service startup ordering
Expand All @@ -56,6 +56,8 @@ Update the `TEST_TYPE` parameter in [`vars.yaml`](./../vars.yaml) file to `Confi

Follow the steps (2.1 - 2.2) in [Setup Guide for SAP Testing Automation Framework](./SETUP.MD#2-system-configuration) to configure your system details.

> **Note**: High Availability (HA) configuration checks and functional tests are currently supported only for SAP HANA databases. For IBM DB2 databases, only non-HA configuration checks are available.


### 3. Test Execution

Expand All @@ -71,7 +73,7 @@ To execute the script, run following command:
# Run checks with verbose logging
./scripts/sap_automation_qa.sh -vv

# Run only Database (HANA) configuration checks
# Run only Database configuration checks (supports both HANA and DB2)
./scripts/sap_automation_qa.sh --extra-vars='{"configuration_test_type":"Database"}'

# Run only ASCS/ERS configuration checks
Expand Down
2 changes: 1 addition & 1 deletion src/modules/configuration_check_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ def run(self):
context["hostname"] = custom_hostname

self.set_context(context)
if self.context.get("check_type", {}).get("file_name") == "hana":
if self.context.get("check_type", {}).get("file_name") in ["hana", "db2"]:
temp_context = FileSystemCollector(parent=self).collect(
check=None, context=self.context
)
Expand Down
77 changes: 38 additions & 39 deletions src/modules/get_pcmk_properties_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,45 +273,44 @@ def _parse_global_ini_parameters(self):
) as file:
global_ini_content = file.read().splitlines()

section_start = (
global_ini_content.index("[ha_dr_provider_sushanasr]")
if self.saphanasr_provider == HanaSRProvider.ANGI
else global_ini_content.index("[ha_dr_provider_SAPHanaSR]")
)
properties_slice = global_ini_content[section_start + 1 : section_start + 4]

global_ini_properties = {
key.strip(): val.strip()
for line in properties_slice
for key, sep, val in [line.partition("=")]
if sep
}

for param_name, expected_config in global_ini_defaults.items():
value = global_ini_properties.get(param_name, "")
if isinstance(expected_config, dict):
expected_value = expected_config.get("value")
is_required = expected_config.get("required", False)
else:
expected_value = expected_config
is_required = False

self.log(
logging.INFO,
f"param_name: {param_name}, value: {value}, expected_value: {expected_config}",
)
parameters.append(
self._create_parameter(
category="global_ini",
name=param_name,
value=value,
expected_value=(
expected_config.get("value")
if isinstance(expected_config, dict)
else expected_value
),
)
)
for section_name, section_properties in global_ini_defaults.items():
try:
section_start = global_ini_content.index(f"[{section_name}]")
next_section_start = len(global_ini_content)
for i in range(section_start + 1, len(global_ini_content)):
if global_ini_content[i].strip().startswith("["):
next_section_start = i
break

properties_slice = global_ini_content[section_start + 1 : next_section_start]

global_ini_properties = {
key.strip(): val.strip()
for line in properties_slice
for key, sep, val in [line.partition("=")]
if sep and key.strip()
}

for param_name, expected_config in section_properties.items():
value = global_ini_properties.get(param_name, "")
expected_value = expected_config.get("value", "")

self.log(
logging.INFO,
f"param_name: {param_name}, value: {value}, "
+ f"expected_value: {expected_value}",
)
parameters.append(
self._create_parameter(
category="global_ini",
id=section_name,
name=param_name,
value=value,
expected_value=expected_value,
)
)
except ValueError:
self.log(logging.WARNING, f"Section {section_name} not found in global.ini")
except Exception as ex:
self.log(logging.ERROR, f"Error parsing global.ini: {str(ex)}")

Expand Down
54 changes: 46 additions & 8 deletions src/playbook_00_configuration_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
loop_control:
loop_var: check_type

- name: "Run role-specific checks for DB hosts"
- name: "Run role-specific checks for HANA DB hosts"
ansible.builtin.include_tasks:
file: "./roles/configuration_checks/tasks/main.yml"
vars:
Expand All @@ -117,32 +117,58 @@
results_var: "db_hana_results"
when: >-
role == 'DB' and
(platform | default('HANA') | upper == 'HANA') and
(configuration_test_type == 'all' or
configuration_test_type == 'Database')

- name: "Debug DB checks execution"
- name: "Debug HANA checks execution"
ansible.builtin.debug:
msg: "Executing Database (HANA) checks on host {{ inventory_hostname }}"
when: >-
role == 'DB' and
(platform | default('HANA') | upper == 'HANA') and
(configuration_test_type == 'all' or
configuration_test_type == 'Database')

- name: "Run HA configuration checks for DB hosts"
- name: "Run role-specific checks for Db2 DB hosts"
ansible.builtin.include_tasks:
file: "./roles/configuration_checks/tasks/main.yml"
vars:
check_type:
name: "Database HA Configuration"
file_name: "high_availability"
checks_var: "db_ha_config_checks"
results_var: "db_ha_config_results"
name: "Database (Db2) Checks"
file_name: "db2"
checks_var: "db_db2_checks"
results_var: "db_db2_results"
when: >-
role == 'DB' and
database_high_availability | default(false) | bool and
(platform | default('HANA') | upper == 'Db2') and
(configuration_test_type == 'all' or
configuration_test_type == 'Database')

- name: "Debug Db2 checks execution"
ansible.builtin.debug:
msg: "Executing Database (Db2) checks on host {{ inventory_hostname }}"
when: >-
role == 'DB' and
(platform | default('HANA') | upper == 'DB2') and
(configuration_test_type == 'all' or
configuration_test_type == 'Database')

- name: "Run HA configuration checks for HANA DB hosts"
ansible.builtin.include_tasks:
file: "./roles/configuration_checks/tasks/main.yml"
vars:
check_type:
name: "Database HA Configuration"
file_name: "high_availability"
checks_var: "db_ha_config_checks"
results_var: "db_ha_config_results"
when:
- role == 'DB'
- (platform | default('HANA') | upper == 'HANA')
- database_high_availability | default(false) | bool
- (configuration_test_type == 'all' or configuration_test_type == 'Database')

- name: "Run role-specific checks for ASCS/SCS hosts"
ansible.builtin.include_tasks:
file: "./roles/configuration_checks/tasks/main.yml"
Expand Down Expand Up @@ -298,6 +324,18 @@
loop: "{{ groups[sap_sid | upper + '_DB']|default([]) }}"
when: hostvars[item].db_hana_results is defined

- name: "Collect DB (Db2) check results"
ansible.builtin.set_fact:
all_results: "{{ all_results + hostvars[item].db_db2_results
| default([]) }}"
execution_metadata: "{{ execution_metadata + [
{'host': item,
'check_type': 'db_db2',
'metadata': hostvars[item].db_db2_results_metadata
| default({})}] }}"
loop: "{{ groups[sap_sid | upper + '_DB']|default([]) }}"
when: hostvars[item].db_db2_results is defined

- name: "Collect DB HA configuration check results"
ansible.builtin.set_fact:
all_results: "{{ all_results + hostvars[item].db_ha_config_results
Expand Down
Loading