From a9fdae8b3acd9a271d04f98f9c4e230bfa74efd3 Mon Sep 17 00:00:00 2001 From: Ken Gaillot Date: Mon, 6 Jan 2020 16:19:12 -0600 Subject: [PATCH 17/18] Test: scheduler: add regression tests for shutdown locks --- cts/cts-scheduler.in | 4 +- cts/scheduler/shutdown-lock-expiration.dot | 11 ++ cts/scheduler/shutdown-lock-expiration.exp | 68 +++++++++ cts/scheduler/shutdown-lock-expiration.scores | 17 +++ cts/scheduler/shutdown-lock-expiration.summary | 31 ++++ cts/scheduler/shutdown-lock-expiration.xml | 187 +++++++++++++++++++++++++ cts/scheduler/shutdown-lock.dot | 11 ++ cts/scheduler/shutdown-lock.exp | 64 +++++++++ cts/scheduler/shutdown-lock.scores | 17 +++ cts/scheduler/shutdown-lock.summary | 31 ++++ cts/scheduler/shutdown-lock.xml | 186 ++++++++++++++++++++++++ 11 files changed, 626 insertions(+), 1 deletion(-) create mode 100644 cts/scheduler/shutdown-lock-expiration.dot create mode 100644 cts/scheduler/shutdown-lock-expiration.exp create mode 100644 cts/scheduler/shutdown-lock-expiration.scores create mode 100644 cts/scheduler/shutdown-lock-expiration.summary create mode 100644 cts/scheduler/shutdown-lock-expiration.xml create mode 100644 cts/scheduler/shutdown-lock.dot create mode 100644 cts/scheduler/shutdown-lock.exp create mode 100644 cts/scheduler/shutdown-lock.scores create mode 100644 cts/scheduler/shutdown-lock.summary create mode 100644 cts/scheduler/shutdown-lock.xml diff --git a/cts/cts-scheduler.in b/cts/cts-scheduler.in index 8fa16fb..f2957ba 100644 --- a/cts/cts-scheduler.in +++ b/cts/cts-scheduler.in @@ -5,7 +5,7 @@ # Pacemaker targets compatibility with Python 2.7 and 3.2+ from __future__ import print_function, unicode_literals, absolute_import, division -__copyright__ = "Copyright 2004-2019 the Pacemaker project contributors" +__copyright__ = "Copyright 2004-2020 the Pacemaker project contributors" __license__ = "GNU General Public License version 2 or later (GPLv2+) WITHOUT ANY WARRANTY" import io @@ -956,6 +956,8 @@ TESTS = [ [ [ "resource-discovery", "Exercises resource-discovery location constraint option" ], [ "rsc-discovery-per-node", "Disable resource discovery per node" ], + [ "shutdown-lock", "Ensure shutdown lock works properly" ], + [ "shutdown-lock-expiration", "Ensure shutdown lock expiration works properly" ], ], # @TODO: If pacemaker implements versioned attributes, uncomment these tests diff --git a/cts/scheduler/shutdown-lock-expiration.dot b/cts/scheduler/shutdown-lock-expiration.dot new file mode 100644 index 0000000..ee99079 --- /dev/null +++ b/cts/scheduler/shutdown-lock-expiration.dot @@ -0,0 +1,11 @@ + digraph "g" { +"Fencing_monitor_120000 node3" [ style=bold color="green" fontcolor="black"] +"Fencing_start_0 node3" -> "Fencing_monitor_120000 node3" [ style = bold] +"Fencing_start_0 node3" [ style=bold color="green" fontcolor="black"] +"Fencing_stop_0 node3" -> "Fencing_start_0 node3" [ style = bold] +"Fencing_stop_0 node3" [ style=bold color="green" fontcolor="black"] +"rsc2_lrm_delete_0 node2" [ style=bold color="green" fontcolor="black"] +"rsc2_monitor_10000 node4" [ style=bold color="green" fontcolor="black"] +"rsc2_start_0 node4" -> "rsc2_monitor_10000 node4" [ style = bold] +"rsc2_start_0 node4" [ style=bold color="green" fontcolor="black"] +} diff --git a/cts/scheduler/shutdown-lock-expiration.exp b/cts/scheduler/shutdown-lock-expiration.exp new file mode 100644 index 0000000..465f12b --- /dev/null +++ b/cts/scheduler/shutdown-lock-expiration.exp @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cts/scheduler/shutdown-lock-expiration.scores b/cts/scheduler/shutdown-lock-expiration.scores new file mode 100644 index 0000000..e5d435d --- /dev/null +++ b/cts/scheduler/shutdown-lock-expiration.scores @@ -0,0 +1,17 @@ +Allocation scores: +Using the original execution date of: 2020-01-06 22:11:40Z +native_color: Fencing allocation score on node1: 0 +native_color: Fencing allocation score on node2: 0 +native_color: Fencing allocation score on node3: 0 +native_color: Fencing allocation score on node4: 0 +native_color: Fencing allocation score on node5: 0 +native_color: rsc1 allocation score on node1: INFINITY +native_color: rsc1 allocation score on node2: -INFINITY +native_color: rsc1 allocation score on node3: -INFINITY +native_color: rsc1 allocation score on node4: -INFINITY +native_color: rsc1 allocation score on node5: -INFINITY +native_color: rsc2 allocation score on node1: 0 +native_color: rsc2 allocation score on node2: INFINITY +native_color: rsc2 allocation score on node3: 0 +native_color: rsc2 allocation score on node4: 0 +native_color: rsc2 allocation score on node5: 0 diff --git a/cts/scheduler/shutdown-lock-expiration.summary b/cts/scheduler/shutdown-lock-expiration.summary new file mode 100644 index 0000000..08c93aa --- /dev/null +++ b/cts/scheduler/shutdown-lock-expiration.summary @@ -0,0 +1,31 @@ +Using the original execution date of: 2020-01-06 22:11:40Z + +Current cluster status: +Online: [ node3 node4 node5 ] +OFFLINE: [ node1 node2 ] + + Fencing (stonith:fence_xvm): Started node3 + rsc1 (ocf::pacemaker:Dummy): Stopped node1 (LOCKED) + rsc2 (ocf::pacemaker:Dummy): Stopped + +Transition Summary: + * Restart Fencing ( node3 ) due to resource definition change + * Start rsc2 ( node4 ) + +Executing cluster transition: + * Resource action: Fencing stop on node3 + * Resource action: Fencing start on node3 + * Resource action: Fencing monitor=120000 on node3 + * Resource action: rsc2 start on node4 + * Cluster action: lrm_delete for rsc2 on node2 + * Resource action: rsc2 monitor=10000 on node4 +Using the original execution date of: 2020-01-06 22:11:40Z + +Revised cluster status: +Online: [ node3 node4 node5 ] +OFFLINE: [ node1 node2 ] + + Fencing (stonith:fence_xvm): Started node3 + rsc1 (ocf::pacemaker:Dummy): Stopped node1 (LOCKED) + rsc2 (ocf::pacemaker:Dummy): Started node4 + diff --git a/cts/scheduler/shutdown-lock-expiration.xml b/cts/scheduler/shutdown-lock-expiration.xml new file mode 100644 index 0000000..26f720e --- /dev/null +++ b/cts/scheduler/shutdown-lock-expiration.xml @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cts/scheduler/shutdown-lock.dot b/cts/scheduler/shutdown-lock.dot new file mode 100644 index 0000000..0a7d8c3 --- /dev/null +++ b/cts/scheduler/shutdown-lock.dot @@ -0,0 +1,11 @@ + digraph "g" { +"Fencing_monitor_120000 node3" [ style=bold color="green" fontcolor="black"] +"Fencing_start_0 node3" -> "Fencing_monitor_120000 node3" [ style = bold] +"Fencing_start_0 node3" [ style=bold color="green" fontcolor="black"] +"Fencing_stop_0 node1" -> "Fencing_start_0 node3" [ style = bold] +"Fencing_stop_0 node1" -> "do_shutdown node1" [ style = bold] +"Fencing_stop_0 node1" [ style=bold color="green" fontcolor="black"] +"do_shutdown node1" [ style=bold color="green" fontcolor="black"] +"rsc1_stop_0 node1" -> "do_shutdown node1" [ style = bold] +"rsc1_stop_0 node1" [ style=bold color="green" fontcolor="black"] +} diff --git a/cts/scheduler/shutdown-lock.exp b/cts/scheduler/shutdown-lock.exp new file mode 100644 index 0000000..e8bf9d8 --- /dev/null +++ b/cts/scheduler/shutdown-lock.exp @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cts/scheduler/shutdown-lock.scores b/cts/scheduler/shutdown-lock.scores new file mode 100644 index 0000000..e09ebfb --- /dev/null +++ b/cts/scheduler/shutdown-lock.scores @@ -0,0 +1,17 @@ +Allocation scores: +Using the original execution date of: 2020-01-06 21:59:11Z +native_color: Fencing allocation score on node1: 0 +native_color: Fencing allocation score on node2: 0 +native_color: Fencing allocation score on node3: 0 +native_color: Fencing allocation score on node4: 0 +native_color: Fencing allocation score on node5: 0 +native_color: rsc1 allocation score on node1: INFINITY +native_color: rsc1 allocation score on node2: -INFINITY +native_color: rsc1 allocation score on node3: -INFINITY +native_color: rsc1 allocation score on node4: -INFINITY +native_color: rsc1 allocation score on node5: -INFINITY +native_color: rsc2 allocation score on node1: -INFINITY +native_color: rsc2 allocation score on node2: INFINITY +native_color: rsc2 allocation score on node3: -INFINITY +native_color: rsc2 allocation score on node4: -INFINITY +native_color: rsc2 allocation score on node5: -INFINITY diff --git a/cts/scheduler/shutdown-lock.summary b/cts/scheduler/shutdown-lock.summary new file mode 100644 index 0000000..6ed56d1 --- /dev/null +++ b/cts/scheduler/shutdown-lock.summary @@ -0,0 +1,31 @@ +Using the original execution date of: 2020-01-06 21:59:11Z + +Current cluster status: +Online: [ node1 node3 node4 node5 ] +OFFLINE: [ node2 ] + + Fencing (stonith:fence_xvm): Started node1 + rsc1 (ocf::pacemaker:Dummy): Started node1 + rsc2 (ocf::pacemaker:Dummy): Stopped node2 (LOCKED) + +Transition Summary: + * Shutdown node1 + * Move Fencing ( node1 -> node3 ) + * Stop rsc1 ( node1 ) due to node availability + +Executing cluster transition: + * Resource action: Fencing stop on node1 + * Resource action: rsc1 stop on node1 + * Cluster action: do_shutdown on node1 + * Resource action: Fencing start on node3 + * Resource action: Fencing monitor=120000 on node3 +Using the original execution date of: 2020-01-06 21:59:11Z + +Revised cluster status: +Online: [ node1 node3 node4 node5 ] +OFFLINE: [ node2 ] + + Fencing (stonith:fence_xvm): Started node3 + rsc1 (ocf::pacemaker:Dummy): Stopped + rsc2 (ocf::pacemaker:Dummy): Stopped node2 (LOCKED) + diff --git a/cts/scheduler/shutdown-lock.xml b/cts/scheduler/shutdown-lock.xml new file mode 100644 index 0000000..ec6db30 --- /dev/null +++ b/cts/scheduler/shutdown-lock.xml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 1.8.3.1