From 1898019face400b84b504c199a5a3de27969103d Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 26 Mar 2022 10:50:45 +0100 Subject: [PATCH] tests/test-cli-extensions: Fix with single-binary coreutils MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On systems where `coreutils` are built with `--enable-single-binary=symlinks` like Nix, `/usr/bin/env` is symlinked to `/usr/bin/coreutils` and uses `argv[0]` to determine which program to run. Since the `test-cli-extensions.sh` created a new symlink named `ostree-env`, coreutils would be confused about the utility to choose, so running it would fail: ostree-env: unknown program ‘ostree-env’ Try 'ostree-env --help' for more information. Fixes: https://github.com/ostreedev/ostree/issues/2553 --- tests/test-cli-extensions.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test-cli-extensions.sh b/tests/test-cli-extensions.sh index e1916036..edce0c9d 100755 --- a/tests/test-cli-extensions.sh +++ b/tests/test-cli-extensions.sh @@ -15,7 +15,9 @@ echo '1..2' mkdir -p ./localbin ORIG_PATH="${PATH}" export PATH="./localbin/:${PATH}" -ln -s /usr/bin/env ./localbin/ostree-env +echo '#!/bin/sh' >> ./localbin/ostree-env +echo 'env "$@"' >> ./localbin/ostree-env +chmod +x ./localbin/ostree-env export A_CUSTOM_TEST_FLAG="myvalue" ${CMD_PREFIX} ostree env >out.txt assert_file_has_content out.txt "^A_CUSTOM_TEST_FLAG=myvalue"