tests: add fake_sudo to sshd fixture

This allows to use the same code for both testing and real-world.
This commit is contained in:
Jörg Thalheim
2025-03-28 17:46:44 +01:00
parent 2406a62ce0
commit eaf20ae09a
3 changed files with 14 additions and 9 deletions

View File

@@ -63,7 +63,7 @@ def upload(
tar.addfile(tarinfo, f)
sudo = ""
if host.user != "root" and os.environ.get("IN_PYTEST") is None:
if host.user != "root":
sudo = "sudo -- "
cmd = "rm -rf $0 && mkdir -m $1 -p $0 && tar -C $0 -xzf -"