summaryrefslogtreecommitdiffstats
path: root/test/testcases/delete
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/testcases/delete64
-rw-r--r--test/testcases/delete.exp194
2 files changed, 258 insertions, 0 deletions
diff --git a/test/testcases/delete b/test/testcases/delete
new file mode 100644
index 0000000..7d0dc57
--- /dev/null
+++ b/test/testcases/delete
@@ -0,0 +1,64 @@
+session Delete/Rename test
+configure
+# erase to start from scratch
+erase
+erase nodes
+node node1
+# create one stonith so that verify does not complain
+primitive st stonith:ssh \
+ params hostlist='node1' \
+ meta target-role="Started" \
+ op start timeout=60s \
+ op monitor interval=60m timeout=60s
+primitive d1 ocf:pacemaker:Dummy
+primitive d2 ocf:pacemaker:Dummy
+location d1-pref d1 100: node1
+show
+_test
+rename d1 p1
+show
+# delete primitive
+delete d2
+_test
+show
+# delete primitive with constraint
+delete p1
+_test
+show
+primitive d1 ocf:pacemaker:Dummy
+location d1-pref d1 100: node1
+_test
+# delete primitive belonging to a group
+primitive d2 ocf:pacemaker:Dummy
+_test
+group g1 d2 d1
+delete d2
+show
+_test
+delete g1
+show
+verify
+# delete a group which is in a clone
+primitive d2 ocf:pacemaker:Dummy
+group g1 d2 d1
+clone c1 g1
+delete g1
+show
+_test
+group g1 d2 d1
+clone c1 g1
+_test
+# delete group from a clone (again)
+delete g1
+show
+_test
+group g1 d2 d1
+clone c1 g1
+# delete primitive and its group and their clone
+delete d2 d1 c1 g1
+show
+_test
+# verify
+verify
+commit
+.
diff --git a/test/testcases/delete.exp b/test/testcases/delete.exp
new file mode 100644
index 0000000..87b1a7a
--- /dev/null
+++ b/test/testcases/delete.exp
@@ -0,0 +1,194 @@
+.TRY Delete/Rename test
+.INP: configure
+.INP: # erase to start from scratch
+.INP: erase
+.INP: erase nodes
+.INP: node node1
+.INP: # create one stonith so that verify does not complain
+.INP: primitive st stonith:ssh params hostlist='node1' meta target-role="Started" op start timeout=60s op monitor interval=60m timeout=60s
+.EXT crm_resource --show-metadata stonith:ssh
+.EXT stonithd metadata
+.INP: primitive d1 ocf:pacemaker:Dummy
+.EXT crm_resource --show-metadata ocf:pacemaker:Dummy
+.INP: primitive d2 ocf:pacemaker:Dummy
+.INP: location d1-pref d1 100: node1
+.INP: show
+node node1
+primitive d1 ocf:pacemaker:Dummy \
+ op monitor timeout=20s interval=10s \
+ op start timeout=20s interval=0s \
+ op stop timeout=20s interval=0s
+primitive d2 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 \
+ op start timeout=60s interval=0s \
+ op monitor interval=60m timeout=60s \
+ op stop timeout=15 interval=0s
+location d1-pref d1 100: node1
+.INP: _test
+.INP: rename d1 p1
+INFO: 13: modified location:d1-pref from d1 to p1
+.INP: show
+node node1
+primitive d2 ocf:pacemaker:Dummy \
+ op monitor timeout=20s interval=10s \
+ op start timeout=20s interval=0s \
+ op stop timeout=20s interval=0s
+primitive p1 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 \
+ op start timeout=60s interval=0s \
+ op monitor interval=60m timeout=60s \
+ op stop timeout=15 interval=0s
+location d1-pref p1 100: node1
+.INP: # delete primitive
+.INP: delete d2
+.INP: _test
+.INP: show
+node node1
+primitive p1 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 \
+ op start timeout=60s interval=0s \
+ op monitor interval=60m timeout=60s \
+ op stop timeout=15 interval=0s
+location d1-pref p1 100: node1
+.INP: # delete primitive with constraint
+.INP: delete p1
+INFO: 20: hanging location:d1-pref deleted
+.INP: _test
+.INP: show
+node node1
+primitive st stonith:ssh \
+ params hostlist=node1 \
+ meta target-role=Started \
+ op start timeout=60s interval=0s \
+ op monitor interval=60m timeout=60s \
+ op stop timeout=15 interval=0s
+.INP: primitive d1 ocf:pacemaker:Dummy
+.INP: location d1-pref d1 100: node1
+.INP: _test
+.INP: # delete primitive belonging to a group
+.INP: primitive d2 ocf:pacemaker:Dummy
+.INP: _test
+.INP: group g1 d2 d1
+INFO: 29: modified location:d1-pref from d1 to g1
+.INP: delete d2
+.INP: show
+node node1
+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 \
+ op start timeout=60s interval=0s \
+ op monitor interval=60m timeout=60s \
+ op stop timeout=15 interval=0s
+group g1 d1
+location d1-pref g1 100: node1
+.INP: _test
+.INP: delete g1
+INFO: 33: modified location:d1-pref from g1 to d1
+.INP: show
+node node1
+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 \
+ op start timeout=60s interval=0s \
+ op monitor interval=60m timeout=60s \
+ op stop timeout=15 interval=0s
+location d1-pref d1 100: node1
+.INP: verify
+.INP: # delete a group which is in a clone
+.INP: primitive d2 ocf:pacemaker:Dummy
+.INP: group g1 d2 d1
+INFO: 38: modified location:d1-pref from d1 to g1
+.INP: clone c1 g1
+INFO: 39: modified location:d1-pref from g1 to c1
+.INP: delete g1
+INFO: 40: modified location:d1-pref from c1 to g1
+INFO: 40: modified location:d1-pref from g1 to d2
+.INP: show
+node node1
+primitive d1 ocf:pacemaker:Dummy \
+ op monitor timeout=20s interval=10s \
+ op start timeout=20s interval=0s \
+ op stop timeout=20s interval=0s
+primitive d2 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 \
+ op start timeout=60s interval=0s \
+ op monitor interval=60m timeout=60s \
+ op stop timeout=15 interval=0s
+location d1-pref d2 100: node1
+.INP: _test
+.INP: group g1 d2 d1
+INFO: 43: modified location:d1-pref from d2 to g1
+.INP: clone c1 g1
+INFO: 44: modified location:d1-pref from g1 to c1
+.INP: _test
+.INP: # delete group from a clone (again)
+.INP: delete g1
+INFO: 47: modified location:d1-pref from c1 to g1
+INFO: 47: modified location:d1-pref from g1 to d2
+.INP: show
+node node1
+primitive d1 ocf:pacemaker:Dummy \
+ op monitor timeout=20s interval=10s \
+ op start timeout=20s interval=0s \
+ op stop timeout=20s interval=0s
+primitive d2 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 \
+ op start timeout=60s interval=0s \
+ op monitor interval=60m timeout=60s \
+ op stop timeout=15 interval=0s
+location d1-pref d2 100: node1
+.INP: _test
+.INP: group g1 d2 d1
+INFO: 50: modified location:d1-pref from d2 to g1
+.INP: clone c1 g1
+INFO: 51: modified location:d1-pref from g1 to c1
+.INP: # delete primitive and its group and their clone
+.INP: delete d2 d1 c1 g1
+INFO: 53: modified location:d1-pref from c1 to g1
+INFO: 53: modified location:d1-pref from g1 to d2
+INFO: 53: hanging location:d1-pref deleted
+.INP: show
+node node1
+primitive st stonith:ssh \
+ params hostlist=node1 \
+ meta target-role=Started \
+ op start timeout=60s interval=0s \
+ op monitor interval=60m timeout=60s \
+ op stop timeout=15 interval=0s
+.INP: _test
+.INP: # verify
+.INP: verify
+.INP: commit