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 1619B1FF16B for ; Tue, 1 Jul 2025 17:41:57 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A7E939AA4; Tue, 1 Jul 2025 17:41:36 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Tue, 1 Jul 2025 17:40:36 +0200 Message-ID: <20250701154117.434512-17-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250701154117.434512-1-f.ebner@proxmox.com> References: <20250701154117.434512-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.029 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 qemu-server v2 16/49] test: collect mocked functions for QemuServer module 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" Also order them alphabetically. Signed-off-by: Fiona Ebner --- src/test/MigrationTest/QmMock.pm | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/test/MigrationTest/QmMock.pm b/src/test/MigrationTest/QmMock.pm index 3eaa131f..de7f4cd7 100644 --- a/src/test/MigrationTest/QmMock.pm +++ b/src/test/MigrationTest/QmMock.pm @@ -50,21 +50,6 @@ $inotify_module->mock( }, ); -$MigrationTest::Shared::qemu_server_module->mock( - nodename => sub { - return $nodename; - }, - config_to_command => sub { - return ['mocked_kvm_command']; - }, - vm_start_nolock => sub { - my ($storecfg, $vmid, $conf, $params, $migrate_opts) = @_; - $forcemachine = $params->{forcemachine} - or die "mocked vm_start_nolock - expected 'forcemachine' parameter\n"; - $MigrationTest::Shared::qemu_server_module->original('vm_start_nolock')->(@_); - }, -); - my $qemu_server_helpers_module = Test::MockModule->new("PVE::QemuServer::Helpers"); $qemu_server_helpers_module->mock( vm_running_locally => sub { @@ -113,6 +98,9 @@ $MigrationTest::Shared::storage_module->mock( ); $MigrationTest::Shared::qemu_server_module->mock( + config_to_command => sub { + return ['mocked_kvm_command']; + }, mon_cmd => sub { my ($vmid, $command, %params) = @_; @@ -127,6 +115,9 @@ $MigrationTest::Shared::qemu_server_module->mock( } die "mon_cmd (mocked) - implement me: $command"; }, + nodename => sub { + return $nodename; + }, run_command => sub { my ($cmd_full, %param) = @_; @@ -149,6 +140,12 @@ $MigrationTest::Shared::qemu_server_module->mock( file_set_contents("${RUN_DIR_PATH}/nbd_info", to_json($nbd)); return $nbd; }, + vm_start_nolock => sub { + my ($storecfg, $vmid, $conf, $params, $migrate_opts) = @_; + $forcemachine = $params->{forcemachine} + or die "mocked vm_start_nolock - expected 'forcemachine' parameter\n"; + $MigrationTest::Shared::qemu_server_module->original('vm_start_nolock')->(@_); + }, ); our $cmddef = { -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel