aboutsummaryrefslogtreecommitdiff
path: root/kernel/src/filesystem/vfs.tests.cpp
blob: 28782ec12c3f2bb7b50ad9b3ec5761e8c98f5b76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
#include <kernel/filesystem/vfs.hpp>

#include <kernel/filesystem/open_file_descriptor.hpp>
#include <kernel/test_support/filesystem/storage_boot_module_vfs_fixture.hpp>

#include <kstd/memory>
#include <kstd/vector>

#include <catch2/catch_test_macros.hpp>

#include <cstddef>
#include <filesystem>
#include <string_view>

SCENARIO_METHOD(kernel::tests::filesystem::storage_boot_module_vfs_fixture, "VFS with dummy modules",
                "[filesystem][vfs]")
{
  GIVEN("an initialized boot module registry with multiple modules")
  {
    REQUIRE_NOTHROW(setup_modules_and_init_vfs(5));

    THEN("vfs initializes and provides /dev mount")
    {
      auto & vfs = kernel::filesystem::vfs::get();
      auto dev = vfs.open("/dev");

      REQUIRE(dev != nullptr);
    }

    THEN("vfs initializes root filesystem with boot device if boot module is present")
    {
      auto & vfs = kernel::filesystem::vfs::get();
      auto root_file = vfs.open("/");

      REQUIRE(root_file != nullptr);
    }
  }
}

SCENARIO_METHOD(kernel::tests::filesystem::storage_boot_module_vfs_fixture, "VFS with file backed image",
                "[filesystem][vfs][img]")
{
  auto const image_path_1 = std::filesystem::path{KERNEL_TEST_ASSETS_DIR} / "ext2_1KB_fs.img";
  auto const image_path_2 = std::filesystem::path{KERNEL_TEST_ASSETS_DIR} / "ext2_2KB_fs.img";
  auto const image_path_3 = std::filesystem::path{KERNEL_TEST_ASSETS_DIR} / "ext2_4KB_fs.img";

  GIVEN("a real image file")
  {
    REQUIRE(std::filesystem::exists(image_path_1));
    REQUIRE_NOTHROW(setup_modules_from_img_and_init_vfs({"test_img_module"}, {image_path_1}));

    THEN("vfs initializes and provides expected mount points")
    {
      auto & vfs = kernel::filesystem::vfs::get();
      auto root = vfs.open("/");
      auto dev = vfs.open("/dev");
      auto information = vfs.open("/information/info_1.txt");

      REQUIRE(root != nullptr);
      REQUIRE(dev != nullptr);
      REQUIRE(information != nullptr);
    }
  }

  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));
    REQUIRE(std::filesystem::exists(image_path_2));
    REQUIRE(std::filesystem::exists(image_path_3));
    REQUIRE_NOTHROW(setup_modules_from_img_and_init_vfs({"test_img_module_1", "test_img_module_2", "test_img_module_3"},
                                                        {image_path_1, image_path_2, image_path_3}));

    auto & vfs = kernel::filesystem::vfs::get();

    THEN("vfs initializes first module as root")
    {
      auto & vfs = kernel::filesystem::vfs::get();
      auto info1 = vfs.open("/information/info_1.txt");
      auto info2 = vfs.open("/information/info_2.txt");

      REQUIRE(info1 != nullptr);
      REQUIRE(info2 != nullptr);
    }

    THEN("second image can be mounted, data retrieved and unmounted again")
    {
      REQUIRE(vfs.do_mount("/dev/ram16", "/information") == kernel::filesystem::vfs::operation_result::success);

      auto mounted_monkey_1 = vfs.open("/information/monkey_house/monkey_1.txt");
      REQUIRE(mounted_monkey_1 != nullptr);
      REQUIRE(vfs.close(mounted_monkey_1->get_absolute_path().view()) ==
              kernel::filesystem::vfs::operation_result::success);

      REQUIRE(vfs.unmount("/information") == kernel::filesystem::vfs::operation_result::success);
      auto unmounted_monkey_1 = vfs.open("/information/monkey_house/monkey_1.txt");
      REQUIRE(unmounted_monkey_1 == nullptr);

      auto info_1 = vfs.open("/information/info_1.txt");
      REQUIRE(info_1 != nullptr);
    }

    THEN("third image can be mounted in a mounted file system, unmount only if no child mount exists")
    {
      REQUIRE(vfs.do_mount("/dev/ram16", "/information") == kernel::filesystem::vfs::operation_result::success);
      REQUIRE(vfs.do_mount("/dev/ram32", "/information/monkey_house/infrastructure") ==
              kernel::filesystem::vfs::operation_result::success);

      auto mounted_monkey_1 = vfs.open("/information/monkey_house/monkey_1.txt");
      auto mounted_fish1 = vfs.open("/information/monkey_house/infrastructure/enclosures/aquarium/tank_1/fish_1.txt");

      REQUIRE(mounted_monkey_1 != nullptr);
      REQUIRE(mounted_fish1 != nullptr);

      REQUIRE(vfs.close(mounted_monkey_1->get_absolute_path().view()) ==
              kernel::filesystem::vfs::operation_result::success);
      REQUIRE(vfs.close(mounted_fish1->get_absolute_path().view()) ==
              kernel::filesystem::vfs::operation_result::success);

      REQUIRE(vfs.unmount("/information") == kernel::filesystem::vfs::operation_result::unmount_failed);
      REQUIRE(vfs.unmount("/information/monkey_house/infrastructure") ==
              kernel::filesystem::vfs::operation_result::success);
      REQUIRE(vfs.unmount("/information") == kernel::filesystem::vfs::operation_result::success);
    }

    THEN("images can be stacked mounted and correct file system is unmounted again")
    {
      REQUIRE(vfs.do_mount("/dev/ram16", "/information") == kernel::filesystem::vfs::operation_result::success);
      REQUIRE(vfs.do_mount("/dev/ram32", "/information") == kernel::filesystem::vfs::operation_result::success);

      auto mounted_tickets = vfs.open("/information/entrance/tickets.txt");
      REQUIRE(mounted_tickets != nullptr);

      REQUIRE(vfs.close(mounted_tickets->get_absolute_path().view()) ==
              kernel::filesystem::vfs::operation_result::success);

      REQUIRE(vfs.unmount("/information") == kernel::filesystem::vfs::operation_result::success);
      mounted_tickets = vfs.open("/information/entrance/tickets.txt");
      REQUIRE(mounted_tickets == nullptr);

      auto mounted_monkey = vfs.open("/information/monkey_house/monkey_1.txt");
      REQUIRE(mounted_monkey != nullptr);
    }

    THEN("image can be mounted on / file opened and unmounted again")
    {
      auto info_1 = vfs.open("/information/info_1.txt");
      REQUIRE(info_1 != nullptr);

      REQUIRE(vfs.do_mount("/dev/ram16", "/") == kernel::filesystem::vfs::operation_result::success);

      info_1 = vfs.open("/information/info_1.txt");
      REQUIRE(info_1 == nullptr);

      auto water = vfs.open("/monkey_house/infrastructure/water.txt");
      REQUIRE(water != nullptr);

      REQUIRE(vfs.close(water->get_absolute_path().view()) == kernel::filesystem::vfs::operation_result::success);

      REQUIRE(vfs.unmount("/") == kernel::filesystem::vfs::operation_result::success);

      info_1 = vfs.open("/information/info_1.txt");
      REQUIRE(info_1 != nullptr);
    }

    THEN("image can be mounted on / just the boot root has /dev")
    {
      auto info_1 = vfs.open("/information/info_1.txt");
      REQUIRE(info_1 != nullptr);

      REQUIRE(vfs.do_mount("/dev/ram16", "/") == kernel::filesystem::vfs::operation_result::success);

      info_1 = vfs.open("/information/info_1.txt");
      REQUIRE(info_1 == nullptr);

      auto water = vfs.open("/monkey_house/infrastructure/water.txt");
      REQUIRE(water != nullptr);

      REQUIRE(vfs.close(water->get_absolute_path().view()) == kernel::filesystem::vfs::operation_result::success);

      auto dev_ram_16 = vfs.open("/dev/ram16");
      REQUIRE(dev_ram_16 == nullptr);

      REQUIRE(vfs.do_mount("/dev/ram32", "/") == kernel::filesystem::vfs::operation_result::non_existent_path);

      REQUIRE(vfs.unmount("/") == kernel::filesystem::vfs::operation_result::success);

      auto dev_ram_32 = vfs.open("/dev/ram32");
      REQUIRE(dev_ram_32 != nullptr);
    }

    THEN("boot root can be unmounted and remounted again but /dev is not re-grafted")
    {
      auto info_1 = vfs.open("/information/info_1.txt");
      REQUIRE(info_1 != nullptr);

      REQUIRE(vfs.close(info_1->get_absolute_path().view()) == kernel::filesystem::vfs::operation_result::success);

      REQUIRE(vfs.unmount("/dev") == kernel::filesystem::vfs::operation_result::success);
      REQUIRE(vfs.unmount("/") == kernel::filesystem::vfs::operation_result::success);

      info_1 = vfs.open("/information/info_1.txt");
      REQUIRE(info_1 == nullptr);

      REQUIRE(vfs.do_mount("/dev/ram0", "/") == kernel::filesystem::vfs::operation_result::success);

      info_1 = vfs.open("/information/info_1.txt");
      REQUIRE(info_1 != nullptr);

      auto dev_ram_0 = vfs.open("/dev/ram0");
      REQUIRE(dev_ram_0 == nullptr);
    }

    THEN("mount with null file system fails")
    {
      REQUIRE(vfs.do_mount("/closed.txt", "/information") ==
              kernel::filesystem::vfs::operation_result::invalid_filesystem);
    }

    THEN("mount with invalid path fails")
    {
      REQUIRE(vfs.do_mount("/dev/ram16", "") == kernel::filesystem::vfs::operation_result::invalid_path);
      REQUIRE(vfs.do_mount("/dev/ram16", "information") ==
              kernel::filesystem::vfs::operation_result::mount_point_not_found);
    }

    THEN("mount with non-existent source path fails")
    {
      REQUIRE(vfs.do_mount("/dev/nonexistent", "/information") ==
              kernel::filesystem::vfs::operation_result::non_existent_path);
    }

    THEN("mount with non-existent mount point fails")
    {
      REQUIRE(vfs.do_mount("/dev/ram16", "/information/nonexistent") ==
              kernel::filesystem::vfs::operation_result::mount_point_not_found);
    }

    THEN("unmount with invalid path fails")
    {
      REQUIRE(vfs.unmount("") == kernel::filesystem::vfs::operation_result::invalid_path);
      REQUIRE(vfs.unmount("information") == kernel::filesystem::vfs::operation_result::mount_point_not_found);
    }

    THEN("unmounting non-existent mount point returns expected error code")
    {
      REQUIRE(vfs.unmount("/information/nonexistent") ==
              kernel::filesystem::vfs::operation_result::mount_point_not_found);
    }

    THEN("a file can be access if . in the path")
    {
      auto info_1 = vfs.open("/information/./info_1.txt");
      REQUIRE(info_1 != nullptr);
    }

    THEN("a file can be accessed within the same mount if path contains .. ")
    {
      auto info_1 = vfs.open("/archiv/../information/info_1.txt");
      REQUIRE(info_1 != nullptr);

      auto img = vfs.open("/archiv/../information/../archiv/2024.img");
      REQUIRE(img != nullptr);
    }

    THEN("a file can be accessed over multiple mounts if path contains .. or . ")
    {
      REQUIRE(vfs.do_mount("/dev/ram16", "/information") == kernel::filesystem::vfs::operation_result::success);

      auto img = vfs.open("/information/monkey_house/caretaker/../../../../../../archiv/2024.img");
      REQUIRE(img != nullptr);

      auto dev_32 = vfs.open("/information/monkey_house/caretaker/../../../dev/ram32");
      REQUIRE(dev_32 != nullptr);

      auto water = vfs.open("/information/./monkey_house/infrastructure/water.txt");
      REQUIRE(water != nullptr);
    }

    THEN("a file can be accessed over multiple mounts (device and file) if path contains .. ")
    {
      REQUIRE(vfs.do_mount("/dev/ram16", "/information") == kernel::filesystem::vfs::operation_result::success);
      REQUIRE(vfs.do_mount("/archiv/2024.img", "/information/monkey_house/infrastructure") ==
              kernel::filesystem::vfs::operation_result::success);

      auto pig_1 = vfs.open("/information/monkey_house/infrastructure/stable/pig_1.txt");
      REQUIRE(pig_1 != nullptr);

      auto isabelle =
          vfs.open("/information/monkey_house/infrastructure/stable/../../../monkey_house/caretaker/isabelle.txt");
      REQUIRE(isabelle != nullptr);

      auto closed = vfs.open("/information/monkey_house/infrastructure/stable/../../../../closed.txt");
      REQUIRE(closed != nullptr);
    }
  }

  GIVEN("A real image file containing as filesystem formatted files")
  {
    REQUIRE(std::filesystem::exists(image_path_1));
    REQUIRE_NOTHROW(setup_modules_from_img_and_init_vfs({"test_img_module_1"}, {image_path_1}));

    THEN("the file-filesystem in the image can be mounted, files can be read and unmounted again")
    {
      auto & vfs = kernel::filesystem::vfs::get();
      REQUIRE(vfs.do_mount("/archiv/2024.img", "/information") == kernel::filesystem::vfs::operation_result::success);

      auto info_1 = vfs.open("/information/info_1.txt");
      REQUIRE(info_1 == nullptr);

      auto dentry = vfs.open("/information/sheep_1.txt");
      REQUIRE(dentry != nullptr);
      auto sheep_1_ofd = kstd::make_shared<kernel::filesystem::open_file_descriptor>(dentry);

      kstd::vector<std::byte> buffer(7);
      auto bytes_read = sheep_1_ofd->read(buffer.data(), buffer.size());
      std::string_view buffer_as_str{reinterpret_cast<char *>(buffer.data()), bytes_read};
      REQUIRE(buffer_as_str == "sheep_1");

      REQUIRE(vfs.close(dentry->get_absolute_path().view()) == kernel::filesystem::vfs::operation_result::success);

      REQUIRE(vfs.unmount("/information") == kernel::filesystem::vfs::operation_result::success);
      auto unmounted_sheep_1 = vfs.open("/information/sheep_1.txt");
      REQUIRE(unmounted_sheep_1 == nullptr);
    }

    THEN("the file-filesystem in the image can be mounted and in this filesystem can another file-filesystem be "
         "mounted, files can be read and unmounted again")
    {
      auto & vfs = kernel::filesystem::vfs::get();
      REQUIRE(vfs.do_mount("/archiv/2024.img", "/information") == kernel::filesystem::vfs::operation_result::success);
      REQUIRE(vfs.do_mount("/archiv/2025.img", "/information/stable") ==
              kernel::filesystem::vfs::operation_result::success);

      auto sheep_1 = vfs.open("/information/sheep_1.txt");
      auto goat_1 = vfs.open("/information/stable/petting_zoo/goat_1.txt");
      REQUIRE(sheep_1 != nullptr);
      REQUIRE(goat_1 != nullptr);

      auto sheep_1_ofd = kstd::make_shared<kernel::filesystem::open_file_descriptor>(sheep_1);
      auto goat_1_ofd = kstd::make_shared<kernel::filesystem::open_file_descriptor>(goat_1);

      kstd::vector<std::byte> sheep_buffer(7);
      auto bytes_read = sheep_1_ofd->read(sheep_buffer.data(), sheep_buffer.size());
      std::string_view buffer_as_str{reinterpret_cast<char *>(sheep_buffer.data()), bytes_read};
      REQUIRE(buffer_as_str == "sheep_1");

      kstd::vector<std::byte> goat_buffer(6);
      bytes_read = goat_1_ofd->read(goat_buffer.data(), goat_buffer.size());
      buffer_as_str = std::string_view{reinterpret_cast<char *>(goat_buffer.data()), bytes_read};
      REQUIRE(buffer_as_str == "goat_1");

      REQUIRE(vfs.close(sheep_1->get_absolute_path().view()) == kernel::filesystem::vfs::operation_result::success);
      REQUIRE(vfs.close(goat_1->get_absolute_path().view()) == kernel::filesystem::vfs::operation_result::success);

      REQUIRE(vfs.unmount("/information") == kernel::filesystem::vfs::operation_result::unmount_failed);

      REQUIRE(vfs.unmount("/information/stable") == kernel::filesystem::vfs::operation_result::success);
      auto unmounted_goat_1 = vfs.open("/information/stable/petting_zoo/goat_1.txt");
      REQUIRE(unmounted_goat_1 == nullptr);

      auto still_mounted_sheep_1 = vfs.open("/information/sheep_1.txt");
      REQUIRE(still_mounted_sheep_1 != nullptr);

      REQUIRE(vfs.close(still_mounted_sheep_1->get_absolute_path().view()) ==
              kernel::filesystem::vfs::operation_result::success);

      REQUIRE(vfs.unmount("/information") == kernel::filesystem::vfs::operation_result::success);
      auto unmounted_sheep_1 = vfs.open("/information/sheep_1.txt");
      REQUIRE(unmounted_sheep_1 == nullptr);
    }
  }

  GIVEN("A real image files, containing symbolic links")
  {
    REQUIRE(std::filesystem::exists(image_path_1));
    REQUIRE_NOTHROW(setup_modules_from_img_and_init_vfs({"test_img_module_1"}, {image_path_1}));

    THEN("file can be opened through absolute symbolic link")
    {
      auto & vfs = kernel::filesystem::vfs::get();
      auto info_1 = vfs.open("/symlinks/info_1_absolute");
      REQUIRE(info_1 != nullptr);
    }

    THEN("file can be opened through relative symbolic link")
    {
      auto & vfs = kernel::filesystem::vfs::get();
      auto info_1 = vfs.open("/symlinks/info_1_relative");
      REQUIRE(info_1 != nullptr);
    }

    THEN("file can be opened through symbolic link pointing absolute to the directory containing the file")
    {
      auto & vfs = kernel::filesystem::vfs::get();
      auto info_1 = vfs.open("/symlinks/information_directory_absolute/info_1.txt");
      REQUIRE(info_1 != nullptr);
    }

    THEN("file can be opened through symbolic link pointing relative to the directory containing the file")
    {
      auto & vfs = kernel::filesystem::vfs::get();
      auto info_1 = vfs.open("/symlinks/information_directory_relative/info_1.txt");
      REQUIRE(info_1 != nullptr);
    }

    THEN("symbolic link with path traversing back to the root")
    {
      auto & vfs = kernel::filesystem::vfs::get();
      auto info_1 = vfs.open("/symlinks/traverse_back_5_times/information/info_1.txt");
      REQUIRE(info_1 != nullptr);
    }

    THEN("symbolic link containing an invalid absolute path is handled correctly")
    {
      auto & vfs = kernel::filesystem::vfs::get();
      auto invalid_symlink = vfs.open("/symlinks/invalid_absolute");
      REQUIRE(invalid_symlink == nullptr);
    }

    THEN("symbolic link containing an invalid relative path is handled correctly")
    {
      auto & vfs = kernel::filesystem::vfs::get();
      auto invalid_symlink = vfs.open("/symlinks/invalid_relative");
      REQUIRE(invalid_symlink == nullptr);
    }

    THEN("circular symbolic links are detected and handled correctly")
    {
      auto & vfs = kernel::filesystem::vfs::get();
      auto circular_symlink = vfs.open("/symlinks/symloop_a");
      REQUIRE(circular_symlink == nullptr);
    }
  }

  GIVEN("A real image file containing as filesystem formatted files and this filesystem contains a symbolic link")
  {
    REQUIRE(std::filesystem::exists(image_path_1));
    REQUIRE_NOTHROW(setup_modules_from_img_and_init_vfs({"test_img_module_1"}, {image_path_1}));

    auto & vfs = kernel::filesystem::vfs::get();
    vfs.do_mount("/archiv/2024.img", "/information");

    THEN("file can be opened through symbolic link pointing to the parent filesystem")
    {
      auto closed_file = vfs.open("/information/symlinks/traverse_back_twice/closed.txt");
      REQUIRE(closed_file != nullptr);
    }
  }

  GIVEN("Two real images, one containing a symbolic link leaving and reentering filesystem again")
  {
    REQUIRE(std::filesystem::exists(image_path_1));
    REQUIRE(std::filesystem::exists(image_path_2));
    REQUIRE_NOTHROW(
        setup_modules_from_img_and_init_vfs({"test_img_module_1", "test_img_module_2"}, {image_path_1, image_path_2}));

    auto & vfs = kernel::filesystem::vfs::get();
    vfs.do_mount("/dev/ram16", "/information");

    THEN("file can be opened through symbolic link pointing to the parent filesystem and back into the mounted "
         "filesystem again")
    {
      auto monkey_1 = vfs.open("/information/symlinks/leave_and_reenter_mount/monkey_1.txt");
      REQUIRE(monkey_1 != nullptr);
    }
  }

  GIVEN("One real image containing a very long symbolic link")
  {
    REQUIRE(std::filesystem::exists(image_path_3));
    REQUIRE_NOTHROW(setup_modules_from_img_and_init_vfs({"test_img_module_3"}, {image_path_3}));

    auto & vfs = kernel::filesystem::vfs::get();

    THEN("file can be opened through symbolic link with a long path")
    {
      auto fish_30 = vfs.open("/symlinks/very_long_symlink");
      REQUIRE(fish_30 != nullptr);
    }
  }

  GIVEN("One real image containing a valid symbolic link chain")
  {
    REQUIRE(std::filesystem::exists(image_path_3));
    REQUIRE_NOTHROW(setup_modules_from_img_and_init_vfs({"test_img_module_3"}, {image_path_3}));

    auto & vfs = kernel::filesystem::vfs::get();

    THEN("file can be opened through symbolic link chain")
    {
      auto map = vfs.open("/symlinks/symlink_chain_1/map.txt");
      REQUIRE(map != nullptr);
    }
  }
}