From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 4EA3AA2BEA for ; Tue, 20 Jun 2023 12:55:43 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 95114339EA for ; Tue, 20 Jun 2023 12:54:44 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 20 Jun 2023 12:54:43 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 32AD741C6D for ; Tue, 20 Jun 2023 12:54:43 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Tue, 20 Jun 2023 12:54:36 +0200 Message-Id: <20230620105438.121605-8-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230620105438.121605-1-f.ebner@proxmox.com> References: <20230620105438.121605-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.046 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH v2 ha-manager 7/7] tests: add test for shutdown policy override X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2023 10:55:43 -0000 Signed-off-by: Fiona Ebner --- No changes in v2. src/test/test-shutdown-policy-override/README | 3 + .../test-shutdown-policy-override/cmdlist | 4 ++ .../datacenter.cfg | 10 ++++ .../hardware_status | 5 ++ .../test-shutdown-policy-override/log.expect | 57 +++++++++++++++++++ .../manager_status | 1 + .../service_config | 6 ++ 7 files changed, 86 insertions(+) create mode 100644 src/test/test-shutdown-policy-override/README create mode 100644 src/test/test-shutdown-policy-override/cmdlist create mode 100644 src/test/test-shutdown-policy-override/datacenter.cfg create mode 100644 src/test/test-shutdown-policy-override/hardware_status create mode 100644 src/test/test-shutdown-policy-override/log.expect create mode 100644 src/test/test-shutdown-policy-override/manager_status create mode 100644 src/test/test-shutdown-policy-override/service_config diff --git a/src/test/test-shutdown-policy-override/README b/src/test/test-shutdown-policy-override/README new file mode 100644 index 0000000..b9c71ce --- /dev/null +++ b/src/test/test-shutdown-policy-override/README @@ -0,0 +1,3 @@ +Test shutdown policy override. + +Expect that the policy from the override is used. diff --git a/src/test/test-shutdown-policy-override/cmdlist b/src/test/test-shutdown-policy-override/cmdlist new file mode 100644 index 0000000..a86b9e2 --- /dev/null +++ b/src/test/test-shutdown-policy-override/cmdlist @@ -0,0 +1,4 @@ +[ + [ "power node1 on", "power node2 on", "power node3 on"], + [ "shutdown node3" ] +] diff --git a/src/test/test-shutdown-policy-override/datacenter.cfg b/src/test/test-shutdown-policy-override/datacenter.cfg new file mode 100644 index 0000000..0a188bd --- /dev/null +++ b/src/test/test-shutdown-policy-override/datacenter.cfg @@ -0,0 +1,10 @@ +{ + "ha": { + "shutdown_policy": "migrate" + }, + "local-overrides": { + "ha": { + "shutdown_policy": "freeze" + } + } +} diff --git a/src/test/test-shutdown-policy-override/hardware_status b/src/test/test-shutdown-policy-override/hardware_status new file mode 100644 index 0000000..451beb1 --- /dev/null +++ b/src/test/test-shutdown-policy-override/hardware_status @@ -0,0 +1,5 @@ +{ + "node1": { "power": "off", "network": "off" }, + "node2": { "power": "off", "network": "off" }, + "node3": { "power": "off", "network": "off" } +} diff --git a/src/test/test-shutdown-policy-override/log.expect b/src/test/test-shutdown-policy-override/log.expect new file mode 100644 index 0000000..4aecc4f --- /dev/null +++ b/src/test/test-shutdown-policy-override/log.expect @@ -0,0 +1,57 @@ +info 0 hardware: starting simulation +info 20 cmdlist: execute power node1 on +info 20 node1/crm: status change startup => wait_for_quorum +info 20 node1/lrm: status change startup => wait_for_agent_lock +info 20 cmdlist: execute power node2 on +info 20 node2/crm: status change startup => wait_for_quorum +info 20 node2/lrm: status change startup => wait_for_agent_lock +info 20 cmdlist: execute power node3 on +info 20 node3/crm: status change startup => wait_for_quorum +info 20 node3/lrm: status change startup => wait_for_agent_lock +info 20 node1/crm: got lock 'ha_manager_lock' +info 20 node1/crm: status change wait_for_quorum => master +info 20 node1/crm: node 'node1': state changed from 'unknown' => 'online' +info 20 node1/crm: node 'node2': state changed from 'unknown' => 'online' +info 20 node1/crm: node 'node3': state changed from 'unknown' => 'online' +info 20 node1/crm: adding new service 'vm:103' on node 'node3' +info 20 node1/crm: adding new service 'vm:104' on node 'node3' +info 20 node1/crm: adding new service 'vm:105' on node 'node3' +info 20 node1/crm: adding new service 'vm:106' on node 'node3' +info 20 node1/crm: service 'vm:103': state changed from 'request_start' to 'started' (node = node3) +info 20 node1/crm: service 'vm:104': state changed from 'request_start' to 'started' (node = node3) +info 20 node1/crm: service 'vm:105': state changed from 'request_start' to 'started' (node = node3) +info 20 node1/crm: service 'vm:106': state changed from 'request_start' to 'started' (node = node3) +info 22 node2/crm: status change wait_for_quorum => slave +info 24 node3/crm: status change wait_for_quorum => slave +info 25 node3/lrm: got lock 'ha_agent_node3_lock' +info 25 node3/lrm: status change wait_for_agent_lock => active +info 25 node3/lrm: starting service vm:103 +info 25 node3/lrm: service status vm:103 started +info 25 node3/lrm: starting service vm:104 +info 25 node3/lrm: service status vm:104 started +info 25 node3/lrm: starting service vm:105 +info 25 node3/lrm: service status vm:105 started +info 25 node3/lrm: starting service vm:106 +info 25 node3/lrm: service status vm:106 started +info 120 cmdlist: execute shutdown node3 +info 120 node3/lrm: got shutdown request with shutdown policy 'freeze' +info 120 node3/lrm: shutdown LRM, stop and freeze all services +info 120 node1/crm: service 'vm:103': state changed from 'started' to 'freeze' +info 120 node1/crm: service 'vm:104': state changed from 'started' to 'freeze' +info 120 node1/crm: service 'vm:105': state changed from 'started' to 'freeze' +info 120 node1/crm: service 'vm:106': state changed from 'started' to 'freeze' +info 125 node3/lrm: stopping service vm:103 +info 125 node3/lrm: service status vm:103 stopped +info 125 node3/lrm: stopping service vm:104 +info 125 node3/lrm: service status vm:104 stopped +info 125 node3/lrm: stopping service vm:105 +info 125 node3/lrm: service status vm:105 stopped +info 125 node3/lrm: stopping service vm:106 +info 125 node3/lrm: service status vm:106 stopped +info 126 node3/lrm: exit (loop end) +info 126 shutdown: execute crm node3 stop +info 125 node3/crm: server received shutdown request +info 145 node3/crm: exit (loop end) +info 145 shutdown: execute power node3 off +info 160 node1/crm: node 'node3': state changed from 'online' => 'unknown' +info 720 hardware: exit simulation - done diff --git a/src/test/test-shutdown-policy-override/manager_status b/src/test/test-shutdown-policy-override/manager_status new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/src/test/test-shutdown-policy-override/manager_status @@ -0,0 +1 @@ +{} diff --git a/src/test/test-shutdown-policy-override/service_config b/src/test/test-shutdown-policy-override/service_config new file mode 100644 index 0000000..d6f4fd9 --- /dev/null +++ b/src/test/test-shutdown-policy-override/service_config @@ -0,0 +1,6 @@ +{ + "vm:103": { "node": "node3", "state": "enabled" }, + "vm:104": { "node": "node3", "state": "enabled" }, + "vm:105": { "node": "node3", "state": "enabled" }, + "vm:106": { "node": "node3", "state": "enabled" } +} -- 2.39.2