Package with common methods and default values for tests on SLES for SAP Applications.

This package inherits from opensusebasetest and should be used as a class.


$self->SAPINIT_RE(qr/some regexp/);
$self->SYSTEMD_RE(qr/some regexp/);

Set or get a regular expressions to test on the /usr/sap/sapservices file whether the SAP workload was started via sapinit or systemd.


$self->SYSTEMCTL_UNITS_RE(qr/some regexp/);

Set or get a regular expression to test in the output of systemctl --list-unit-files whether the SAP workload was started via systemd units.


Derived from 'ensure_serialdev_permissions' function available in 'utils'.

Grant user permission to access serial port immediately as well as persisting over reboots. Used to ensure that testapi calls like script_run work for the test user as well as root.


$self->fix_path( $uri );

Given the path to a CIFS or NFS share in $uri, this method will format the path so it can be used directly by mount(8). Returns an array with the protocol name (cifs or nfs) as the first element, and the formatted path as the second element. Croaks if an unsupported protocol is passed in $uri or if it cannot be parsed.


$self->set_ps_cmd( $procname );

Sets in the class instance the ps command to be used to check for the presence of SAP processes in the SUT. Returns the value of the internal variable $ps_cmd.


$self->set_sap_info( $SID, $instance_number );

SAP software relies on 2 identifiers, the system id (SID) which is a 3-character identifier, and the instance number. This method receives both via positional arguments, and sets the internal variables for $sid, $instance and $sapadmin accordingly. It also sets accessors that depend on $sid and $instance as well as the product type. Returns the value of $sapadmin.



Switch user in SUT to the SAP admin account, and grant serialdev permissions to the SAP admin user.



Exit from the SAP admin account in SUT and change serialdev permissions accordingly.



Returns the total memory configured in SUT.



Checks if the saptune package is installed in SUT. Returns true or false.


$self->prepare_profile( $profile );

Configures with saptune (if available in SUT) or sapconf the SUT according to a profile passed as argument. $profile must be either HANA or NETWEAVER. Croaks on failure.


$self->mount_media( $proto, $path, $target );

Mount installation media in SUT from the share identified by $proto and $path into the target directory $target.



Adds the IP address and the hostname of SUT to /etc/hosts. Croaks on failure.



Checks in SUT that the SAP admin user has no limits in the number of processes and threads that it can create.



Runs a script in SUT to create as many processes as possible, both as the SAP administrator and as root, and verifies that the SAP admin can create as many as 99% of the amount of processes that root can. Croaks if any of the commands sent to SUT fail, and record a soft failure if the SAP admin user cannot create as many processes as root.



Runs a sapcontrol command with function GetVersionInfo in SUT. Croaks on failure.



Runs a sapcontrol command with function GetInstanceProperties and verifies that the reported properties match with the SID stored in the class instance. Croaks on failure.



Tests with sapcontrol and functions Stop and StopService that the instance and services are succesfully stopped. Croaks on failure.



Tests with sapcontrol and functions Start and StartService that the instance and services are succesfully started. Croaks on failure.


$self->check_service_state( $state );

Checks in the process table of SUT for sapstartsrv up to the number of seconds specified in the WAIT_INSTANCE_STOP_TIME setting (defaults to 300, with a maximum permitted value of 600). The $state argument can be either start or stop, and it controls whether this method waits for the process to appear in the process table after service was started, or disappear from the process table after service was stopped. Croaks on failure.


$self->check_instance_state( $state );

Uses sapcontrol functions GetSystemInstanceList and GetProcessList to check for up to the number of seconds defined in the WAIT_INSTANCE_STOP_TIME setting (defaults to 300, with a maximum permitted value of 600), whether the instance is in the state specified by the $state argument. This argument can be either green or gray, and it controls whether this method waits for the instance to turn to green status after a start or to turn to gray status after a stop. Croaks on failure.



Check status of the HANA System Replication by running the script in SUT. Waits for 5 minutes for HANA System Replication to be in Active state or croaks on timeout.

Note: can only be run on active node in the cluster. return codes are: 10: No System Replication 11: Error 12: Unknown 13: Initializing 14: Syncing 15: Active



Runs SAPHanaSR-showAttr and checks in its output for up to a timeout specified in the named argument timeout (defaults to 90 seconds) that the sync_state is SOK. It also checks that no SFAIL sync_status is present in the output. Finishes by printing the full output of SAPHanaSR-showAttr. This method will only fail if SAPHanaSR-showAttr returns a non-zero return value.



Restart the SUT and reconnect to the console right after.


$self->do_hana_sr_register( node => $node );

Register current HANA node to the node specified by the named argument node. With the named argument proceed_on_failure set to 1, method will use script_run and return the return value of the script_run call even if sr_register command fails, otherwise assert_script_run is used and the method croaks on failure.


$self->do_hana_takeover( node => $node [, manual_takeover => $manual_takeover] [, cluster => $cluster] );

Do a takeover/takeback on a HANA cluster.

Set $node to the node where HANA is/should be the primary server.

Set $manual_takeover to true, so the method performs a manual rather than an automatic takeover. Defaults to false.

Set $cluster to true so the method runs also a crm resource cleanup. Defaults to false.


$self->install_libopenssl_legacy( $hana_path );

Install libopenssl1_0_0 for older (<SPS03) HANA versions on SLE15+

Set $hana_path to the path where the HANA installation media is located; this path should contain information on the HANA version to install, so prepare it thinking on this. For example: nfs:// This method will then determine the HANA version from $hana_path and decide based on the SLES and HANA versions whether libopenssl1_0_0 must be installed.



Package and upload HANA installation logs from SUT.



Upload NetWeaver installation logs from SUT.



Record whether the SAP workload was started via sapinit or systemd units.