From 1d8864a4970b1a2a1c4ccb8ced20e17259ed21e3 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 18 Jul 2023 13:47:05 +0200 Subject: [PATCH] test: Fix fuser invocation in directory cleanup stdout gets captured by Machine.execute(). Write the fuser output to stderr so that we can actually see it. Also cover the directory itself, not just its contents. --- test/common/testlib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/common/testlib.py b/test/common/testlib.py index d330d867e2a5..16be9cdff668 100644 --- a/test/common/testlib.py +++ b/test/common/testlib.py @@ -2049,7 +2049,7 @@ def restore_dir(self, path: str, post_restore_action: Optional[str] = None, rebo if path.startswith("/home"): cmd = f"umount -lf {path}" else: - cmd = f"umount {path} || {{ fuser -uvk {path}/* || true; sleep 1; umount {path}; }}" + cmd = f"umount {path} || {{ fuser -uvk {path} {path}/* >&2 || true; sleep 1; umount {path}; }}" self.addCleanup(self.machine.execute, cmd) def restore_file(self, path: str, post_restore_action: Optional[str] = None):