File: bootstrap_options.feature

package info (click to toggle)
crmsh 5.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,980 kB
  • sloc: python: 50,399; sh: 1,207; makefile: 255; xml: 243; exp: 234; awk: 22
file content (216 lines) | stat: -rw-r--r-- 11,020 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
@bootstrap
Feature: crmsh bootstrap process - options

  Test crmsh bootstrap options:
      "--node": Additional nodes to add to the created cluster
      "-i":      Bind to IP address on interface IF
      "-n":      Set the name of the configured cluster
      "-A":      Configure IP address as an administration virtual IP
  Tag @clean means need to stop cluster service if the service is available
  Need nodes: hanode1 hanode2 hanode3 qnetd-node

  @clean
  Scenario: Check help output
    When    Run "crm configure help primitive" OK		
    When    Run "crm -h" on "hanode1"
    Then    Output is the same with expected "crm" help output
    When    Run "crm cluster init -h" on "hanode1"
    Then    Output is the same with expected "crm cluster init" help output
    When    Run "crm cluster join -h" on "hanode1"
    Then    Output is the same with expected "crm cluster join" help output
    When    Run "crm cluster remove -h" on "hanode1"
    Then    Output is the same with expected "crm cluster remove" help output
    When    Run "crm cluster geo_init -h" on "hanode1"
    Then    Output is the same with expected "crm cluster geo-init" help output
    When    Run "crm cluster geo_join -h" on "hanode1"
    Then    Output is the same with expected "crm cluster geo-join" help output
    When    Run "crm cluster geo_init_arbitrator -h" on "hanode1"
    Then    Output is the same with expected "crm cluster geo-init-arbitrator" help output
    When    Try "crm cluster init -i eth1 -i eth1 -y"
    Then    Except multiple lines
      """
      usage: init [options] [STAGE]
      crm: error: Duplicated input for '-i/--interface' option
      """
    When    Try "crm cluster init sbd -x -y" on "hanode1"
    Then    Expected "-x option or SKIP_CSYNC2_SYNC can't be used with any stage" in stderr
    When    Try "crm cluster init -N hanode2" on "hanode1"
    Then    Expected "Can't use -N/--nodes option without -y/--yes option" in stderr
    When    Try "crm cluster init sbd -N hanode1 -N hanode2 -y" on "hanode1"
    Then    Expected "Can't use -N/--nodes option and stage(sbd) together" in stderr
    When    Try "crm corosync link help add" on "hanode1"
    Then    Expected return code is "0"

  @clean
  Scenario: Stage validation
    When    Try "crm cluster init fdsf -y" on "hanode1"
    Then    Expected "Invalid stage: fdsf(available stages: ssh, firewalld, csync2, corosync, sbd, cluster, ocfs2, gfs2, admin, qdevice)" in stderr
    When    Try "crm cluster join fdsf -y" on "hanode1"
    Then    Expected "Invalid stage: fdsf(available stages: ssh, firewalld, csync2, ssh_merge, cluster)" in stderr
    When    Try "crm cluster join ssh -y" on "hanode1"
    Then    Expected "Can't use stage(ssh) without specifying cluster node" in stderr

  @clean
  Scenario: Init whole cluster service on node "hanode1" using "--node" option
    Given   Cluster service is "stopped" on "hanode1"
    And     Cluster service is "stopped" on "hanode2"
    When    Run "crm cluster init -y --node "hanode1 hanode2 hanode3"" on "hanode1"
    Then    Cluster service is "started" on "hanode1"
    And     Cluster service is "started" on "hanode2"
    And     Online nodes are "hanode1 hanode2"
    And     Show cluster status on "hanode1"

    When    Try "crm cluster init cluster -y" on "hanode1"
    Then    Expected "Cluster is active, can't run 'cluster' stage" in stderr

  @clean
  Scenario: Bind specific network interface using "-i" option
    Given   Cluster service is "stopped" on "hanode1"
    And     IP "@hanode1.ip.1" is belong to "eth1"
    When    Run "crm cluster init -i eth1 -y" on "hanode1"
    Then    Cluster service is "started" on "hanode1"
    And     IP "@hanode1.ip.1" is used by corosync on "hanode1"
    And     Show corosync ring status
 
  @clean
  Scenario: Validate "-i" option
    Given   Cluster service is "stopped" on "hanode1"
    When    Try "crm cluster init -t udpu -i eth0 -i eth1"
    Then    Except "ERROR: cluster.init: Only one link is allowed for the 'udpu' transport type"
    When    Try "crm cluster init -i eth0 -i eth1 -i eth2 -i eth3 -i eth4 -i eth5 -i eth6 -i eth7 -i eth8"
    Then    Except "ERROR: cluster.init: Maximum number of interfaces is 8"
    When    Try "crm cluster init -i eth11 -y"
    Then    Except "ERROR: cluster.init: Invalid value 'eth11' for -i/--interface option"

  @clean
  Scenario: Using multiple network interface using "-i" option
    Given   Cluster service is "stopped" on "hanode1"
    And     IP "@hanode1.ip.0" is belong to "eth0"
    And     IP "@hanode1.ip.1" is belong to "eth1"
    When    Run "crm cluster init -i eth0 -i eth1 -y" on "hanode1"
    Then    Cluster service is "started" on "hanode1"
    And     IP "@hanode1.ip.0" is used by corosync on "hanode1"
    And     IP "@hanode1.ip.1" is used by corosync on "hanode1"
    And     Show corosync ring status

  @clean
  Scenario: Using "-i" option, mixing with IP and NIC name
    Given   Cluster service is "stopped" on "hanode1"
    Given   Cluster service is "stopped" on "hanode2"
    When    Run "crm cluster init -i eth0 -i @hanode1.ip.1 -y" on "hanode1"
    Then    Cluster service is "started" on "hanode1"
    And     IP "@hanode1.ip.0" is used by corosync on "hanode1"
    And     IP "@hanode1.ip.1" is used by corosync on "hanode1"
    When    Run "crm cluster join -c hanode1 -i eth0 -i @hanode2.ip.1 -y" on "hanode2"
    Then    Cluster service is "started" on "hanode2"
    And     IP "@hanode2.ip.0" is used by corosync on "hanode2"
    And     IP "@hanode2.ip.1" is used by corosync on "hanode2"

    When    Try "crm cluster join cluster -c hanode1 -y" on "hanode2"
    Then    Expected "Cluster is active, can't run 'cluster' stage" in stderr

  @clean
  Scenario: Using "-i" option with IP address
    Given   Cluster service is "stopped" on "hanode1"
    Given   Cluster service is "stopped" on "hanode2"
    When    Run "crm cluster init -i @hanode1.ip.0 -i @hanode1.ip.1 -y" on "hanode1"
    Then    Cluster service is "started" on "hanode1"
    And     IP "@hanode1.ip.0" is used by corosync on "hanode1"
    And     IP "@hanode1.ip.1" is used by corosync on "hanode1"
    When    Run "crm cluster join -c hanode1 -i @hanode2.ip.0 -i @hanode2.ip.1 -y" on "hanode2"
    Then    Cluster service is "started" on "hanode2"
    And     IP "@hanode2.ip.0" is used by corosync on "hanode2"
    And     IP "@hanode2.ip.1" is used by corosync on "hanode2"

  @clean
  Scenario: Setup cluster name and virtual IP using "-A" option
    Given   Cluster service is "stopped" on "hanode1"
    When    Try "crm cluster init -A xxx -y"
    Then    Except "ERROR: cluster.init: 'xxx' does not appear to be an IPv4 or IPv6 address"
    When    Try "crm cluster init -A @hanode1.ip.0 -y"
    Then    Except "ERROR: cluster.init: Address already in use: @hanode1.ip.0"
    When    Run "crm cluster init -n hatest -A @vip.0 -y" on "hanode1"
    Then    Cluster service is "started" on "hanode1"
    And     Cluster name is "hatest"
    And     Cluster virtual IP is "@vip.0"
    And     Show cluster status on "hanode1"

  @clean
  Scenario: Invalid virtual IP address wouldn't block cluster init
    Given   Cluster service is "stopped" on "hanode1"
    When    Run "crm cluster init -A 60.60.60.6 --qnetd-hostname qnetd-node -y" on "hanode1"
    Then    Expected "Time out waiting for resource "admin-ip" to start" in stderr
    Then    Service "corosync-qdevice" is "started" on "hanode1"
 
  @clean
  Scenario: Detect multi IP in the same NIC
    Given   Cluster service is "stopped" on "hanode1"
    When    Try "crm cluster init -i eth0 -i @hanode1.ip.0 -y"
    Then    Except "ERROR: cluster.init: Invalid input '@hanode1.ip.0': the IP in the same NIC already used"
    When    Try "crm cluster init -i @hanode1.ip.0 -i eth0 -y"
    Then    Except "ERROR: cluster.init: Invalid input 'eth0': The same NIC already used"

  @clean
  Scenario: Init cluster service with ipv6 using "-I" option
    Given   Cluster service is "stopped" on "hanode1"
    Given   Cluster service is "stopped" on "hanode2"
    When    Run "crm cluster init -I -i eth0 -y" on "hanode1"
    Then    Cluster service is "started" on "hanode1"
    And     IP "@hanode1.ip6.0" is used by corosync on "hanode1"
    When    Run "crm cluster join -c hanode1 -i eth0 -y" on "hanode2"
    Then    Cluster service is "started" on "hanode2"
    And     IP "@hanode2.ip6.0" is used by corosync on "hanode2"

  @clean
  Scenario: Init cluster with -N option (bsc#1175863)
    Given   Cluster service is "stopped" on "hanode1"
    Given   Cluster service is "stopped" on "hanode2"
    When    Run "crm cluster init -N hanode1 -N hanode2 -y" on "hanode1"
    Then    Cluster service is "started" on "hanode1"
    And     Cluster service is "started" on "hanode2"

  @clean
  Scenario: Skip using csync2 by -x option
    Given   Cluster service is "stopped" on "hanode1"
    Given   Cluster service is "stopped" on "hanode2"
    When    Run "crm cluster init -y -x" on "hanode1"
    Then    Cluster service is "started" on "hanode1"
    And     Service "csync2.socket" is "stopped" on "hanode1"
    When    Run "crm cluster join -c hanode1 -y" on "hanode2"
    Then    Cluster service is "started" on "hanode2"
    And     Service "csync2.socket" is "stopped" on "hanode2"
    When    Run "crm cluster init csync2 -y" on "hanode1"
    Then    Service "csync2.socket" is "started" on "hanode1"
    And     Service "csync2.socket" is "started" on "hanode2"

  @clean
  Scenario: Setup cluster with udpu transport
    Given   Cluster service is "stopped" on "hanode1"
    Given   Cluster service is "stopped" on "hanode2"
    When    Run "crm cluster init -y -t udpu" 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"
    Then    Cluster is using "udpu" transport mode

  @clean
  Scenario: Setup cluster with udp transport
    Given   Cluster service is "stopped" on "hanode1"
    Given   Cluster service is "stopped" on "hanode2"
    When    Run "crm cluster init -y -t udp" 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"
    Then    Cluster is using "udp" transport mode

  @clean
  Scenario: Check if the join side provides the corresponding network interface
    Given   Cluster service is "stopped" on "hanode1"
    Given   Cluster service is "stopped" on "hanode2"
    When    Run "crm cluster init -i eth0 -i eth1 -y" on "hanode1"
    Then    Cluster service is "started" on "hanode1"
    When    Try "crm cluster join -c hanode1 -i eth1 -y" on "hanode2"
    Then    Cluster service is "stopped" on "hanode2"
    And     Except "Node hanode1 has 2 links, but provided 1" in stderr
    When    Run "crm cluster join -c hanode1 -i eth0 -i eth1 -y" on "hanode2"
    Then    Cluster service is "started" on "hanode2"