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 22FDD1FF38C for ; Thu, 16 May 2024 15:39:53 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8BCA53D6; Thu, 16 May 2024 15:39:57 +0200 (CEST) From: Christoph Heiss To: pve-devel@lists.proxmox.com Date: Thu, 16 May 2024 15:39:31 +0200 Message-ID: <20240516133945.1087246-2-c.heiss@proxmox.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240516133945.1087246-1-c.heiss@proxmox.com> References: <20240516133945.1087246-1-c.heiss@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.006 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 installer 1/6] test: ui2-stdio: fix multi-process testing 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" Previously, if something failed in the child, the overall test would still be successful and exit with `0`. Signed-off-by: Christoph Heiss --- test/ui2-stdio.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/ui2-stdio.pl b/test/ui2-stdio.pl index ae29b79..01f323d 100755 --- a/test/ui2-stdio.pl +++ b/test/ui2-stdio.pl @@ -4,7 +4,6 @@ use strict; use warnings; use JSON qw(from_json); -use Test::More; use Proxmox::Log; use Proxmox::UI; @@ -16,10 +15,11 @@ $parent_writer->autoflush(1); $child_writer->autoflush(1); $child_reader->autoflush(1); - my $child_pid = fork() // die "fork failed - $!\n"; if ($child_pid) { + eval 'use Test::More tests => 3;'; + # parent, the hypothetical low-level installer close($parent_reader); close($parent_writer); @@ -45,8 +45,11 @@ if ($child_pid) { Proxmox::UI::progress(1, 0, 1, 'done'); waitpid($child_pid, 0); + is($?, 0); # check child exit status done_testing(); } else { + eval 'use Test::More tests => 10;'; + # child, e.g. the TUI close($child_reader); close($child_writer); @@ -90,6 +93,5 @@ if ($child_pid) { 'should get 100% done progress message'); done_testing(); - exit(0); } -- 2.44.0 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel