1 import ./make-test-python.nix (
8 # data base is stored in memory
9 # server may crash with default memory size
10 virtualisation.memorySize = 1024;
12 services.saunafs.master = {
16 "* / rw,alldirs,maproot=0:0"
24 virtualisation.emptyDiskImages = [ 4096 ];
25 boot.initrd.postDeviceCommands = ''
26 ${pkgs.e2fsprogs}/bin/mkfs.ext4 -L data /dev/vdb
29 fileSystems = pkgs.lib.mkVMOverride {
31 device = "/dev/disk/by-label/data";
37 masterHost = "master";
43 # The test image is too small and gets set to "full"
44 settings.HDD_LEAVE_SPACE_DEFAULT = "100M";
53 masterHost = "master";
54 metalogger.enable = true;
61 services.saunafs.client.enable = true;
62 # systemd.tmpfiles.rules = [ "d /sfs 755 root root -" ];
63 systemd.network.enable = true;
65 # Use networkd to have properly functioning
66 # network-online.target
74 requires = [ "network-online.target" ];
75 after = [ "network-online.target" ];
76 wantedBy = [ "remote-fs.target" ];
88 meta.maintainers = [ lib.maintainers.markuskowa ];
91 inherit master metalogger;
92 chunkserver1 = chunkserver;
93 chunkserver2 = chunkserver;
99 # prepare master server
101 master.wait_for_unit("multi-user.target")
102 master.succeed("sfsmaster-init")
103 master.succeed("systemctl restart sfs-master")
104 master.wait_for_unit("sfs-master.service")
106 metalogger.wait_for_unit("sfs-metalogger.service")
109 for chunkserver in [chunkserver1, chunkserver2]:
110 chunkserver.wait_for_unit("multi-user.target")
111 chunkserver.succeed("chown saunafs:saunafs /data")
112 chunkserver.succeed("systemctl restart sfs-chunkserver")
113 chunkserver.wait_for_unit("sfs-chunkserver.service")
115 for client in [client1, client2]:
116 client.wait_for_unit("multi-user.target")
118 client1.succeed("echo test > /sfs/file")
119 client2.succeed("grep test /sfs/file")