diff --git a/test/features/configure_bugs.feature b/test/features/configure_bugs.feature index 7fdbbe58e..be239e2a9 100644 --- a/test/features/configure_bugs.feature +++ b/test/features/configure_bugs.feature @@ -52,3 +52,16 @@ Feature: Functional test for configure sub level And Try "crm configure show|grep -E "@vip.0|qwertyui"" Then Expected return code is "1" And Show crm configure + + @clean + Scenario: Setting schema + Given Cluster service is "stopped" on "hanode1" + And Cluster service is "stopped" on "hanode2" + When Run "crm cluster init -y" on "hanode1" + Then Cluster service is "started" on "hanode1" + When Run "crm cluster join -c hanode1 -y" on "hanode2" + Then Cluster service is "started" on "hanode2" + And Online nodes are "hanode1 hanode2" + Then Test schema change + When Try "crm configure schema xxx" on "hanode1" + Then Except "schema xxx is not supported" in stderr diff --git a/test/features/steps/step_implementation.py b/test/features/steps/step_implementation.py index b87b52c31..0a8a5063d 100644 --- a/test/features/steps/step_implementation.py +++ b/test/features/steps/step_implementation.py @@ -605,3 +605,20 @@ def step_impl(context, nodes): EOF''', user='root', ) + + +@then('Test schema change') +def step_impl(context): + rc, schema, _ = ShellUtils().get_stdout_stderr("crm configure schema") + if rc != 0 or not schema: + return False + ver = re.search(r'pacemaker-(\d+\.\d+)', schema).group(1) + expected_ver = float(ver) - 0.1 + expected_schema = f"pacemaker-{expected_ver:.1f}" + rc, _, _ = ShellUtils().get_stdout_stderr(f"crm configure schema {expected_schema}") + if rc != 0: + return False + rc, schema, _ = ShellUtils().get_stdout_stderr("crm configure schema") + if rc != 0 or not schema: + return False + assert schema == expected_schema