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).
This commit is contained in:
Michael Vogt 2024-09-11 10:12:10 +02:00 committed by Simon de Vlieger
parent a3e32f3823
commit 1b3e956334

View file

@ -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}