summaryrefslogtreecommitdiffstats
path: root/test/testcases/confbasic-xml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/testcases/confbasic-xml72
-rw-r--r--test/testcases/confbasic-xml.exp206
-rwxr-xr-xtest/testcases/confbasic-xml.filter2
3 files changed, 280 insertions, 0 deletions
diff --git a/test/testcases/confbasic-xml b/test/testcases/confbasic-xml
new file mode 100644
index 0000000..58433f5
--- /dev/null
+++ b/test/testcases/confbasic-xml
@@ -0,0 +1,72 @@
+showxml Basic configure (xml dump)
+node node1
+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'
+primitive d1 ocf:pacemaker:Dummy \
+ operations $id=d1-ops \
+ op monitor interval=60m \
+ op monitor interval=120m OCF_CHECK_LEVEL=10
+monitor d1 60s:30s
+primitive d2 ocf:heartbeat:Delay \
+ params mondelay=60 \
+ op start timeout=60s \
+ op stop timeout=60s
+monitor d2:Started 60s:30s
+group g1 d1 d2
+primitive d3 ocf:pacemaker:Dummy
+clone c d3 \
+ meta clone-max=1
+primitive d4 ocf:pacemaker:Dummy
+ms m d4
+delete m
+master m d4
+primitive s5 ocf:pacemaker:Stateful \
+ operations $id-ref=d1-ops
+primitive s6 ocf:pacemaker:Stateful \
+ operations $id-ref=d1
+ms m5 s5
+ms m6 s6
+location l1 g1 100: node1
+location l2 c \
+ rule $id=l2-rule1 100: #uname eq node1
+location l3 m5 \
+ rule inf: #uname eq node1 and pingd gt 0
+location l4 m5 \
+ rule -inf: not_defined pingd or pingd lte 0
+location l5 m5 \
+ rule -inf: not_defined pingd or pingd lte 0 \
+ rule inf: #uname eq node1 and pingd gt 0 \
+ rule inf: date lt 2009-05-26 and \
+ date in start=2009-05-26 end=2009-07-26 and \
+ date in start=2009-05-26 years=2009 and \
+ date spec years=2009 hours=09-17
+location l6 m5 \
+ rule $id-ref=l2-rule1
+location l7 m5 \
+ rule $id-ref=l2
+collocation c1 inf: m6 m5
+collocation c2 inf: m5:Master d1:Started
+order o1 Mandatory: m5 m6
+order o2 Optional: d1:start m5:promote
+order o3 Serialize: m5 m6
+order o4 Mandatory: m5 m6
+rsc_ticket ticket-A_m6 ticket-A: m6
+rsc_ticket ticket-B_m6_m5 ticket-B: m6 m5 loss-policy=fence
+rsc_ticket ticket-C_master ticket-C: m6 m5:Master loss-policy=fence
+fencing_topology st st2
+property stonith-enabled=true
+property $id=cpset2 maintenance-mode=true
+rsc_defaults failure-timeout=10m
+op_defaults $id=opsdef2 record-pending=true
+_test
+verify
+.
diff --git a/test/testcases/confbasic-xml.exp b/test/testcases/confbasic-xml.exp
new file mode 100644
index 0000000..20892dc
--- /dev/null
+++ b/test/testcases/confbasic-xml.exp
@@ -0,0 +1,206 @@
+<?xml version="1.0" ?>
+<cib>
+ <configuration>
+ <crm_config>
+ <cluster_property_set id="cib-bootstrap-options">
+ <nvpair name="stonith-enabled" value="true" id="cib-bootstrap-options-stonith-enabled"/>
+ </cluster_property_set>
+ <cluster_property_set id="cpset2">
+ <nvpair name="maintenance-mode" value="true" id="cpset2-maintenance-mode"/>
+ </cluster_property_set>
+ </crm_config>
+ <nodes>
+ <node uname="node1" id="node1">
+ <instance_attributes id="node1-instance_attributes">
+ <nvpair name="mem" value="16G" id="node1-instance_attributes-mem"/>
+ </instance_attributes>
+ </node>
+ <node uname="node2" id="node2">
+ <utilization id="node2-utilization">
+ <nvpair name="cpu" value="4" id="node2-utilization-cpu"/>
+ </utilization>
+ </node>
+ </nodes>
+ <resources>
+ <primitive id="st" class="stonith" type="ssh">
+ <instance_attributes id="st-instance_attributes">
+ <nvpair name="hostlist" value="node1 node2" id="st-instance_attributes-hostlist"/>
+ </instance_attributes>
+ <meta_attributes id="st-meta_attributes">
+ <nvpair name="target-role" value="Started" id="st-meta_attributes-target-role"/>
+ <nvpair name="requires" value="nothing" id="st-meta_attributes-requires"/>
+ </meta_attributes>
+ <operations>
+ <op name="start" timeout="60s" interval="0s" id="st-start-0s"/>
+ <op name="monitor" interval="60m" timeout="60s" id="st-monitor-60m"/>
+ <op name="stop" timeout="15" interval="0s" id="st-stop-0s"/>
+ </operations>
+ </primitive>
+ <primitive id="st2" class="stonith" type="ssh">
+ <instance_attributes id="st2-instance_attributes">
+ <nvpair name="hostlist" value="node1 node2" id="st2-instance_attributes-hostlist"/>
+ </instance_attributes>
+ <operations>
+ <op name="monitor" timeout="20" interval="3600" id="st2-monitor-3600"/>
+ <op name="start" timeout="20" interval="0s" id="st2-start-0s"/>
+ <op name="stop" timeout="15" interval="0s" id="st2-stop-0s"/>
+ </operations>
+ </primitive>
+ <group id="g1">
+ <primitive id="d1" class="ocf" provider="pacemaker" type="Dummy">
+ <operations id="d1-ops">
+ <op name="monitor" interval="60m" timeout="20s" id="d1-ops-monitor-60m"/>
+ <op name="monitor" interval="120m" timeout="20s" id="d1-ops-monitor-120m">
+ <instance_attributes id="d1-ops-monitor-120m-instance_attributes">
+ <nvpair name="OCF_CHECK_LEVEL" value="10" id="d1-ops-monitor-120m-instance_attributes-OCF_CHECK_LEVEL"/>
+ </instance_attributes>
+ </op>
+ <op name="start" timeout="20s" interval="0s" id="d1-ops-start-0s"/>
+ <op name="stop" timeout="20s" interval="0s" id="d1-ops-stop-0s"/>
+ <op name="monitor" interval="60s" timeout="30s" id="d1-monitor-60s"/>
+ </operations>
+ </primitive>
+ <primitive id="d2" class="ocf" provider="heartbeat" type="Delay">
+ <instance_attributes id="d2-instance_attributes">
+ <nvpair name="mondelay" value="60" id="d2-instance_attributes-mondelay"/>
+ </instance_attributes>
+ <operations>
+ <op name="start" timeout="60s" interval="0s" id="d2-start-0s"/>
+ <op name="stop" timeout="60s" interval="0s" id="d2-stop-0s"/>
+ <op name="monitor" timeout="30s" interval="10s" id="d2-monitor-10s"/>
+ <op name="monitor" role="Started" interval="60s" timeout="30s" id="d2-monitor-60s"/>
+ </operations>
+ </primitive>
+ </group>
+ <clone id="c">
+ <meta_attributes id="c-meta_attributes">
+ <nvpair name="clone-max" value="1" id="c-meta_attributes-clone-max"/>
+ <nvpair name="interleave" value="true" id="c-meta_attributes-interleave"/>
+ </meta_attributes>
+ <primitive id="d3" class="ocf" provider="pacemaker" type="Dummy">
+ <operations>
+ <op name="monitor" timeout="20s" interval="10s" id="d3-monitor-10s"/>
+ <op name="start" timeout="20s" interval="0s" id="d3-start-0s"/>
+ <op name="stop" timeout="20s" interval="0s" id="d3-stop-0s"/>
+ </operations>
+ </primitive>
+ </clone>
+ <master id="m">
+ <primitive id="d4" class="ocf" provider="pacemaker" type="Dummy">
+ <operations>
+ <op name="monitor" timeout="20s" interval="10s" id="d4-monitor-10s"/>
+ <op name="start" timeout="20s" interval="0s" id="d4-start-0s"/>
+ <op name="stop" timeout="20s" interval="0s" id="d4-stop-0s"/>
+ </operations>
+ </primitive>
+ </master>
+ <master id="m5">
+ <primitive id="s5" class="ocf" provider="pacemaker" type="Stateful">
+ <operations id-ref="d1-ops">
+ <op name="monitor" timeout="20s" interval="10s" role="Promoted" id="s5-monitor-10s"/>
+ <op name="monitor" timeout="20s" interval="11s" role="Unpromoted" id="s5-monitor-11s"/>
+ <op name="start" timeout="20s" interval="0s" id="s5-start-0s"/>
+ <op name="stop" timeout="20s" interval="0s" id="s5-stop-0s"/>
+ <op name="promote" timeout="10s" interval="0s" id="s5-promote-0s"/>
+ <op name="demote" timeout="10s" interval="0s" id="s5-demote-0s"/>
+ </operations>
+ </primitive>
+ </master>
+ <master id="m6">
+ <primitive id="s6" class="ocf" provider="pacemaker" type="Stateful">
+ <operations id-ref="d1-ops">
+ <op name="monitor" timeout="20s" interval="10s" role="Promoted" id="s6-monitor-10s"/>
+ <op name="monitor" timeout="20s" interval="11s" role="Unpromoted" id="s6-monitor-11s"/>
+ <op name="start" timeout="20s" interval="0s" id="s6-start-0s"/>
+ <op name="stop" timeout="20s" interval="0s" id="s6-stop-0s"/>
+ <op name="promote" timeout="10s" interval="0s" id="s6-promote-0s"/>
+ <op name="demote" timeout="10s" interval="0s" id="s6-demote-0s"/>
+ </operations>
+ </primitive>
+ </master>
+ </resources>
+ <constraints>
+ <rsc_location id="l1" rsc="g1" score="100" node="node1"/>
+ <rsc_location id="l2" rsc="c">
+ <rule id="l2-rule1" score="100">
+ <expression operation="eq" attribute="#uname" value="node1" id="l2-rule1-expression"/>
+ </rule>
+ </rsc_location>
+ <rsc_location id="l3" rsc="m5">
+ <rule score="INFINITY" id="l3-rule">
+ <expression operation="eq" attribute="#uname" value="node1" id="l3-rule-expression"/>
+ <expression operation="gt" attribute="pingd" value="0" id="l3-rule-expression-0"/>
+ </rule>
+ </rsc_location>
+ <rsc_location id="l4" rsc="m5">
+ <rule score="-INFINITY" boolean-op="or" id="l4-rule">
+ <expression operation="not_defined" attribute="pingd" id="l4-rule-expression"/>
+ <expression operation="lte" attribute="pingd" value="0" id="l4-rule-expression-0"/>
+ </rule>
+ </rsc_location>
+ <rsc_location id="l5" rsc="m5">
+ <rule score="-INFINITY" boolean-op="or" id="l5-rule">
+ <expression operation="not_defined" attribute="pingd" id="l5-rule-expression"/>
+ <expression operation="lte" attribute="pingd" value="0" id="l5-rule-expression-0"/>
+ </rule>
+ <rule score="INFINITY" id="l5-rule-0">
+ <expression operation="eq" attribute="#uname" value="node1" id="l5-rule-0-expression"/>
+ <expression operation="gt" attribute="pingd" value="0" id="l5-rule-0-expression-0"/>
+ </rule>
+ <rule score="INFINITY" id="l5-rule-1">
+ <date_expression operation="lt" end="2009-05-26" id="l5-rule-1-expression"/>
+ <date_expression operation="in_range" start="2009-05-26" end="2009-07-26" id="l5-rule-1-expression-0"/>
+ <date_expression operation="in_range" start="2009-05-26" id="l5-rule-1-expression-1">
+ <duration years="2009" id="l5-rule-1-expression-1-duration"/>
+ </date_expression>
+ <date_expression operation="date_spec" id="l5-rule-1-expression-2">
+ <date_spec years="2009" hours="09-17" id="l5-rule-1-expression-2-date_spec"/>
+ </date_expression>
+ </rule>
+ </rsc_location>
+ <rsc_location id="l6" rsc="m5">
+ <rule id-ref="l2-rule1"/>
+ </rsc_location>
+ <rsc_location id="l7" rsc="m5">
+ <rule id-ref="l2-rule1"/>
+ </rsc_location>
+ <rsc_colocation id="c1" score="INFINITY" rsc="m6" with-rsc="m5"/>
+ <rsc_colocation id="c2" score="INFINITY" rsc="m5" rsc-role="Master" with-rsc="d1" with-rsc-role="Started"/>
+ <rsc_order id="o1" kind="Mandatory" first="m5" then="m6"/>
+ <rsc_order id="o2" kind="Optional" first="d1" first-action="start" then="m5" then-action="promote"/>
+ <rsc_order id="o3" kind="Serialize" first="m5" then="m6"/>
+ <rsc_order id="o4" kind="Mandatory" first="m5" then="m6"/>
+ <rsc_ticket id="ticket-A_m6" ticket="ticket-A" rsc="m6"/>
+ <rsc_ticket id="ticket-B_m6_m5" ticket="ticket-B" loss-policy="fence">
+ <resource_set id="ticket-B_m6_m5-0">
+ <resource_ref id="m6"/>
+ <resource_ref id="m5"/>
+ </resource_set>
+ </rsc_ticket>
+ <rsc_ticket id="ticket-C_master" ticket="ticket-C" loss-policy="fence">
+ <resource_set id="ticket-C_master-0">
+ <resource_ref id="m6"/>
+ </resource_set>
+ <resource_set role="Master" id="ticket-C_master-1">
+ <resource_ref id="m5"/>
+ </resource_set>
+ </rsc_ticket>
+ </constraints>
+ <fencing-topology>
+ <fencing-level target="node1" index="1" devices="st" id="fencing"/>
+ <fencing-level target="node1" index="2" devices="st2" id="fencing-0"/>
+ <fencing-level target="node2" index="1" devices="st" id="fencing-1"/>
+ <fencing-level target="node2" index="2" devices="st2" id="fencing-2"/>
+ </fencing-topology>
+ <rsc_defaults>
+ <meta_attributes id="rsc-options">
+ <nvpair name="failure-timeout" value="10m" id="rsc-options-failure-timeout"/>
+ </meta_attributes>
+ </rsc_defaults>
+ <op_defaults>
+ <meta_attributes id="opsdef2">
+ <nvpair name="record-pending" value="true" id="opsdef2-record-pending"/>
+ </meta_attributes>
+ </op_defaults>
+ </configuration>
+</cib>
diff --git a/test/testcases/confbasic-xml.filter b/test/testcases/confbasic-xml.filter
new file mode 100755
index 0000000..7b677da
--- /dev/null
+++ b/test/testcases/confbasic-xml.filter
@@ -0,0 +1,2 @@
+#!/bin/bash
+grep -v "WARNING"