Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
7adcc61
Refactor HAClusterValidator classes for improved structure and functi…
devanshjainms Jun 30, 2025
96c9cbe
Enhance sap_automation_qa.sh with offline mode support and additional…
devanshjainms Jun 30, 2025
fc2acef
Refactor HA configuration tasks to remove redundant os_version variab…
devanshjainms Jun 30, 2025
fb7eabe
Disable all HA functional tests in input-api.yaml for validation purp…
devanshjainms Jul 1, 2025
354cab9
Enable Azure Load Balancer Validation in input-api.yaml
devanshjainms Jul 1, 2025
d639c3d
Refactor sap_automation_qa.sh and setup.sh for improved structure and…
devanshjainms Jul 1, 2025
ebf7012
Refactor tests for get_pcmk_properties_scs module
devanshjainms Jul 1, 2025
76963e4
Enable all HA functional tests in input-api.yaml for validation purposes
devanshjainms Jul 1, 2025
152e403
Update dependencies in requirements.txt for compatibility and improve…
devanshjainms Jul 1, 2025
93411bf
Update task names to clarify report generation for test group logs in…
devanshjainms Jul 1, 2025
921e8c0
Refactor HA configuration validation for offline mode; update playboo…
devanshjainms Jul 2, 2025
025f521
Fix newline issue at the end of ha-config-offline.yml for HA configur…
devanshjainms Jul 2, 2025
b1b7100
Enhance documentation and scripts for SAP High Availability and Offli…
devanshjainms Jul 2, 2025
5611be6
Fix pip upgrade command and ensure successful installation of Python …
devanshjainms Jul 2, 2025
c962675
Fix pip installation command in setup script and enhance error handli…
devanshjainms Jul 2, 2025
a65d21f
Update package mapping for RHEL to use 'ansible-core' instead of 'ans…
devanshjainms Jul 2, 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
40 changes: 25 additions & 15 deletions docs/HIGH_AVAILABILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@ pcs cluster enable --all # for RedHat virtual machine

The SAP Testing Automation Framework requires a jumpbox or management server with the following setup:

- **Operating System**: Ubuntu 22.04 LTS.
- **Operating System**: Supported (Ubuntu 22.04 LTS, SLES 15 SP4, 15 SP6).
- **Location**: Must be deployed on Azure.

> [!NOTE]
> Currently, only Ubuntu 22.04 LTS is supported for running the SAP Testing Automation Framework.

### Azure RBAC

Expand Down Expand Up @@ -91,13 +88,29 @@ The management server must have network connectivity to the SAP system to perfor

### 1. Environment Setup

To set up your enviroment in management server, follow these steps:
To set up your environment in management server, follow these steps:

1.1. **Login to the Ubuntu management server**:
1.1. **Login to the management server**:

Ensure you are logged into the Ubuntu management server that is connected to the SAP system's virtual network.
Ensure you are logged into the management server that is connected to the SAP system's virtual network.

1.2. **Fork and clone the repository**:
1.2. **Install git on management server**:

```bash
# Debian/Ubuntu
sudo su -
apt-get install git

# RHEL/CentOS
sudo su -
yum install git

# SUSE
sudo su -
zypper install git
```

1.3. **Fork and clone the repository**:

```bash
# sudo to root
Expand All @@ -111,7 +124,7 @@ git clone https://github.com/GITHUB-USERNAME/sap-automation-qa.git
cd sap-automation-qa
```

1.3. **Run the initial setup script**:
1.4. **Run the initial setup script**:

```bash
./scripts/setup.sh
Expand Down Expand Up @@ -316,14 +329,11 @@ To execute the script, run following command:
# Run specific test cases from HA_DB_HANA group
./scripts/sap_automation_qa.sh --test_groups=HA_DB_HANA --test_cases=[ha-config,primary-node-crash]

# Run all enabled tests in HA_DB_HANA group
./scripts/sap_automation_qa.sh --test_groups=HA_DB_HANA

# Run all enabled tests in HA_SCS group
./scripts/sap_automation_qa.sh --test_groups=HA_SCS
# Run specific test cases from HA_SCS group
./scripts/sap_automation_qa.sh --test_groups=HA_SCS --test_cases=[ha-config]

# Run with verbose output
./scripts/sap_automation_qa.sh --test_groups=HA_DB_HANA --test_cases=[ha-config] -vv
./scripts/sap_automation_qa.sh --test_groups=HA_DB_HANA --test_cases=[primary-node-crash] -vvv
```

### 4. Viewing Test Results
Expand Down
88 changes: 88 additions & 0 deletions docs/OFFLINE_VALIDATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# SAP Automation QA - Offline Validation

## Overview

The offline validation feature enables robust validation of SAP HANA and SAP Central Services High Availability cluster configurations without requiring live cluster access or without connecting to the SAP virtual machines. This capability allows you to analyze cluster configurations from previously collected CIB (Cluster Information Base) XML files, making it ideal for post-incident analysis, compliance auditing, and troubleshooting scenarios.
Offline validation provides a powerful capability for maintaining and auditing SAP HANA cluster configurations without impacting production systems.

## How Offline Validation Works

### Architecture Overview

```
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ CIB XML │ │ Validation │ │ HTML Report │
│ Output │───▶│ Engine │───▶│ Generation │
│ (In files) │ │ │ │ (with Tables) │
│ │ │ │ │ │
└─────────────────┘ └──────────────────┘ └─────────────────┘
```


### Prerequisites

- SAP Testing Automation Framework (STAF) setup on a management server. Detailed setup instructions can be found in the [STAF Setup Guide](./HIGH_AVAILABILITY.md).
- Previously collected CIB XML files stored in the `WORKSPACES/SYSTEM/<SYSTEM_CONFIG_NAME>/offline_validation/` directory.

### Required Files Structure
```file
WORKSPACES/SYSTEM/<SYSTEM_CONFIG_NAME>/
├── hosts.yaml # Ansible inventory
├── sap-parameters.yaml # SAP system parameters
└── offline_validation/ # Output of commands for offline validation
├── <hostname1>/
│ └── cib # CIB XML file for node 1
└── <hostname2>/
└── cib # CIB XML file for node 2
```

## How to Perform Offline Validation

### Step 1: Initial Setup

This setup is defined in the Getting Started section of the [High Availability Guide](./HIGH_AVAILABILITY.md). Ensure you have the following:

- Ansible inventory file (`hosts.yaml`) with the SAP system configuration.
- SAP system parameters file (`sap-parameters.yaml`).
- Updated vars.yaml file with the necessary parameters.

### Step 2: Collect CIB XML Files and copy to management server

#### 2.1 Collect CIB XML Files

Before performing offline validation, you need to collect High Availability cluster configuration files (CIB XML files) from the SAP system nodes. This can be done by executing the following command on each node:

```bash
cibadmin --query | tee cib
```

This command will create a file named `cib` in the current directory, which contains the cluster configuration in XML format.

#### 2.2 Create the Required Directory Structure

Copy these files to the management server under the `WORKSPACES/SYSTEM/<SYSTEM_CONFIG_NAME>/offline_validation/` directory, maintaining the structure as shown above. Ensure the directory structure is created as follows:

```bash
mkdir -p WORKSPACES/SYSTEM/<SYSTEM_CONFIG_NAME>/offline_validation/<hostname>/
```

Place the `cib` file in the respective `<hostname>/` directory.

### Step 3: Run Offline Validation

Execute the sap_automation_qa script for offline validation with the `--offline` flag. The target OS family is a requirement parameter (`target_os_family`) and must be specified using the `--extra-vars` option.

```bash
./scripts/sap_automation_qa.sh --offline --extra-vars='target_os_family=SUSE'
# or
./scripts/sap_automation_qa.sh --offline --extra-vars='target_os_family=RHEL'
```

Enable verbose logging for troubleshooting:
```bash
./scripts/sap_automation_qa.sh --extra-vars='target_os_family=<os_family>' --offline -vvv
```

### Step 4: View Results

The validation results will be available in `WORKSPACES/SYSTEM/<SYSTEM_CONFIG_NAME>/quality_assurance/` directory. Open the HTML file in a web browser to view the detailed parameter validation table with PASSED/INFO/FAILED statuses.
30 changes: 16 additions & 14 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
#
# pip-compile requirements.in
#
ansible-compat==25.5.0
ansible-compat==25.6.0
# via ansible-lint
ansible-core==2.17.12
# via
# -r requirements.in
# ansible-compat
# ansible-lint
ansible-lint==25.5.0
ansible-lint==25.6.1
# via -r requirements.in
ansible-runner==2.4.1
# via -r requirements.in
Expand All @@ -34,11 +34,11 @@ azure-identity==1.23.0
# via
# -r requirements.in
# azure-kusto-data
azure-kusto-data==5.0.3
azure-kusto-data==5.0.4
# via
# -r requirements.in
# azure-kusto-ingest
azure-kusto-ingest==5.0.3
azure-kusto-ingest==5.0.4
# via -r requirements.in
azure-mgmt-core==1.5.0
# via azure-mgmt-network
Expand All @@ -56,9 +56,9 @@ black==25.1.0
# via
# -r requirements.in
# ansible-lint
bracex==2.5.post1
bracex==2.6
# via wcmatch
certifi==2025.4.26
certifi==2025.6.15
# via requests
cffi==1.17.1
# via cryptography
Expand All @@ -68,7 +68,7 @@ click==8.2.1
# via
# -r requirements.in
# black
coverage[toml]==7.9.0
coverage[toml]==7.9.1
# via
# -r requirements.in
# pytest-cov
Expand Down Expand Up @@ -158,12 +158,14 @@ platformdirs==4.3.8
# black
# pylint
pluggy==1.6.0
# via pytest
# via
# pytest
# pytest-cov
ptyprocess==0.7.0
# via pexpect
pycparser==2.22
# via cffi
pygments==2.19.1
pygments==2.19.2
# via
# pytest
# rich
Expand All @@ -173,12 +175,12 @@ pyjwt[crypto]==2.10.1
# pyjwt
pylint==3.3.7
# via -r requirements.in
pytest==8.4.0
pytest==8.4.1
# via
# -r requirements.in
# pytest-cov
# pytest-mock
pytest-cov==6.2.0
pytest-cov==6.2.1
# via -r requirements.in
pytest-mock==3.14.1
# via -r requirements.in
Expand Down Expand Up @@ -213,7 +215,7 @@ resolvelib==1.0.1
# via ansible-core
rich==14.0.0
# via -r requirements.in
rpds-py==0.25.1
rpds-py==0.26.0
# via
# jsonschema
# referencing
Expand Down Expand Up @@ -253,9 +255,9 @@ typing-extensions==4.14.0
# rich
tzdata==2025.2
# via pandas
urllib3==2.4.0
urllib3==2.5.0
# via requests
wcmatch==10.0
wcmatch==10.1
# via ansible-lint
yamllint==1.37.1
# via ansible-lint
Expand Down
Loading
Loading