Skip to content

Commit d3589bb

Browse files
committed
Dev: behave: Adjust functional test for previous commits
1 parent 3c02439 commit d3589bb

File tree

3 files changed

+84
-5
lines changed

3 files changed

+84
-5
lines changed

test/features/bootstrap_sbd_delay.feature

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,79 @@ Feature: configure sbd delay start correctly
305305
And Property "priority" in "rsc_defaults" is "0"
306306
And Cluster property "priority-fencing-delay" is "0"
307307
And Parameter "pcmk_delay_max" not configured in "stonith-sbd"
308+
309+
@clean
310+
Scenario: Check and fix sbd-related timeout values for disk-based sbd
311+
Given Cluster service is "stopped" on "hanode1"
312+
Given Cluster service is "stopped" on "hanode2"
313+
When Run "crm cluster init -y" on "hanode1"
314+
Then Cluster service is "started" on "hanode1"
315+
When Run "crm cluster join -c hanode1 -y" on "hanode2"
316+
Then Cluster service is "started" on "hanode2"
317+
When Run "crm cluster init sbd -s /dev/sda1 -y" on "hanode1"
318+
Then Service "sbd" is "started" on "hanode1"
319+
And Service "sbd" is "started" on "hanode2"
320+
# check /etc/sysconf/sbd consistency
321+
When Run "sed -i 's/SBD_DELAY_START=.*/SBD_DELAY_START="no"/' /etc/sysconfig/sbd" on "hanode2"
322+
When Try "crm sbd configure show"
323+
Then Expected "/etc/sysconfig/sbd is not consistent across cluster nodes" in stderr
324+
When Try "crm cluster health sbd"
325+
Then Expected "/etc/sysconfig/sbd is not consistent across cluster nodes" in stderr
326+
When Run "sed -i 's/SBD_DELAY_START=.*/SBD_DELAY_START=71/' /etc/sysconfig/sbd" on "hanode2"
327+
When Run "crm cluster health sbd" on "hanode1"
328+
Then Expected "SBD: Check sbd timeout configuration: OK" in stdout
329+
# check sbd disk metadata
330+
When Run "sbd -1 15 -4 16 -d /dev/sda1 create" on "hanode1"
331+
When Try "crm sbd configur show disk_metadata" on "hanode1"
332+
Then Expected "It's recommended that msgwait(now 16) >= 2*watchdog timeout(now 15)" in stderr
333+
When Try "crm cluster health sbd" on "hanode1"
334+
Then Expected "It's recommended that msgwait(now 16) >= 2*watchdog timeout(now 15)" in stderr
335+
When Run "crm cluster health sbd --fix" on "hanode1"
336+
Then Expected "SBD: Check sbd timeout configuration: OK" in stdout
337+
# check SBD_DELAY_START
338+
When Run "sed -i 's/SBD_DELAY_START=.*/SBD_DELAY_START=40/' /etc/sysconfig/sbd" on "hanode1"
339+
When Run "sed -i 's/SBD_DELAY_START=.*/SBD_DELAY_START=40/' /etc/sysconfig/sbd" on "hanode2"
340+
When Try "crm sbd configure show" on "hanode1"
341+
Then Expected "It's recommended that SBD_DELAY_START is set to 71, now is 40" in stderr
342+
When Try "crm cluster health sbd" on "hanode1"
343+
Then Expected "It's recommended that SBD_DELAY_START is set to 71, now is 40" in stderr
344+
When Run "crm cluster health sbd --fix" on "hanode1"
345+
Then Expected "SBD: Check sbd timeout configuration: OK" in stdout
346+
# check stonith-timeout
347+
When Run "crm configure property stonith-timeout=50" on "hanode1"
348+
When Try "crm sbd configure show" on "hanode1"
349+
Then Expected "It's recommended that stonith-timeout is set to 71, now is 50" in stderr
350+
When Try "crm cluster health sbd" on "hanode1"
351+
Then Expected "It's recommended that stonith-timeout is set to 71, now is 50" in stderr
352+
When Run "crm cluster health sbd --fix" on "hanode1"
353+
Then Expected "SBD: Check sbd timeout configuration: OK" in stdout
354+
# Adjust token timeout in corosync.conf
355+
When Run "sed -i 's/token: .*/token: 10000/' /etc/corosync/corosync.conf" on "hanode1"
356+
When Run "sed -i 's/token: .*/token: 10000/' /etc/corosync/corosync.conf" on "hanode2"
357+
When Run "corosync-cfgtool -R" on "hanode1"
358+
When Try "crm sbd configure show" on "hanode1"
359+
Then Expected "It's recommended that SBD_DELAY_START is set to 82, now is 71" in stderr
360+
When Try "crm cluster health sbd" on "hanode1"
361+
Then Expected "It's recommended that SBD_DELAY_START is set to 82, now is 71" in stderr
362+
When Run "crm cluster health sbd --fix" on "hanode1"
363+
Then Expected "SBD: Check sbd timeout configuration: OK" in stdout
364+
365+
@clean
366+
Scenario: Check and fix sbd-related timeout values for diskless sbd
367+
Given Cluster service is "stopped" on "hanode1"
368+
Given Cluster service is "stopped" on "hanode2"
369+
When Run "crm cluster init -y" on "hanode1"
370+
Then Cluster service is "started" on "hanode1"
371+
When Run "crm cluster join -c hanode1 -y" on "hanode2"
372+
Then Cluster service is "started" on "hanode2"
373+
When Run "crm cluster init sbd -S -y" on "hanode1"
374+
Then Service "sbd" is "started" on "hanode1"
375+
And Service "sbd" is "started" on "hanode2"
376+
# Delete stonith-watchdog-timeout
377+
When Delete property "stonith-watchdog-timeout" from cluster
378+
When Try "crm sbd configure show" on "hanode1"
379+
Then Expected "It's recommended that stonith-watchdog-timeout is set to 30, now is not set" in stderr
380+
When Try "crm cluster health sbd" on "hanode1"
381+
Then Expected "It's recommended that stonith-watchdog-timeout is set to 30, now is not set" in stderr
382+
When Run "crm cluster health sbd --fix" on "hanode1"
383+
Then Expected "SBD: Check sbd timeout configuration: OK" in stdout

test/features/bootstrap_sbd_normal.feature

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,12 @@ Feature: crmsh bootstrap sbd management
8181
Given Cluster service is "stopped" on "hanode1"
8282
Given Cluster service is "stopped" on "hanode2"
8383
When Run "crm cluster init ssh -y" on "hanode1"
84-
And Run "crm cluster init csync2 -y" on "hanode1"
8584
And Run "crm cluster init corosync -y" on "hanode1"
8685
And Run "crm cluster init sbd -s /dev/sda1 -y" on "hanode1"
8786
And Run "crm cluster init cluster -y" on "hanode1"
8887
Then Cluster service is "started" on "hanode1"
8988
And Service "sbd" is "started" on "hanode1"
9089
When Run "crm cluster join ssh -y -c hanode1" on "hanode2"
91-
And Run "crm cluster join csync2 -y -c hanode1" on "hanode2"
9290
And Run "crm cluster join ssh_merge -y -c hanode1" on "hanode2"
9391
And Run "crm cluster join cluster -y -c hanode1" on "hanode2"
9492
Then Cluster service is "started" on "hanode2"
@@ -100,14 +98,12 @@ Feature: crmsh bootstrap sbd management
10098
Given Cluster service is "stopped" on "hanode1"
10199
Given Cluster service is "stopped" on "hanode2"
102100
When Run "crm cluster init ssh -y" on "hanode1"
103-
And Run "crm cluster init csync2 -y" on "hanode1"
104101
And Run "crm cluster init corosync -y" on "hanode1"
105102
And Run "crm cluster init sbd -S -y" on "hanode1"
106103
And Run "crm cluster init cluster -y" on "hanode1"
107104
Then Cluster service is "started" on "hanode1"
108105
And Service "sbd" is "started" on "hanode1"
109106
When Run "crm cluster join ssh -y -c hanode1" on "hanode2"
110-
And Run "crm cluster join csync2 -y -c hanode1" on "hanode2"
111107
And Run "crm cluster join ssh_merge -y -c hanode1" on "hanode2"
112108
And Run "crm cluster join cluster -y -c hanode1" on "hanode2"
113109
Then Cluster service is "started" on "hanode2"

test/features/steps/step_implementation.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,14 +479,21 @@ def step_impl(context, key, value):
479479

480480
@then('SBD option "{key}" value for "{dev}" is "{value}"')
481481
def step_impl(context, key, dev, value):
482-
res = sbd.SBDTimeout.get_sbd_msgwait(dev)
482+
res = sbd.SBDUtils.get_sbd_device_metadata(dev).get(key)
483483
assert_eq(int(value), res)
484484

485+
485486
@then('Start timeout for sbd.service is "{value}" seconds')
486487
def step_impl(context, value):
487488
systemd_start_timeout = sbd.SBDTimeout.get_sbd_systemd_start_timeout()
488489
assert_eq(int(value), systemd_start_timeout)
489490

491+
492+
@when('Delete property "{key}" from cluster')
493+
def step_impl(context, key):
494+
crmutils.delete_property(key)
495+
496+
490497
@then('Cluster property "{key}" is "{value}"')
491498
def step_impl(context, key, value):
492499
res = crmutils.get_property(key)

0 commit comments

Comments
 (0)