From d5c01f43ea144d7255ad44ee2521dbecc5a15e7a Mon Sep 17 00:00:00 2001 From: Xiaojing_liu Date: Wed, 25 Sep 2024 14:19:09 +0800 Subject: [PATCH] Fix the invalid config in crm for 15-SP7 For 15-SP7, `crm_verify -LV` will fail in 'config not valid', because 'master' is deprecated and need to use 'clone' instead. 'Master' role need to by replaced by 'Promoted'. According to these, make this changes. For QAM test, 15-SP4, 15-SP5, 15-SP6 support 'Promoted' role, for lower versions, keep to use 'master' role. Related: https://jira.suse.com/browse/TEAM-9635 --- tests/ha/drbd_passive.pm | 10 ++++++++-- tests/ha/filesystem.pm | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/ha/drbd_passive.pm b/tests/ha/drbd_passive.pm index f3db204a5000..24819c915e02 100644 --- a/tests/ha/drbd_passive.pm +++ b/tests/ha/drbd_passive.pm @@ -148,9 +148,15 @@ sub run { # Create the HA resource if (is_node(1)) { assert_script_run "EDITOR=\"sed -ie '\$ a primitive $drbd_rsc ocf:linbit:drbd params drbd_resource=$drbd_rsc'\" crm configure edit"; - assert_script_run - "EDITOR=\"sed -ie '\$ a ms ms_$drbd_rsc $drbd_rsc meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true'\" crm configure edit"; + if (is_sle('>=15-SP4')) { + assert_script_run + "EDITOR=\"sed -ie '\$ a clone ms_$drbd_rsc $drbd_rsc meta clone-max=2 clone-node-max=1 promotable=true notify=true'\" crm configure edit"; + } + else { + assert_script_run +"EDITOR=\"sed -ie '\$ a ms ms_$drbd_rsc $drbd_rsc meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true'\" crm configure edit"; + } # Sometimes we need to cleanup the resource rsc_cleanup $drbd_rsc; diff --git a/tests/ha/filesystem.pm b/tests/ha/filesystem.pm index 8d564d57d294..bd4202fb0f63 100644 --- a/tests/ha/filesystem.pm +++ b/tests/ha/filesystem.pm @@ -11,6 +11,7 @@ use base 'opensusebasetest'; use strict; use warnings; use utils 'zypper_call', 'write_sut_file'; +use version_utils 'is_sle'; use testapi; use lockapi; use hacluster; @@ -98,8 +99,9 @@ EDITOR='sed -ie \"s/^\\(group base-group.*\\)/\\1 $fs_rsc/\"' crm configure edit } else { if ($resource eq 'drbd_passive') { + my $role = is_sle('>=15-SP4') ? "Promoted" : "Master"; $edit_crm_config_script .= " -EDITOR='sed -ie \"\$ a colocation colocation_$fs_rsc inf: $fs_rsc ms_$resource:Master\"' crm configure edit +EDITOR='sed -ie \"\$ a colocation colocation_$fs_rsc inf: $fs_rsc ms_$resource:$role\"' crm configure edit EDITOR='sed -ie \"\$ a order order_$fs_rsc Mandatory: ms_$resource:promote $fs_rsc:start\"' crm configure edit "; }