Description: Fix testsuite
 Make sure testsuite output works with Pacemaker 2.
Author: Valentin Vidic <vvidic@debian.org>
Last-Update: 2019-01-13
--- a/test/testcases/confbasic.exp
+++ b/test/testcases/confbasic.exp
@@ -56,6 +56,8 @@
 .INP: set d2.mondelay 45
 .INP: _test
 .INP: verify
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
 WARNING: 51: c2: resource d1 is grouped, constraints should apply to the group
 .EXT crmd metadata
 .EXT pengine metadata
@@ -139,4 +141,9 @@
 	rule 100: #uname eq node1 \
 	record-pending=true
 .INP: commit
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
+WARNING: 53: c2: resource d1 is grouped, constraints should apply to the group
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
 WARNING: 53: c2: resource d1 is grouped, constraints should apply to the group
--- a/test/testcases/edit.exp
+++ b/test/testcases/edit.exp
@@ -73,30 +73,30 @@
 .INP: modgroup g1 remove p1
 .INP: modgroup g1 add p1 before p2
 .INP: modgroup g1 add p1
-ERROR: 1: syntax in group: child p1 listed more than once in group g1 parsing 'group g1 p1 p2 d3 p1'
-.INP: modgroup g1 remove st
 Traceback (most recent call last):
     rv = self.execute_command() is not False
     rv = self.command_info.function(*arglist)
     context.fatal_error("%s is not member of %s" % (prim_id, group_id))
     raise ValueError(msg)
 ValueError: st is not member of g1
-ERROR: 42: configure.modgroup: st is not member of g1
-.INP: modgroup g1 remove c1
 Traceback (most recent call last):
     rv = self.execute_command() is not False
     rv = self.command_info.function(*arglist)
     context.fatal_error("%s is not member of %s" % (prim_id, group_id))
     raise ValueError(msg)
 ValueError: c1 is not member of g1
-ERROR: 43: configure.modgroup: c1 is not member of g1
-.INP: modgroup g1 remove nosuch
 Traceback (most recent call last):
     rv = self.execute_command() is not False
     rv = self.command_info.function(*arglist)
     context.fatal_error("%s is not member of %s" % (prim_id, group_id))
     raise ValueError(msg)
 ValueError: nosuch is not member of g1
+ERROR: 1: syntax in group: child p1 listed more than once in group g1 parsing 'group g1 p1 p2 d3 p1'
+.INP: modgroup g1 remove st
+ERROR: 42: configure.modgroup: st is not member of g1
+.INP: modgroup g1 remove c1
+ERROR: 43: configure.modgroup: c1 is not member of g1
+.INP: modgroup g1 remove nosuch
 ERROR: 44: configure.modgroup: nosuch is not member of g1
 .INP: modgroup g1 add c1
 ERROR: 45: a group may contain only primitives; c1 is clone
@@ -129,6 +129,8 @@
 order o-d456 d4 d5 d6
 .INP: _test
 .INP: verify
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
 .EXT crmd metadata
 .EXT pengine metadata
 .EXT cib metadata
@@ -168,3 +170,7 @@
 op_defaults op-options: \
 	timeout=60s
 .INP: commit
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
--- a/test/testcases/resource.exp
+++ b/test/testcases/resource.exp
@@ -134,8 +134,7 @@
 .SETENV showobj=p0
 .TRY resource param p0 set a0 "1 2 3"
 .EXT crm_resource --resource 'p0' --set-parameter 'a0' --parameter-value '1 2 3'
-
-Set 'p0' option: id=p0-instance_attributes-a0 set=p0-instance_attributes name=a0=1 2 3
+Set 'p0' option: id=p0-instance_attributes-a0 set=p0-instance_attributes name=a0 value=1 2 3
 .INP: configure
 .INP: _regtest on
 .INP: show xml p0
@@ -199,8 +198,7 @@
 
 .TRY resource meta p0 set m0 123
 .EXT crm_resource --meta --resource 'p0' --set-parameter 'm0' --parameter-value '123'
-
-Set 'p0' option: id=p0-meta_attributes-m0 set=p0-meta_attributes name=m0=123
+Set 'p0' option: id=p0-meta_attributes-m0 set=p0-meta_attributes name=m0 value=123
 .INP: configure
 .INP: _regtest on
 .INP: show xml p0
@@ -838,28 +836,36 @@
 .TRY resource start p3
 .TRY resource cleanup
 .EXT crm_resource --cleanup
+Cleaned up all resources on all nodes
 .TRY resource cleanup p3
 .EXT crm_resource --cleanup --resource p3
 .TRY resource cleanup p3 node1
 .EXT crm_resource --cleanup --resource p3 --node node1
+Cleaned up p3 on node1
 .TRY resource cleanup force
 .EXT crm_resource --cleanup --force
+Cleaned up all resources on all nodes
 .TRY resource cleanup p3 force
 .EXT crm_resource --cleanup --resource p3 --force
 .TRY resource cleanup p3 node1 force
 .EXT crm_resource --cleanup --resource p3 --node node1 --force
+Cleaned up p3 on node1
 .TRY resource refresh
 .EXT crm_resource --refresh
+Waiting for 1 reply from the controller. OK
 .TRY resource refresh p3
 .EXT crm_resource --refresh --resource p3
 .TRY resource refresh p3 node1
 .EXT crm_resource --refresh --resource p3 --node node1
+..Cleaned up p3 on node1
 .TRY resource refresh force
 .EXT crm_resource --refresh --force
+Waiting for 1 reply from the controller. OK
 .TRY resource refresh p3 force
 .EXT crm_resource --refresh --resource p3 --force
 .TRY resource refresh p3 node1 force
 .EXT crm_resource --refresh --resource p3 --node node1 --force
+..Cleaned up p3 on node1
 .TRY resource stop p3
 .TRY configure rm cg
 .TRY configure ms msg g
@@ -873,10 +879,10 @@
  st	(stonith:null):	Stopped 
  Clone Set: c1 [p1] (unmanaged)
      Stopped: [ node1 ]
- Master/Slave Set: m1 [p2]
+ Clone Set: m1 [p2] (promotable)
      Stopped: [ node1 ]
  p3	(ocf::heartbeat:Dummy):	Stopped ( disabled ) 
- Master/Slave Set: msg [g]
+ Clone Set: msg [g] (promotable)
      Stopped: [ node1 ]
 
 Allocation scores and utilization information:
--- a/test/testcases/ra.exp
+++ b/test/testcases/ra.exp
@@ -45,12 +45,12 @@
 
 Operations' defaults (advisory minimum):
 
-    start         timeout=20
-    stop          timeout=20
-    monitor       timeout=20 interval=10
-    reload        timeout=20
-    migrate_to    timeout=20
-    migrate_from  timeout=20
+    start         timeout=20s
+    stop          timeout=20s
+    monitor       timeout=20s interval=10s
+    reload        timeout=20s
+    migrate_to    timeout=20s
+    migrate_from  timeout=20s
 .INP: info stonith:external/ssh
 .EXT crm_resource --show-metadata stonith:external/ssh
 .EXT stonithd metadata
@@ -72,7 +72,6 @@
     setting this parameter to yes makes it an even worse idea.
     Viva la Vida Loca!
 
-priority (integer, [0]): The priority of the stonith resource. Devices are tried in order of highest priority to lowest.
 pcmk_host_argument (string, [port]): Advanced use only: An alternate parameter to supply instead of 'port'
     Some devices do not support the standard 'port' parameter or may provide additional ones.
     Use this to specify an alternate, device-specific, parameter that should indicate the machine to be fenced.
@@ -83,7 +82,7 @@
 
 pcmk_host_list (string): A list of machines controlled by this device (Optional unless pcmk_host_check=static-list).
 pcmk_host_check (string, [dynamic-list]): How to determine which machines are controlled by the device.
-    Allowed values: dynamic-list (query the device), static-list (check the pcmk_host_list attribute), none (assume every device can fence every machine)
+    Allowed values: dynamic-list (query the device via the 'list' command), static-list (check the pcmk_host_list attribute), status (query the device via the 'status' command), none (assume every device can fence every machine)
 
 pcmk_delay_max (time, [0s]): Enable a random delay for stonith actions and specify the maximum of random delay.
     This prevents double fencing when using slow devices such as sbd.
--- a/test/testcases/commit.exp
+++ b/test/testcases/commit.exp
@@ -23,11 +23,15 @@
 .INP: primitive d2 ocf:heartbeat:Dummy
 .INP: primitive d3 ocf:heartbeat:Dummy
 .INP: commit
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
 .INP: rename p3 pp3
 INFO: 21: modified location:l1 from p3 to pp3
 INFO: 21: modified order:o1 from p3 to pp3
 INFO: 21: modified colocation:cl1 from p3 to pp3
 .INP: commit
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
 .INP: rename pp3 p3
 INFO: 23: modified location:l1 from pp3 to p3
 INFO: 23: modified order:o1 from pp3 to p3
@@ -36,16 +40,26 @@
 INFO: 24: modified order:o1 from c1 to g1
 INFO: 24: modified colocation:cl1 from c1 to g1
 .INP: commit
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
 .INP: group g2 d1 d2
 .INP: commit
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
 .INP: delete g2
 .INP: commit
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
 .INP: filter "sed '/g1/s/p1/d1/'"
 .INP: group g2 d3 d2
 .INP: delete d2
 .INP: commit
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
 .INP: _test
 .INP: verify
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
 WARNING: 35: st: unknown attribute 'yoyo-meta'
 .INP: show
 node node1 \
@@ -70,5 +84,7 @@
 op_defaults op-options: \
 	timeout=2m
 .INP: commit
-INFO: 37: apparently there is nothing to commit
-INFO: 37: try changing something first
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
+(get_ordering_type)    warning: Support for 'score' in rsc_order is deprecated and will be removed in a future release (use 'kind' instead)
+Warnings found during check: config may not be valid
--- a/test/testcases/scripts.exp
+++ b/test/testcases/scripts.exp
@@ -8,7 +8,6 @@
 .EXT crm_resource --show-metadata ocf:heartbeat:db2
 .EXT crm_resource --show-metadata ocf:heartbeat:exportfs
 .EXT crm_resource --show-metadata systemd:haproxy
-ERROR: 2: Error when loading script haproxy: No meta-data for agent: systemd:haproxy
 .EXT crm_resource --show-metadata ocf:heartbeat:LVM
 .EXT crm_resource --show-metadata ocf:heartbeat:MailTo
 .EXT crm_resource --show-metadata ocf:heartbeat:nginx
@@ -54,6 +53,7 @@
 Server:
 
 apache           Apache Webserver
+haproxy          HAProxy
 nginx            Nginx Webserver
 
 Stonith:
@@ -63,7 +63,6 @@
 vmware           Fencing using vCenter / ESX Server
 
 .INP: list all
-ERROR: 3: Error when loading script haproxy: No meta-data for agent: systemd:haproxy
 Basic:
 
 health           Verify health and configuration
@@ -115,6 +114,7 @@
 Server:
 
 apache           Apache Webserver
+haproxy          HAProxy
 nginx            Nginx Webserver
 
 Stonith:
@@ -134,7 +134,7 @@
 exportfs
 filesystem
 gfs2
-ERROR: 4: Error when loading script haproxy: No meta-data for agent: systemd:haproxy
+haproxy
 health
 libvirt
 lvm-drbd
--- a/crmsh/log_patterns.py
+++ b/crmsh/log_patterns.py
@@ -33,7 +33,7 @@
             "lrmd.*WARN: .* %% .*timed out$",
             "crmd.*LRM operation %%_(?:start|stop|promote|demote|migrate)_.*confirmed=true",
             "crmd.*LRM operation %%_.*Timed Out",
-            "[(]%%[)][[]",
+            "[(]%%[)]\[",
         ),
         (  # detail 1
             "lrmd.*%% (?:probe|notify)",
@@ -91,7 +91,7 @@
 
             "crmd.*LRM operation %%_(?:start|stop|promote|demote|migrate)_.*confirmed=true",
             "crmd.*LRM operation %%_.*Timed Out",
-            "[(]%%[)][[]",
+            "[(]%%[)]\[",
         ),
         (  # detail 1
             "crmd.*Initiating.*%%_(?:monitor_0|notify)",
--- a/test/testcases/shadow.exp
+++ b/test/testcases/shadow.exp
@@ -9,14 +9,14 @@
 .INP: use regtest
 .INP: commit regtest
 .EXT >/dev/null </dev/null crm_shadow -b -C 'regtest' --force
-INFO: 5: cib.commit: committed 'regtest' shadow CIB to the cluster
-.INP: delete regtest
 Traceback (most recent call last):
     rv = self.execute_command() is not False
     rv = self.command_info.function(*arglist)
     context.fatal_error("%s shadow CIB is in use" % name)
     raise ValueError(msg)
 ValueError: regtest shadow CIB is in use
+INFO: 5: cib.commit: committed 'regtest' shadow CIB to the cluster
+.INP: delete regtest
 ERROR: 6: cib.delete: regtest shadow CIB is in use
 .INP: use
 .INP: delete regtest
