From 37de3e634ebee74cb2ff0b0f69b967ab4632415c Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Thu, 22 Oct 2026 08:49:45 -0300 Subject: [PATCH] fix(xcat-probe): a terminal tput cannot measure erases every checkpoint message xcatprobe asks 'tput cols' for the screen width whenever TERM is set. The GitHub Actions container sets TERM=unknown, terminfo carries no such terminal, and tput writes nothing. The width became 0 and the layout cut every checkpoint message to the empty string, so the probe printed a column of bare [ OK ], [WARN] and [FAIL] marks with no text beside them. xcatprobe_xcatmn_selinux failed on that output. It asserts that the SELinux checkpoint reports [ OK ], and no checkpoint text reached the log. The rest of the probe diagnostics were unreadable for the same reason, so the one [FAIL] in the run named no checkpoint. probe_format::screen_width keeps the 80 column default when 'tput cols' gives no usable number. probe_xcatmn_selinux_case.t renders the checkpoint at that width and three of its assertions fail without this change. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-probe/lib/perl/probe_format.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xCAT-probe/lib/perl/probe_format.pm b/xCAT-probe/lib/perl/probe_format.pm index 585bd52991..6abbd0e391 100644 --- a/xCAT-probe/lib/perl/probe_format.pm +++ b/xCAT-probe/lib/perl/probe_format.pm @@ -17,7 +17,7 @@ my $FLAG_WIDTH = 6; Arguments: raw: the output of 'tput cols', or undef when there is no terminal Returns: - the column count + the column count, always more than the flag width =cut @@ -25,8 +25,12 @@ my $FLAG_WIDTH = 6; sub screen_width { my ($raw) = @_; - return $DEFAULT_WIDTH unless (defined($raw)); - return $raw =~ /(\d+)/ ? $1 + 0 : 0; + # 'tput cols' writes nothing when TERM names a terminal terminfo does not + # carry, and the GitHub Actions container sets TERM=unknown. A width of 0 + # cuts every checkpoint message down to the empty string. + return $DEFAULT_WIDTH unless (defined($raw) && $raw =~ /(\d+)/); + my $cols = $1 + 0; + return $cols > $FLAG_WIDTH ? $cols : $DEFAULT_WIDTH; } #-----------------------------------