From 6fa96ab26752f03ef3d9f08b22e91dba0ca6085c Mon Sep 17 00:00:00 2001 From: Ken Gaillot Date: Thu, 16 Jan 2020 14:48:05 -0600 Subject: [PATCH] Test: scheduler: add regression tests for shutdown locks --- pengine/regression.sh | 2 + pengine/test10/shutdown-lock-expiration.dot | 11 ++ pengine/test10/shutdown-lock-expiration.exp | 68 +++++++++ pengine/test10/shutdown-lock-expiration.scores | 17 +++ pengine/test10/shutdown-lock-expiration.summary | 31 ++++ pengine/test10/shutdown-lock-expiration.xml | 186 ++++++++++++++++++++++++ pengine/test10/shutdown-lock.dot | 11 ++ pengine/test10/shutdown-lock.exp | 64 ++++++++ pengine/test10/shutdown-lock.scores | 17 +++ pengine/test10/shutdown-lock.summary | 31 ++++ pengine/test10/shutdown-lock.xml | 185 +++++++++++++++++++++++ 11 files changed, 623 insertions(+) create mode 100644 pengine/test10/shutdown-lock-expiration.dot create mode 100644 pengine/test10/shutdown-lock-expiration.exp create mode 100644 pengine/test10/shutdown-lock-expiration.scores create mode 100644 pengine/test10/shutdown-lock-expiration.summary create mode 100644 pengine/test10/shutdown-lock-expiration.xml create mode 100644 pengine/test10/shutdown-lock.dot create mode 100644 pengine/test10/shutdown-lock.exp create mode 100644 pengine/test10/shutdown-lock.scores create mode 100644 pengine/test10/shutdown-lock.summary create mode 100644 pengine/test10/shutdown-lock.xml diff --git a/pengine/regression.sh b/pengine/regression.sh index f2226ed..abb9708 100755 --- a/pengine/regression.sh +++ b/pengine/regression.sh @@ -894,6 +894,8 @@ do_test remote-connection-unrecoverable "Remote connection host must be fenced, echo "" do_test resource-discovery "Exercises resource-discovery location constraint option." do_test rsc-discovery-per-node "Disable resource discovery per node" +do_test shutdown-lock "Ensure shutdown lock works properly" +do_test shutdown-lock-expiration "Ensure shutdown lock expiration works properly" echo "" do_test isolation-start-all "Start docker isolated resources." diff --git a/pengine/test10/shutdown-lock-expiration.dot b/pengine/test10/shutdown-lock-expiration.dot new file mode 100644 index 0000000..cd1a4fd --- /dev/null +++ b/pengine/test10/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/pengine/test10/shutdown-lock-expiration.exp b/pengine/test10/shutdown-lock-expiration.exp new file mode 100644 index 0000000..6f3d139 --- /dev/null +++ b/pengine/test10/shutdown-lock-expiration.exp @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pengine/test10/shutdown-lock-expiration.scores b/pengine/test10/shutdown-lock-expiration.scores new file mode 100644 index 0000000..e5d435d --- /dev/null +++ b/pengine/test10/shutdown-lock-expiration.scores @@ -0,0 +1,17 @@ +Allocation scores: +Using the original execution date of: 2020-01-06 22:11:40Z +pcmk__native_allocate: Fencing allocation score on node1: 0 +pcmk__native_allocate: Fencing allocation score on node2: 0 +pcmk__native_allocate: Fencing allocation score on node3: 0 +pcmk__native_allocate: Fencing allocation score on node4: 0 +pcmk__native_allocate: Fencing allocation score on node5: 0 +pcmk__native_allocate: rsc1 allocation score on node1: INFINITY +pcmk__native_allocate: rsc1 allocation score on node2: -INFINITY +pcmk__native_allocate: rsc1 allocation score on node3: -INFINITY +pcmk__native_allocate: rsc1 allocation score on node4: -INFINITY +pcmk__native_allocate: rsc1 allocation score on node5: -INFINITY +pcmk__native_allocate: rsc2 allocation score on node1: 0 +pcmk__native_allocate: rsc2 allocation score on node2: INFINITY +pcmk__native_allocate: rsc2 allocation score on node3: 0 +pcmk__native_allocate: rsc2 allocation score on node4: 0 +pcmk__native_allocate: rsc2 allocation score on node5: 0 diff --git a/pengine/test10/shutdown-lock-expiration.summary b/pengine/test10/shutdown-lock-expiration.summary new file mode 100644 index 0000000..08c93aa --- /dev/null +++ b/pengine/test10/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/pengine/test10/shutdown-lock-expiration.xml b/pengine/test10/shutdown-lock-expiration.xml new file mode 100644 index 0000000..6caa7cf --- /dev/null +++ b/pengine/test10/shutdown-lock-expiration.xml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pengine/test10/shutdown-lock.dot b/pengine/test10/shutdown-lock.dot new file mode 100644 index 0000000..532329d --- /dev/null +++ b/pengine/test10/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/pengine/test10/shutdown-lock.exp b/pengine/test10/shutdown-lock.exp new file mode 100644 index 0000000..e8bf9d8 --- /dev/null +++ b/pengine/test10/shutdown-lock.exp @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pengine/test10/shutdown-lock.scores b/pengine/test10/shutdown-lock.scores new file mode 100644 index 0000000..e09ebfb --- /dev/null +++ b/pengine/test10/shutdown-lock.scores @@ -0,0 +1,17 @@ +Allocation scores: +Using the original execution date of: 2020-01-06 21:59:11Z +pcmk__native_allocate: Fencing allocation score on node1: 0 +pcmk__native_allocate: Fencing allocation score on node2: 0 +pcmk__native_allocate: Fencing allocation score on node3: 0 +pcmk__native_allocate: Fencing allocation score on node4: 0 +pcmk__native_allocate: Fencing allocation score on node5: 0 +pcmk__native_allocate: rsc1 allocation score on node1: INFINITY +pcmk__native_allocate: rsc1 allocation score on node2: -INFINITY +pcmk__native_allocate: rsc1 allocation score on node3: -INFINITY +pcmk__native_allocate: rsc1 allocation score on node4: -INFINITY +pcmk__native_allocate: rsc1 allocation score on node5: -INFINITY +pcmk__native_allocate: rsc2 allocation score on node1: -INFINITY +pcmk__native_allocate: rsc2 allocation score on node2: INFINITY +pcmk__native_allocate: rsc2 allocation score on node3: -INFINITY +pcmk__native_allocate: rsc2 allocation score on node4: -INFINITY +pcmk__native_allocate: rsc2 allocation score on node5: -INFINITY diff --git a/pengine/test10/shutdown-lock.summary b/pengine/test10/shutdown-lock.summary new file mode 100644 index 0000000..6ed56d1 --- /dev/null +++ b/pengine/test10/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/pengine/test10/shutdown-lock.xml b/pengine/test10/shutdown-lock.xml new file mode 100644 index 0000000..40b807d --- /dev/null +++ b/pengine/test10/shutdown-lock.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 1.8.3.1