aboutsummaryrefslogtreecommitdiff
path: root/kernel/src/filesystem/vfs.tests.cpp
diff options
context:
space:
mode:
authorLukas Oesch <lukasoesch20@gmail.com>2026-05-12 12:00:40 +0200
committerLukas Oesch <lukasoesch20@gmail.com>2026-05-12 12:00:40 +0200
commit91821da0110e05724640903434c3d85fc3d02466 (patch)
treefd1e83b1ccab6603374f2c134c8a3691b83164c9 /kernel/src/filesystem/vfs.tests.cpp
parentfee33c0b2e2ab91a008bec16e143fba755b51974 (diff)
downloadkernel-91821da0110e05724640903434c3d85fc3d02466.tar.xz
kernel-91821da0110e05724640903434c3d85fc3d02466.zip
if the boot_root_fs contains a /dev directory, vfs mounts the devfs onto the existing directory
Diffstat (limited to 'kernel/src/filesystem/vfs.tests.cpp')
-rw-r--r--kernel/src/filesystem/vfs.tests.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/src/filesystem/vfs.tests.cpp b/kernel/src/filesystem/vfs.tests.cpp
index 8e4cb70..add96aa 100644
--- a/kernel/src/filesystem/vfs.tests.cpp
+++ b/kernel/src/filesystem/vfs.tests.cpp
@@ -62,6 +62,23 @@ SCENARIO_METHOD(kernel::tests::filesystem::storage_boot_module_vfs_fixture, "VFS
}
}
+ GIVEN("a real image file containing a /dev directory")
+ {
+ REQUIRE(std::filesystem::exists(image_path_2));
+ REQUIRE_NOTHROW(setup_modules_from_img_and_init_vfs({"test_img_module_2"}, {image_path_2}));
+
+ THEN("vfs hides the image's /dev behind the devfs mount")
+ {
+ auto & vfs = kernel::filesystem::vfs::get();
+
+ auto image_1 = vfs.open("/dev/image_1.txt");
+ REQUIRE(image_1 == nullptr);
+
+ auto dev = vfs.open("/dev/ram0");
+ REQUIRE(dev != nullptr);
+ }
+ }
+
GIVEN("three real image files")
{
REQUIRE(std::filesystem::exists(image_path_1));