From: Daniel Kral <d.kral@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH ha-manager 5/7] pve-ha-tester: capture and fail for unexpected perl warnings
Date: Fri, 17 Apr 2026 14:27:20 +0200 [thread overview]
Message-ID: <20260417122728.330123-6-d.kral@proxmox.com> (raw)
In-Reply-To: <20260417122728.330123-1-d.kral@proxmox.com>
Make any HA integration tests fail, which output some unexpected
warning.
This assumes that the HA stack's code always uses the
PVE::HA::Env::log() interface to output any relevant information for
users and the test cases.
This catches any uninitialized values in the test cases early in the
build/test process, which would have gone unnoticed before as these
weren't considered failed tests.
Signed-off-by: Daniel Kral <d.kral@proxmox.com>
---
src/pve-ha-tester | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/pve-ha-tester b/src/pve-ha-tester
index b7dc4d66..5f13b460 100755
--- a/src/pve-ha-tester
+++ b/src/pve-ha-tester
@@ -19,6 +19,14 @@ sub show_usage {
my $testdir = shift || show_usage();
my $hardware = PVE::HA::Sim::TestHardware->new($testdir);
+$SIG{'__WARN__'} = sub {
+ my $err = $@;
+ my $message = $_[0];
+ chomp $message;
+ $hardware->log('warn', $message, 'perl');
+ $@ = $err;
+};
+
$hardware->log('info', "starting simulation");
eval { $hardware->run(); };
--
2.47.3
next prev parent reply other threads:[~2026-04-17 12:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 12:27 [PATCH ha-manager 0/7] some test logging output improvements Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 1/7] sim: always limit the priority level to 4 characters Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 2/7] consistently use correct priority levels for log calls Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 3/7] sim: hardware: factor common service lock hash access in unlock_service Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 4/7] use log with warning priority instead of warn where possible Daniel Kral
2026-04-17 12:27 ` Daniel Kral [this message]
2026-04-17 12:27 ` [PATCH ha-manager 6/7] test: ha-tester: use consistent word casing for failed test messages Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 7/7] test: ha-tester: use colorized diff for unexpected test log outputs Daniel Kral
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260417122728.330123-6-d.kral@proxmox.com \
--to=d.kral@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox