From ed7395d562ad13b1ded259b8a98cb2ea74d96ab0 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 9 May 2024 00:48:35 -0400 Subject: [PATCH] test-field.sh: make sure bt_run_in_py_env() and bt_cli() succeed Signed-off-by: Philippe Proulx Change-Id: I26c033a56d2c214087db058bdc19d20312a6f0e1 Reviewed-on: https://review.lttng.org/c/babeltrace/+/12535 Reviewed-by: Simon Marchi Tested-by: jenkins --- tests/plugins/src.ctf.fs/field/test-field.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/plugins/src.ctf.fs/field/test-field.sh b/tests/plugins/src.ctf.fs/field/test-field.sh index 72e4e4f5..7c73aa2b 100755 --- a/tests/plugins/src.ctf.fs/field/test-field.sh +++ b/tests/plugins/src.ctf.fs/field/test-field.sh @@ -21,13 +21,27 @@ data_dir=$BT_TESTS_DATADIR/plugins/src.ctf.fs/field test_pass() { local -r mp_path=$1 local -r output_dir=$(mktemp -d) + local -r py_cmd=( + "$BT_TESTS_PYTHON_BIN" "$data_dir/data_from_mp.py" + "$mp_path" "$output_dir" + ) - bt_run_in_py_env "$BT_TESTS_PYTHON_BIN" "$data_dir/data_from_mp.py" "$mp_path" "$output_dir" + if ! bt_run_in_py_env "${py_cmd[@]}"; then + fail "Failed to run \`${py_cmd[*]}\`" + return 1 + fi local -r res_path=$(mktemp) - - bt_cli "$res_path" /dev/null --plugin-path="$data_dir" \ + local -r cli_cmd=( + "$res_path" /dev/null --plugin-path="$data_dir" -c sink.test-text.single "$output_dir/trace" + ) + + if ! bt_cli "${cli_cmd[@]}"; then + fail "Failed to run \`bt_cli ${cli_cmd[*]}\`" + return 1 + fi + bt_diff "$res_path" "$output_dir/expect" ok $? "$mp_path" rm -rf "$output_dir" "$res_path" -- 2.34.1