Skip to content

Commit

Permalink
Dev: behave: add funtional tests for 'crm corosync link ...'
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasyang2022 committed Jun 27, 2024
1 parent 6b0b511 commit 255f49c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/features/corosync_ui.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# vim: sw=2 sts=2
@bootstrap
Feature: crm corosync ui test cases

Expand All @@ -8,3 +9,36 @@ Feature: crm corosync ui test cases
Then Except "No such file or directory: '/etc/corosync/corosync.conf'" in stderr
When Try "crm corosync set totem.cluster_name xin" on "hanode1"
Then Except "No such file or directory: '/etc/corosync/corosync.conf'" in stderr
When Try "crm corosync link show" on "hanode1"
Then Except "No such file or directory: '/etc/corosync/corosync.conf'" in stderr
When Try "crm corosync link update 0 hanode1=192.0.2.1" on "hanode1"
Then Except "No such file or directory: '/etc/corosync/corosync.conf'" in stderr
When Try "crm corosync link add hanode1=192.0.2.1" on "hanode1"
Then Except "No such file or directory: '/etc/corosync/corosync.conf'" in stderr
When Try "crm corosync link remove 0" on "hanode1"
Then Except "No such file or directory: '/etc/corosync/corosync.conf'" in stderr

Scenario: link show/add/update/remove
# background
Given Nodes ["hanode1", "hanode2"] are cleaned up
And 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"
And Cluster is using "knet" transport mode
# tests
When Run "crm corosync link show" on "hanode1"
Then Expected "Node 2: hanode2" in stdout
When Run "crm corosync link add hanode1=192.0.2.100 hanode2=192.0.2.101 options knet_link_priority=10" on "hanode1"
Then Expected "crm corosync diff" in stdout
When Run "crm corosync diff" on "hanode1"
Then Expected "linknumber: 1" in stdout
When Run "crm corosync link update 1 hanode1=192.0.2.102 hanode2=192.0.2.101 options knet_link_priority=11" on "hanode1"
Then Expected "crm corosync diff" in stdout
When Run "crm corosync diff" on "hanode1"
Then Expected "knet_link_priority: 11" in stdout
When Run "crm corosync link remove 1" on "hanode1"
Then Expected "crm corosync diff" in stdout

0 comments on commit 255f49c

Please sign in to comment.