Package with utility functionality for tests on SLES for SAP Applications.
This package is a stateless library. To keep this library as generic as possible avoid as much as possible any other dependency usage, like other base class or testapi module Avoid using get_var/set_var at this level.
Expect `SAPHanaSR-showAttr --format=$input_format` as input.
Returns parsed perl value decoded from json remap output from like :
Hosts/vmhana01/remoteHost="vmhana02"
Hosts/vmhana01/sync_state="PRIM"
Hosts/vmhana01/vhost="vmhana01"
Hosts/vmhana02/remoteHost="vmhana01"
Hosts/vmhana02/sync_state="SOK"
Hosts/vmhana02/vhost="vmhana02"
output looks like:
{
'Host' => {
'vmhana01' => {
'clone_state' => 'DEMOTED',
'score' => '100',
'srah' => '-',
'version' => '2.00.077.00.1710325774',
'vhost' => 'vmhana01',
'site' => 'site_a'
},
'vmhana02' => {
'clone_state' => 'PROMOTED',
'score' => '150',
'vhost' => 'vmhana02',
'srah' => '-',
'version' => '2.00.077.00.1710325774',
'site' => 'site_b'
}
},
'Site' => {
'site_a' => {
'srMode' => 'sync',
'srPoll' => 'SOK',
'mns' => 'vmhana01'
},
'site_b' => {
'srPoll' => 'PRIM',
'mns' => 'vmhana02',
'srMode' => 'sync'
}
}
};
Expect the output of saputils::calculate_hana_topology as input.
Uses calculate_hana_topology to get a hash of hashes, and then
checks the output to make sure that the cluster is working and ready.
The checks performed are:
- All node_states are online
- All sync_states are either SOK or PRIM
input: the output of the command 'crm_mon -r -R -n -N -1'
output: whether the conditions are met (return 1) or not (return 0)
Conditions:
- No resources are in 'Starting' state
- No 'Failed Resource Actions' present
Returns hostname of current primary node obtained from B<calculate_hana_topology()> output.
Returns hostname of current failover (replica) node obtained from B<calculate_hana_topology()> output.
Returns node hostname even if it's in 'SFAIL' state.