1 import ./make-test-python.nix ({pkgs, lib, ...}:
4 client = { pkgs, ... } : {
5 environment.systemPackages = [ pkgs.glusterfs ];
6 virtualisation.fileSystems =
8 { device = "server1:/gv0";
14 server = { pkgs, ... } : {
15 networking.firewall.enable = false;
16 services.glusterfs.enable = true;
18 # create a mount point for the volume
19 boot.initrd.postDeviceCommands = ''
20 ${pkgs.e2fsprogs}/bin/mkfs.ext4 -L data /dev/vdb
23 virtualisation.emptyDiskImages = [ 1024 ];
25 virtualisation.fileSystems =
27 { device = "/dev/disk/by-label/data";
43 server1.wait_for_unit("glusterd.service")
44 server2.wait_for_unit("glusterd.service")
46 server1.wait_until_succeeds("gluster peer status")
47 server2.wait_until_succeeds("gluster peer status")
49 # establish initial contact
50 server1.succeed("gluster peer probe server2")
51 server1.succeed("gluster peer probe server1")
53 server1.succeed("gluster peer status | grep Connected")
56 server1.succeed("mkdir -p /data/vg0")
57 server2.succeed("mkdir -p /data/vg0")
58 server1.succeed("gluster volume create gv0 server1:/data/vg0 server2:/data/vg0")
59 server1.succeed("gluster volume start gv0")
62 client1.wait_for_unit("gluster.mount")
63 client2.wait_for_unit("gluster.mount")
65 client1.succeed("echo test > /gluster/file1")
66 client2.succeed("grep test /gluster/file1")