]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-fs-util: don't fail on btrfs file systems in containers
authorLennart Poettering <lennart@poettering.net>
Tue, 19 May 2020 10:10:11 +0000 (12:10 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 19 May 2020 10:11:12 +0000 (12:11 +0200)
Fixes: #15821
src/test/test-fs-util.c

index d005b3e8e5f640d564091b6789669fa69f2c09cd..e144551eb75e49bfbedb7857b93122881e1fb0f6 100644 (file)
@@ -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));