1# Test for https://github.com/NixOS/nixpkgs/pull/193469
2{
3 name = "early-mount-options";
4
5 nodes.machine = {
6 virtualisation.fileSystems."/var" = {
7 options = [
8 "bind"
9 "nosuid"
10 "nodev"
11 "noexec"
12 ];
13 device = "/var";
14 };
15 };
16
17 testScript = ''
18 machine.wait_for_unit("multi-user.target")
19
20 var_mount_info = machine.succeed("findmnt /var -n -o OPTIONS")
21 options = var_mount_info.strip().split(",")
22 assert "nosuid" in options and "nodev" in options and "noexec" in options
23 '';
24}