From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 521191FF0C0 for ; Wed, 18 Nov 2026 16:42:32 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 75E8821804; Wed, 18 Nov 2026 16:42:24 +0100 (CET) From: Jonas Theisen To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server 01/15] test: migration: allow checking for warnings and errors in the log Date: Wed, 18 Nov 2026 16:40:32 +0100 Message-ID: <20261118154207.424260-2-j.theisen@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118154207.424260-1-j.theisen@proxmox.com> References: <20261118154207.424260-1-j.theisen@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795016540655 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.091 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: R42DX353L4MKMRCUFKF5VNU3KQ6DI25U X-Message-ID-Hash: R42DX353L4MKMRCUFKF5VNU3KQ6DI25U X-MailFrom: j.theisen@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: So far, the log is only checked for the error message of a migration that is expected to fail. Allow tests to also check that a migration logs certain warnings, as the migration continues in these cases and the result alone does not show whether the warning was issued. Signed-off-by: Jonas Theisen --- src/test/run_qemu_migrate_tests.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/run_qemu_migrate_tests.pl b/src/test/run_qemu_migrate_tests.pl index 598c1306..9e27d10e 100755 --- a/src/test/run_qemu_migrate_tests.pl +++ b/src/test/run_qemu_migrate_tests.pl @@ -534,6 +534,8 @@ my $tests = [ # to be made if the migration gets far enough # expect_die - expect the migration call to fail, and an error message # matching the specified text in the log + # expect_log - list of texts that each must be present in a warning or + # error message in the log # expected - hash consisting of: # source_volids - hash of volids expected on the source # target_volids - hash of volids expected on the target @@ -1919,6 +1921,15 @@ foreach my $test (@{$tests}) { note("mocked migrate call failed, but it was not expected - check log"); } + if (my $expect_log = $test->{expect_log}) { + my @lines = split(/\n/, file_get_contents("${run_dir}/log")); + for my $text ($expect_log->@*) { + next if grep { m/^(?:err|warn):.*\Q${text}\E/ } @lines; + fail($name); + note("expected message '$text' is not present in log"); + } + } + my $expected_calls = decode_json(file_get_contents("${run_dir}/expected_calls")); foreach my $call (keys %{$expected_calls}) { fail($name); -- 2.47.3