From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202512 header.b=WrILk80F; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 8789F5A06E2 for ; Wed, 07 Jan 2026 02:46:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202512; t=1767750367; bh=HW/SpdCoqUQsnMOyzle4ldg94lXRjIW68t7XnwJGk+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WrILk80FMnx3QddIKMYplySWEYH9atYYWVU1HvNA8NGe8RnqWSTklnUCylgjBhi4/ Hl9QwO861wlVWLbMWyqLq+SZ+KTwKcHFt72U9tWBGG//E++/Uzocr23qnDnEcMEp1B /yDqgIT1SVa04QSXbI+PheaFuPK5DkbXczQLQ9rmVV1RvyV1loRgwtPytBlT45Ppic cJlGA74GNNer2SjH1qTz/eIt0nHkCjuGAmecxIG3RDzVUoTFDsDVBVBo9e6/WgSR6M hNSuNX87joipF0CDeiqUIovx9NQHJTPWiR1UAKBzaGHojj5eJzdEQ4gKBaKtQD6koR +h11RLfmT7SkA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4dm9qM709Xz4wR4; Wed, 07 Jan 2026 12:46:07 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v3 4/5] test: Handle Operating System Command escapes in terminal output Date: Wed, 7 Jan 2026 12:46:05 +1100 Message-ID: <20260107014606.1513722-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260107014606.1513722-1-david@gibson.dropbear.id.au> References: <20260107014606.1513722-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 4FB7FA43ZN2YVXUAMKO4K4JO2JU4EVLF X-Message-ID-Hash: 4FB7FA43ZN2YVXUAMKO4K4JO2JU4EVLF X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson , Laurent Vivier X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Our "old style" test script stuff uses raw terminal output scraped from tmux. This might include terminal escape sequences from the shell, or whatever we run in it: they think they're talking to a terminal emulator not a script, and they're not entirely incorrect. In several places we filter out ANSI ESC-[ sequences to make this work. However, this doesn't include ESC-] "Operating System Command" sequences. Something I've updated in Fedora 43 generates heaps of these, which break everything. Add more hairy regexps to filter these out as well. Signed-off-by: David Gibson Reviewed-by: Laurent Vivier --- test/lib/term | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/lib/term b/test/lib/term index f596364c..89e4fdbe 100755 --- a/test/lib/term +++ b/test/lib/term @@ -203,7 +203,7 @@ pane_wait() { __done=0 while - __l="$(tail -1 ${LOGDIR}/pane_${__lc}.log | sed 's/[[][^a-zA-Z]*[a-zA-Z]//g')" + __l="$(tail -1 ${LOGDIR}/pane_${__lc}.log | sed 's/[[][^a-zA-Z]*[a-zA-Z]//g;s/[]][^]*[\]//g')" case ${__l} in *"$ " | *"# ") return ;; esac @@ -215,7 +215,7 @@ pane_wait() { pane_parse() { __pane_lc="$(echo "${1}" | tr [A-Z] [a-z])" - __buf="$(tail -n2 ${LOGDIR}/pane_${__pane_lc}.log | head -n1 | sed 's/^[^\r]*\r\([^\r]\)/\1/' | tr -d '\r\n')" + __buf="$(tail -n2 ${LOGDIR}/pane_${__pane_lc}.log | head -n1 | sed 's/^[^\r]*\r\([^\r]\)/\1/;s/[]][^]*[\]//g' | tr -d '\r\n')" [ "# $(eval printf '%s' \"\$${1}_LAST_CMD\")" != "${__buf}" ] && \ [ "$ $(eval printf '%s' \"\$${1}_LAST_CMD\")" != "${__buf}" ] && -- 2.52.0