From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id DEF831FF16B for ; Tue, 29 Jul 2025 20:00:40 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7F31419E6E; Tue, 29 Jul 2025 20:01:26 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Date: Tue, 29 Jul 2025 20:00:55 +0200 Message-ID: <20250729180107.428855-16-d.kral@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250729180107.428855-1-d.kral@proxmox.com> References: <20250729180107.428855-1-d.kral@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1753812063657 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.013 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 Subject: [pve-devel] [PATCH ha-manager v4 15/19] sim: do not create default groups for test cases 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: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" As none of the existing HA test cases rely on the default HA groups created by the simulated hardware anymore, create them only for the ha-simulator hardware. This is done, because in an upcoming patch, which persistently migrates HA groups to node affinity rules, it would unnecessarily fire the migration for every default group config. Signed-off-by: Daniel Kral --- src/PVE/HA/Sim/Hardware.pm | 16 ---------------- src/PVE/HA/Sim/RTHardware.pm | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/PVE/HA/Sim/Hardware.pm b/src/PVE/HA/Sim/Hardware.pm index 579be2ad..35107446 100644 --- a/src/PVE/HA/Sim/Hardware.pm +++ b/src/PVE/HA/Sim/Hardware.pm @@ -375,20 +375,6 @@ sub read_static_service_stats { return $stats; } -my $default_group_config = <<__EOD; -group: prefer_node1 - nodes node1 - nofailback 1 - -group: prefer_node2 - nodes node2 - nofailback 1 - -group: prefer_node3 - nodes node3 - nofailback 1 -__EOD - sub new { my ($this, $testdir) = @_; @@ -415,8 +401,6 @@ sub new { if (-f "$testdir/groups") { copy("$testdir/groups", "$statusdir/groups"); - } else { - PVE::Tools::file_set_contents("$statusdir/groups", $default_group_config); } if (-f "$testdir/service_config") { diff --git a/src/PVE/HA/Sim/RTHardware.pm b/src/PVE/HA/Sim/RTHardware.pm index 0dfe0b21..611f9386 100644 --- a/src/PVE/HA/Sim/RTHardware.pm +++ b/src/PVE/HA/Sim/RTHardware.pm @@ -24,6 +24,20 @@ use PVE::HA::LRM; use PVE::HA::Sim::RTEnv; use base qw(PVE::HA::Sim::Hardware); +my $default_group_config = <<__EOD; +group: prefer_node1 + nodes node1 + nofailback 1 + +group: prefer_node2 + nodes node2 + nofailback 1 + +group: prefer_node3 + nodes node3 + nofailback 1 +__EOD + sub new { my ($this, $testdir) = @_; @@ -31,6 +45,10 @@ sub new { my $self = $class->SUPER::new($testdir); + if (!-f "$testdir/groups") { + PVE::Tools::file_set_contents("$self->{statusdir}/groups", $default_group_config); + } + my $logfile = "$testdir/log"; $self->{logfh} = IO::File->new(">$logfile") || die "unable to open '$logfile' - $!"; -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel