Skip to content

Commit

Permalink
Dev: behave: adjust functional tests for previous changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasyang2022 committed Jul 31, 2023
1 parent ff70c9a commit 548eb4b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/features/bootstrap_bugs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,17 @@ Feature: Regression test for bootstrap bugs

@skip_non_root
@clean
Scenario: Do upgrade job without root passwordless
Scenario: Skip upgrade when preconditions are not satisfied
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"
When Run "rm -f /var/lib/crmsh/upgrade_seq" on "hanode1"
And Run "rm -f /root/.config/crm/crm.conf" on "hanode1"
And Run "rm -rf /root/.ssh" on "hanode1"
And Run "crm status" on "hanode1"
And Run "mv /root/.config/crm/crm.conf{,.bak}" on "hanode1"
Then Run "crm status" OK on "hanode1"
When Run "rm -f /var/lib/crmsh/upgrade_seq" on "hanode1"
And Run "mv /root/.config/crm/crm.conf{.bak,}" on "hanode1"
And Run "mv /root/.ssh{,.bak}" on "hanode1"
Then Run "crm status" OK on "hanode1"
5 changes: 5 additions & 0 deletions test/features/steps/step_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ def step_impl(context, cmd, addr):
_, out, _ = run_command_local_or_remote(context, cmd, addr)


@then('Run "{cmd}" OK on "{addr}"')
def step_impl(context, cmd, addr):
_, out, _ = run_command_local_or_remote(context, cmd, addr)


@then('Print stdout')
def step_impl(context):
context.logger.info("\n{}".format(context.stdout))
Expand Down

0 comments on commit 548eb4b

Please sign in to comment.