summaryrefslogtreecommitdiff
path: root/src/test/test-fs-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-05-19 12:10:11 +0200
committerLennart Poettering <lennart@poettering.net>2020-05-19 12:11:12 +0200
commitf8838c6c2f841701ab41c85b346958445bb0825d (patch)
tree18f2b3c654341ec7404cf33a7f84068318f2aa3d /src/test/test-fs-util.c
parent44dcb318cc44c0830ec9ebfbf35eca2b3f67f9fd (diff)
downloadsystemd-f8838c6c2f841701ab41c85b346958445bb0825d.tar.gz
test-fs-util: don't fail on btrfs file systems in containers
Fixes: #15821
Diffstat (limited to 'src/test/test-fs-util.c')
-rw-r--r--src/test/test-fs-util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/test-fs-util.c b/src/test/test-fs-util.c
index d005b3e8e5..e144551eb7 100644
--- a/src/test/test-fs-util.c
+++ b/src/test/test-fs-util.c
@@ -850,6 +850,12 @@ static void test_path_is_encrypted_one(const char *p, int expect) {
int r;
r = path_is_encrypted(p);
+ if (r == -ENOENT) /* This might fail, if btrfs is used and we run in a container. In that case we
+ * cannot resolve the device node paths that BTRFS_IOC_DEV_INFO returns, because
+ * the device nodes are unlikely to exist in the container. But if we can't stat()
+ * them we cannot determine the dev_t of them, and thus cannot figure out if they
+ * are enrypted. Hence let's just ignore ENOENT here. */
+ return;
assert_se(r >= 0);
printf("%s encrypted: %s\n", p, yes_no(r));