Skip to content

Commit

Permalink
fixup! Dev: behave: adjust functional tests for previous commits
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasyang2022 committed Jul 16, 2024
1 parent 12b9663 commit 03d66e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/features/qdevice_validate.feature
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Feature: corosync qdevice/qnetd options validate
Then Cluster service is "started" on "hanode3"
When Try "crm cluster init qdevice --qnetd-hostname=qnetd-node -y" on "hanode2,hanode3"
Then Except "ERROR: cluster.init: Duplicated cluster name "cluster1"!"
Then Expected regex "(?:Duplicated cluster name|cluster's name .* already exists)" in stderr
When Run "crm cluster stop" on "hanode2"
When Run "crm cluster stop" on "hanode3"

Expand Down
6 changes: 6 additions & 0 deletions test/features/steps/step_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ def step_impl(context, reg_str):
context.stdout = None


@then('Expected regex "{reg_str}" in stderr')
def step_impl(context, reg_str):
assert context.stderr is not None and re.search(reg_str, context.stderr)
context.stderr = None


@then('Expected return code is "{num}"')
def step_impl(context, num):
assert context.return_code == int(num)
Expand Down

0 comments on commit 03d66e6

Please sign in to comment.