From b48325100babf57118f3996b5584594050e0cf13 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Tue, 2 Apr 2024 18:27:19 +0000 Subject: [PATCH] tests: figure out correct version of sed to run In run_in_venv_with_cleanup.sh, sed was changed to gsed to allow the script to run properly on FreeBSD because the sed script uses an expression that is specific to the gnu sed. Gnu sed is available to be invoked as gsed on FreeBSD systems, but there is no executable or symlink which allows sed to be run by the name gsed on ubuntu 22.04. Check for the existence of gsed. If it's found, use it. Otherwise, just use sed. Type: fix Fixes: b3c863eae4 Signed-off-by: Matthew Smith Change-Id: I487197e486f500711aa3e87ec7ba899a53606b40 --- test/scripts/run_in_venv_with_cleanup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/scripts/run_in_venv_with_cleanup.sh b/test/scripts/run_in_venv_with_cleanup.sh index 454c9c9c4ad..e87afde1ddc 100755 --- a/test/scripts/run_in_venv_with_cleanup.sh +++ b/test/scripts/run_in_venv_with_cleanup.sh @@ -21,7 +21,9 @@ panic() { atexit() { group_id=`ps -p $$ -o pgid=` my_id=$$ - ids=`pgrep -g $group_id -d ' ' | gsed "s/\b$my_id\b//g"` + SED=`which gsed` + SED=$(basename "${SED:-sed}") + ids=`pgrep -g $group_id -d ' ' | ${SED} "s/\b$my_id\b//g"` echo "Killing possible remaining process IDs: $ids" for id in $ids do -- 2.16.6