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

@ -8,8 +8,7 @@ import pytest
import sys
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
@ -47,7 +46,7 @@ def test_proxy_chroot_user(args: PmbArgs, monkeypatch):
def test_proxy_chroot_root(args: PmbArgs, monkeypatch):
func = pmb.chroot.root
func = pmb.chroot.run
monkeypatch.setattr(os, "environ", {"HTTP_PROXY": "testproxy"})
ret = func(args, ["sh", "-c", 'echo "$HTTP_PROXY"'], output_return=True)
assert ret == "testproxy\n"