Skip to content

Commit

Permalink
Dev: testcases: Adjust original test cases to match pacemaker-3 (#1688)
Browse files Browse the repository at this point in the history
Major changes:
- Remove stonith:null and stonith:ssh in original test cases
- Set `stonith-enabled=false` to avoid config error
  • Loading branch information
nicholasyang2022 authored Feb 17, 2025
2 parents 4207023 + e9da0c3 commit 8bb3232
Show file tree
Hide file tree
Showing 35 changed files with 137 additions and 437 deletions.
2 changes: 1 addition & 1 deletion crmsh/ui_cib.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def do_reset(self, context, name):
"usage: reset <shadow_cib>"
if not utils.is_filename_sane(name):
context.fatal_error("Bad filename: " + name)
if utils.ext_cmd("%s -r '%s'" % (self.extcmd, name)) == 0:
if utils.ext_cmd(f"{self.extcmd} -r '{name}' --force") == 0:
context.info("copied live CIB to %s" % name)
else:
context.fatal_error("failed to copy live CIB to %s" % name)
Expand Down
2 changes: 1 addition & 1 deletion test/bugs-test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
property stonith-enabled=false
node node1
primitive st stonith:null params hostlist=node1
op_defaults timeout=60s
group g1 gr1 gr2
group g2 gr3
Expand Down
4 changes: 3 additions & 1 deletion test/crm-interface
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ crm_mksample() {
$CRM_NO_REG -c $CIB<<EOF
configure
node node1
property stonith-enabled=false
primitive p0 ocf:pacemaker:Dummy
primitive p1 ocf:pacemaker:Dummy
primitive p2 ocf:heartbeat:Delay \
params startdelay=2 mondelay=2 stopdelay=2
primitive p3 ocf:pacemaker:Dummy
primitive st stonith:null params hostlist=node1
clone c1 p1
clone m1 p2 meta promotable=true
op_defaults timeout=60s
Expand All @@ -44,6 +44,7 @@ configure
_regtest on
erase
erase nodes
property stonith-enabled=false
`cat`
show
commit
Expand All @@ -55,6 +56,7 @@ configure
_regtest on
erase
erase nodes
property stonith-enabled=false
`cat`
show xml
commit
Expand Down
2 changes: 1 addition & 1 deletion test/features/crm_report_normal.feature
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Feature: crm report functional test for common cases
Scenario: Run history and script
When Run "crm history info" on "hanode1"
When Run "crm history refresh" on "hanode1"
When Try "crm history peinputs|grep "pengine/pe-input-0""
When Try "crm history peinputs|grep -E "pengine/pe-.*-0""
Then Expected return code is "0"
When Try "crm history info|grep "Nodes: hanode1 hanode2""
Then Expected return code is "0"
Expand Down
5 changes: 0 additions & 5 deletions test/testcases/acl
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
show ACL
node node1
property enable-acl=true
primitive st stonith:ssh \
params hostlist='node1' \
meta target-role="Started" requires=nothing \
op start timeout=60s \
op monitor interval=60m timeout=60s
primitive d0 ocf:pacemaker:Dummy
primitive d1 ocf:pacemaker:Dummy
role basic-read \
Expand Down
11 changes: 2 additions & 9 deletions test/testcases/acl.exp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
.INP: _regtest on
.INP: erase
.INP: erase nodes
.INP: property stonith-enabled=false
.INP: node node1
.INP: property enable-acl=true
.INP: primitive st stonith:ssh params hostlist='node1' meta target-role="Started" requires=nothing op start timeout=60s op monitor interval=60m timeout=60s
.EXT crm_resource --show-metadata stonith:ssh
.EXT stonithd metadata
.INP: primitive d0 ocf:pacemaker:Dummy
.EXT crm_resource --show-metadata ocf:pacemaker:Dummy
.INP: primitive d1 ocf:pacemaker:Dummy
Expand All @@ -34,13 +32,8 @@ primitive d1 ocf:pacemaker:Dummy \
op monitor timeout=20s interval=10s \
op start timeout=20s interval=0s \
op stop timeout=20s interval=0s
primitive st stonith:ssh \
params hostlist=node1 \
meta target-role=Started requires=nothing \
op start timeout=60s interval=0s \
op monitor interval=60m timeout=60s \
op stop timeout=15s interval=0s
property cib-bootstrap-options: \
stonith-enabled=false \
enable-acl=true
role basic-read \
read status \
Expand Down
19 changes: 5 additions & 14 deletions test/testcases/bugs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
session Configuration bugs
options
sort_elements false
sort-elements false
up
configure
erase
primitive st stonith:null \
params hostlist='node1' \
meta requires=nothing \
op monitor interval=60m
property stonith-enabled=false
primitive p4 Dummy
primitive p3 Dummy
primitive p2 Dummy
Expand All @@ -30,7 +27,7 @@ show
.
session Unordered load file
options
sort_elements false
sort-elements false
up
configure
load update bugs-test.txt
Expand All @@ -42,10 +39,7 @@ verify
session Unknown properties
configure
erase
primitive st stonith:null \
params hostlist='node1' \
meta requires=nothing \
op monitor interval=60m
property stonith-enabled=false
property SAPHanaSR: \
hana_ha1_site_lss_WDF1=4
show
Expand All @@ -63,11 +57,8 @@ verify
session template
configure
erase
property stonith-enabled=false
node node1
primitive st stonith:null \
params hostlist='node1' \
meta requires=nothing \
op monitor interval=60m
template
new vip virtual-ip params ip=10.10.10.123
load vip
Expand Down
63 changes: 19 additions & 44 deletions test/testcases/bugs.exp
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
.TRY Configuration bugs
.INP: options
.INP: sort_elements false
WARNING: 2: This command 'sort_elements' is deprecated, please use 'sort-elements'
INFO: 2: "sort_elements" is accepted as "sort-elements"
.INP: sort-elements false
.INP: up
.INP: configure
.INP: erase
.INP: primitive st stonith:null params hostlist='node1' meta requires=nothing op monitor interval=60m
.EXT crm_resource --show-metadata stonith:null
.EXT stonithd metadata
.INP: property stonith-enabled=false
.INP: primitive p4 Dummy
.EXT crm_resource --show-metadata ocf:heartbeat:Dummy
.INP: primitive p3 Dummy
Expand All @@ -28,12 +24,6 @@ colocation c2 inf: ( p1 p2 ) p3 p4
.INP: clone cl-p5 p5
.INP: show
node node1
primitive st stonith:null \
params hostlist=node1 \
meta requires=nothing \
op monitor interval=60m timeout=20s \
op start timeout=20s interval=0s \
op stop timeout=15s interval=0s
primitive p4 Dummy \
op monitor timeout=20s interval=10s \
op start timeout=20s interval=0s \
Expand Down Expand Up @@ -61,18 +51,15 @@ primitive p6 Dummy \
clone cl-p5 p5 \
meta interleave=true
colocation c2 inf: ( p1 p2 ) p3 p4
property cib-bootstrap-options: \
stonith-enabled=false
.INP: commit
.EXT crm_attribute --list-options=cluster --all --output-as=xml
.EXT crm_resource --list-options=primitive --all --output-as=xml
.INP: _test
.INP: verify
.INP: show
node node1
primitive st stonith:null \
params hostlist=node1 \
meta requires=nothing \
op monitor interval=60m timeout=20s \
op start timeout=20s interval=0s \
op stop timeout=15s interval=0s
primitive p4 Dummy \
op monitor timeout=20s interval=10s \
op start timeout=20s interval=0s \
Expand Down Expand Up @@ -100,19 +87,17 @@ primitive p5 Dummy \
clone cl-p5 p5 \
meta interleave=true
colocation c2 inf: ( p1 p2 ) p3 p4
property cib-bootstrap-options: \
stonith-enabled=false
.TRY Unordered load file
.INP: options
.INP: sort_elements false
WARNING: 2: This command 'sort_elements' is deprecated, please use 'sort-elements'
INFO: 2: "sort_elements" is accepted as "sort-elements"
.INP: sort-elements false
.INP: up
.INP: configure
.INP: load update bugs-test.txt
.EXT crm_resource --show-metadata ocf:heartbeat:Dummy
.INP: show
node node1
primitive st stonith:null \
params hostlist=node1
primitive p4 Dummy \
op monitor timeout=20s interval=10s \
op start timeout=20s interval=0s \
Expand Down Expand Up @@ -149,62 +134,51 @@ clone cl-p5 p5 \
colocation c2 inf: ( p1 p2 ) p3 p4
location loc1 g1 \
rule 200: #uname eq node1
property cib-bootstrap-options: \
stonith-enabled=false
op_defaults op-options: \
timeout=60s
.INP: commit
.EXT crm_resource --show-metadata stonith:null
.EXT stonithd metadata
.EXT crm_resource --list-options=primitive --all --output-as=xml
.INP: _test
.INP: verify
.EXT crm_attribute --list-options=cluster --all --output-as=xml
.TRY Unknown properties
.INP: configure
.INP: erase
INFO: 2: constraint colocation:c2 updated
INFO: 2: constraint colocation:c2 updated
INFO: 2: modified location:loc1 from g1 to gr2
.INP: primitive st stonith:null params hostlist='node1' meta requires=nothing op monitor interval=60m
.EXT crm_resource --show-metadata stonith:null
.EXT stonithd metadata
.INP: property stonith-enabled=false
.INP: property SAPHanaSR: hana_ha1_site_lss_WDF1=4
.INP: show
node node1
primitive st stonith:null \
params hostlist=node1 \
meta requires=nothing \
op monitor interval=60m timeout=20s \
op start timeout=20s interval=0s \
op stop timeout=15s interval=0s
property SAPHanaSR: \
hana_ha1_site_lss_WDF1=4
property cib-bootstrap-options: \
stonith-enabled=false
.INP: commit
.EXT crm_resource --list-options=primitive --all --output-as=xml
.EXT crm_attribute --list-options=cluster --all --output-as=xml
.INP: _test
.INP: verify
.INP: property SAPHanaSR_2: hana_ha1_site_iss_WDF1=cde hana_ha1_site_bss_WDF1=abc
.INP: show
node node1
primitive st stonith:null \
params hostlist=node1 \
meta requires=nothing \
op monitor interval=60m timeout=20s \
op start timeout=20s interval=0s \
op stop timeout=15s interval=0s
property SAPHanaSR: \
hana_ha1_site_lss_WDF1=4
property SAPHanaSR_2: \
hana_ha1_site_iss_WDF1=cde \
hana_ha1_site_bss_WDF1=abc
property cib-bootstrap-options: \
stonith-enabled=false
.INP: commit
.INP: _test
.INP: verify
.TRY template
.INP: configure
.INP: erase
.INP: property stonith-enabled=false
.INP: node node1
.INP: primitive st stonith:null params hostlist='node1' meta requires=nothing op monitor interval=60m
.EXT crm_resource --show-metadata stonith:null
.EXT stonithd metadata
.INP: template
.INP: new vip virtual-ip params ip=10.10.10.123
INFO: 6: pulling in template virtual-ip
Expand All @@ -214,6 +188,7 @@ INFO: 6: pulling in template virtual-ip
.EXT crm_resource --list-ocf-alternatives IPaddr2
.INP: up
.INP: commit
.EXT crm_attribute --list-options=cluster --all --output-as=xml
.EXT crm_resource --list-options=primitive --all --output-as=xml
.INP: _test
.INP: verify
8 changes: 0 additions & 8 deletions test/testcases/bundle
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,9 @@ delete node1
node node1 \
attributes mem=16G
node node2 utilization cpu=4
primitive st stonith:ssh \
params hostlist='node1 node2' \
meta target-role="Started" requires=nothing \
op start timeout=60s \
op monitor interval=60m timeout=60s
primitive st2 stonith:ssh \
params hostlist='node1 node2'
bundle id=bundle-test1 docker image=test network ip-range-start=10.10.10.123 port-mapping id=port1 port=80 storage storage-mapping id=storage1 target-dir=test source-dir=test meta target-role=Stopped
primitive id=dummy ocf:heartbeat:Dummy op monitor interval=10 meta target-role=Stopped
bundle id=bundle-test2 docker image=test network ip-range-start=10.10.10.123 primitive dummy meta target-role=Stopped priority=1
property stonith-enabled=true
_test
verify
.
19 changes: 2 additions & 17 deletions test/testcases/bundle.exp
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@
.INP: _regtest on
.INP: erase
.INP: erase nodes
.INP: property stonith-enabled=false
.INP: node node1
.INP: delete node1
.INP: node node1 attributes mem=16G
.INP: node node2 utilization cpu=4
.INP: primitive st stonith:ssh params hostlist='node1 node2' meta target-role="Started" requires=nothing op start timeout=60s op monitor interval=60m timeout=60s
.EXT crm_resource --show-metadata stonith:ssh
.EXT stonithd metadata
.INP: primitive st2 stonith:ssh params hostlist='node1 node2'
.INP: bundle id=bundle-test1 docker image=test network ip-range-start=10.10.10.123 port-mapping id=port1 port=80 storage storage-mapping id=storage1 target-dir=test source-dir=test meta target-role=Stopped
.INP: primitive id=dummy ocf:heartbeat:Dummy op monitor interval=10 meta target-role=Stopped
.EXT crm_resource --show-metadata ocf:heartbeat:Dummy
.INP: bundle id=bundle-test2 docker image=test network ip-range-start=10.10.10.123 primitive dummy meta target-role=Stopped priority=1
.INP: property stonith-enabled=true
.INP: _test
.INP: verify
.EXT crm_attribute --list-options=cluster --all --output-as=xml
Expand All @@ -30,17 +26,6 @@ primitive dummy Dummy \
op monitor interval=10s timeout=20s \
op start timeout=20s interval=0s \
op stop timeout=20s interval=0s
primitive st stonith:ssh \
params hostlist="node1 node2" \
meta target-role=Started requires=nothing \
op start timeout=60s interval=0s \
op monitor interval=60m timeout=60s \
op stop timeout=15s interval=0s
primitive st2 stonith:ssh \
params hostlist="node1 node2" \
op monitor timeout=20s interval=3600s \
op start timeout=20s interval=0s \
op stop timeout=15s interval=0s
bundle bundle-test1 \
docker image=test \
network ip-range-start=10.10.10.123 \
Expand All @@ -54,5 +39,5 @@ bundle bundle-test2 \
primitive dummy \
meta target-role=Stopped priority=1
property cib-bootstrap-options: \
stonith-enabled=true
stonith-enabled=false
.INP: commit
4 changes: 0 additions & 4 deletions test/testcases/commit
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
show Commits of all kinds
op_defaults timeout=2m
primitive st stonith:null \
params hostlist='node1' \
meta yoyo-meta="yoyo 2" requires=nothing \
op monitor interval=60m
commit
node node1 \
attributes mem=16G
Expand Down
Loading

0 comments on commit 8bb3232

Please sign in to comment.