diff options
Diffstat (limited to '')
-rw-r--r-- | test/testcases/node.exp | 204 |
1 files changed, 204 insertions, 0 deletions
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> + |