chroot: combine user.py and root.py into run.py (MR 2252)

These are small related utility functions, combine them together.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-05-24 04:16:00 +02:00 committed by Oliver Smith
parent 1d9bbd613e
commit cf651e56d5
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
9 changed files with 52 additions and 64 deletions

View file

@ -6,8 +6,7 @@ from pmb.core.types import Env, PmbArgs
import pytest
import pmb_test # noqa
import pmb.chroot.root
import pmb.chroot.user
import pmb.chroot.run
import pmb.helpers.run
import pmb.helpers.run_core
import pmb.helpers.logging
@ -47,7 +46,7 @@ def test_shell_escape(args: PmbArgs):
assert expected == root
assert cmd == copy
chroot_root = pmb.chroot.root(args, cmd, output_return=True)
chroot_root = pmb.chroot.run(args, cmd, output_return=True)
assert expected == chroot_root
assert cmd == copy
@ -72,7 +71,7 @@ def test_shell_escape_env(args: PmbArgs):
assert func(args, cmd, output_return=True, env=env) == ret
assert cmd == copy
func = pmb.chroot.root
func = pmb.chroot.run
assert func(args, cmd, output_return=True, env=env) == ret
assert cmd == copy