summaryrefslogtreecommitdiffstats
path: root/test/testcases/node
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/testcases/node14
-rw-r--r--test/testcases/node.exp204
2 files changed, 218 insertions, 0 deletions
diff --git a/test/testcases/node b/test/testcases/node
new file mode 100644
index 0000000..f0a5fc1
--- /dev/null
+++ b/test/testcases/node
@@ -0,0 +1,14 @@
+node show
+node show node1
+%setenv showobj=node1
+configure primitive p5 Dummy
+configure group g0 p5
+resource maintenance g0
+resource maintenance p5
+-F node maintenance node1
+node ready node1
+node attribute node1 set a1 "1 2 3"
+node attribute node1 show a1
+node attribute node1 delete a1
+node clearstate node1
+
diff --git a/test/testcases/node.exp b/test/testcases/node.exp
new file mode 100644
index 0000000..d91c33c
--- /dev/null
+++ b/test/testcases/node.exp
@@ -0,0 +1,204 @@
+.TRY node show
+node1: member
+.TRY node show node1
+node1: member
+.SETENV showobj=node1
+.TRY configure primitive p5 Dummy
+.EXT crm_resource --show-metadata ocf:heartbeat:Dummy
+.EXT crm_resource --show-metadata ocf:pacemaker:Dummy
+.EXT crm_resource --show-metadata stonith:null
+.EXT stonithd metadata
+.EXT crm_resource --show-metadata ocf:heartbeat:Delay
+.INP: configure
+.INP: _regtest on
+.INP: show xml node1
+<?xml version="1.0" ?>
+<cib>
+ <configuration>
+ <crm_config/>
+ <nodes>
+ <node uname="node1" id="node1"/>
+ </nodes>
+ <resources/>
+ <constraints/>
+ </configuration>
+</cib>
+
+.TRY configure group g0 p5
+.INP: configure
+.INP: _regtest on
+.INP: show xml node1
+<?xml version="1.0" ?>
+<cib>
+ <configuration>
+ <crm_config/>
+ <nodes>
+ <node uname="node1" id="node1"/>
+ </nodes>
+ <resources/>
+ <constraints/>
+ </configuration>
+</cib>
+
+.TRY resource maintenance g0
+.INP: configure
+.INP: _regtest on
+.INP: show xml node1
+<?xml version="1.0" ?>
+<cib>
+ <configuration>
+ <crm_config/>
+ <nodes>
+ <node uname="node1" id="node1"/>
+ </nodes>
+ <resources/>
+ <constraints/>
+ </configuration>
+</cib>
+
+.TRY resource maintenance p5
+.INP: configure
+.INP: _regtest on
+.INP: show xml node1
+<?xml version="1.0" ?>
+<cib>
+ <configuration>
+ <crm_config/>
+ <nodes>
+ <node uname="node1" id="node1"/>
+ </nodes>
+ <resources/>
+ <constraints/>
+ </configuration>
+</cib>
+
+.TRY -F node maintenance node1
+INFO: 'maintenance' attribute already exists in p5. Remove it? [YES]
+INFO: 'maintenance' attribute already exists in g0. Remove it? [YES]
+.INP: configure
+.INP: _regtest on
+.INP: show xml node1
+<?xml version="1.0" ?>
+<cib>
+ <configuration>
+ <crm_config/>
+ <nodes>
+ <node uname="node1" id="node1">
+ <instance_attributes id="nodes-node1">
+ <nvpair id="nodes-node1-maintenance" name="maintenance" value="true"/>
+ </instance_attributes>
+ </node>
+ </nodes>
+ <resources/>
+ <constraints/>
+ </configuration>
+</cib>
+
+.TRY node ready node1
+.EXT crm_attribute -t nodes -N 'node1' -n maintenance -v 'off'
+.INP: configure
+.INP: _regtest on
+.INP: show xml node1
+<?xml version="1.0" ?>
+<cib>
+ <configuration>
+ <crm_config/>
+ <nodes>
+ <node uname="node1" id="node1">
+ <instance_attributes id="nodes-node1">
+ <nvpair id="nodes-node1-maintenance" name="maintenance" value="off"/>
+ </instance_attributes>
+ </node>
+ </nodes>
+ <resources/>
+ <constraints/>
+ </configuration>
+</cib>
+
+.TRY node attribute node1 set a1 "1 2 3"
+.EXT crm_attribute -t nodes -N 'node1' -n 'a1' -v '1 2 3'
+.INP: configure
+.INP: _regtest on
+.INP: show xml node1
+<?xml version="1.0" ?>
+<cib>
+ <configuration>
+ <crm_config/>
+ <nodes>
+ <node uname="node1" id="node1">
+ <instance_attributes id="nodes-node1">
+ <nvpair id="nodes-node1-maintenance" name="maintenance" value="off"/>
+ <nvpair id="nodes-node1-a1" name="a1" value="1 2 3"/>
+ </instance_attributes>
+ </node>
+ </nodes>
+ <resources/>
+ <constraints/>
+ </configuration>
+</cib>
+
+.TRY node attribute node1 show a1
+.EXT crm_attribute -G -t nodes -N 'node1' -n 'a1'
+scope=nodes name=a1 value=1 2 3
+.INP: configure
+.INP: _regtest on
+.INP: show xml node1
+<?xml version="1.0" ?>
+<cib>
+ <configuration>
+ <crm_config/>
+ <nodes>
+ <node uname="node1" id="node1">
+ <instance_attributes id="nodes-node1">
+ <nvpair id="nodes-node1-maintenance" name="maintenance" value="off"/>
+ <nvpair id="nodes-node1-a1" name="a1" value="1 2 3"/>
+ </instance_attributes>
+ </node>
+ </nodes>
+ <resources/>
+ <constraints/>
+ </configuration>
+</cib>
+
+.TRY node attribute node1 delete a1
+.EXT crm_attribute -D -t nodes -N 'node1' -n 'a1'
+Deleted nodes attribute: id=nodes-node1-a1 name=a1
+.INP: configure
+.INP: _regtest on
+.INP: show xml node1
+<?xml version="1.0" ?>
+<cib>
+ <configuration>
+ <crm_config/>
+ <nodes>
+ <node uname="node1" id="node1">
+ <instance_attributes id="nodes-node1">
+ <nvpair id="nodes-node1-maintenance" name="maintenance" value="off"/>
+ </instance_attributes>
+ </node>
+ </nodes>
+ <resources/>
+ <constraints/>
+ </configuration>
+</cib>
+
+.TRY node clearstate node1
+.INP: configure
+.INP: _regtest on
+.INP: show xml node1
+<?xml version="1.0" ?>
+<cib>
+ <configuration>
+ <crm_config/>
+ <nodes>
+ <node uname="node1" id="node1">
+ <instance_attributes id="nodes-node1">
+ <nvpair id="nodes-node1-maintenance" name="maintenance" value="off"/>
+ </instance_attributes>
+ </node>
+ </nodes>
+ <resources/>
+ <constraints/>
+ </configuration>
+</cib>
+