[elbe-devel] [PATCH 6/9] elbepack: shellhelper: fix chroot doctest

Thomas Weißschuh thomas.weissschuh at linutronix.de
Fri Mar 21 14:31:30 CET 2025


The current tests succeeds because it is executed as regular user which is not
allowed to execute chroot. When running as root the tests fail.

Fix it by making it fail consistently. This is not a strong test but not worse
than the current state.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/shellhelper.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elbepack/shellhelper.py b/elbepack/shellhelper.py
index 8cedf4867ce1820bba58f5b19e2c09923bc8d94e..2605a70002a7570bbe9aa3da2f48158464908d5a 100644
--- a/elbepack/shellhelper.py
+++ b/elbepack/shellhelper.py
@@ -145,7 +145,7 @@ def chroot(directory, cmd, /, *, env_add=None, **kwargs):
     >>> import sys
     >>> from elbepack.log import open_logging
     >>> cleanup = open_logging(streams=sys.stdout)
-    >>> chroot("/", "true") # doctest: +ELLIPSIS
+    >>> chroot("/", "false") # doctest: +ELLIPSIS
     Traceback (most recent call last):
     ...
     subprocess.CalledProcessError: ...

-- 
2.48.1



More information about the elbe-devel mailing list