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=q4LAiQjF; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 6304C5A0774 for ; Mon, 05 Jan 2026 08:53:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202512; t=1767599619; bh=/3pMZiMndHWjKzNc65kMWVyVlfxvnW3Em9aySiQ0rFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q4LAiQjFdqo54Di0MBgC6FgFWCuMRkEb3W5SBgtt0Lx6+0GBzwc9cybamTi4qe3uU s/KYLrihXGhxrffl/GpydTW57wUXIdp31BAMS9/apHFOVEjXko6gRKpSXs4s8bGxDb P2Mo8ZWBDpzgnQoV6GIdhfM/rBlkden35+eqo2kw9aPJFRpQtuNc5dr/yWs3DXjpLP b9lCXQDshfV9H+usUPhxPZzWW0p5EZ1ZySCtu6xyvWJBYAry+FZWsgaKU96JGoGN04 aqMoeE0jNDMIluoFs9rUHIfVoJqspyvhugjlmQ3Q9yt+Dwi4UZOykp61gezLUKR9ae PDaq9fDku1foQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4dl64M1pdtz4wDl; Mon, 05 Jan 2026 18:53:39 +1100 (AEDT) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 4/5] test: Handle Operating System Command escapes in terminal output Date: Mon, 5 Jan 2026 18:53:36 +1100 Message-ID: <20260105075337.1724962-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260105075337.1724962-1-david@gibson.dropbear.id.au> References: <20260105075337.1724962-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 4NVSTDO5SANNVNOU64PC2PZJAAQHRSWK X-Message-ID-Hash: 4NVSTDO5SANNVNOU64PC2PZJAAQHRSWK 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 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 --- 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