From 1b3e9563341d164fbca00cdc6d5e5c2b700953c8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 11 Sep 2024 10:12:10 +0200 Subject: [PATCH] testutil: switch `mock_command` to use `bash` This change allows use the more advanced features of bash like array operations (e.g. `${@:2}` to drop the first two arguments or similar. On fedora/rhel this is a no-op as it is already using sh -> bash (afaik). --- osbuild/testutil/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osbuild/testutil/__init__.py b/osbuild/testutil/__init__.py index 0681ff9b..5e937494 100644 --- a/osbuild/testutil/__init__.py +++ b/osbuild/testutil/__init__.py @@ -107,7 +107,7 @@ def mock_command(cmd_name: str, script: str): # will break. easy enough to fix by using \0 as the separator but # then \n in args is kinda rare fake_cmd_content = textwrap.dedent(f"""\ - #!/bin/sh -e + #!/bin/bash -e for arg in "$@"; do echo "$arg" >> {cmd_calllog_path}