mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-11 23:50:05 +01:00
fix mdadm mounting, move test to mdadm test
This commit is contained in:
parent
6b0b20da18
commit
1237ac36db
3 changed files with 5 additions and 4 deletions
|
|
@ -137,7 +137,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
mount.devices = q: x: let
|
mount.devices = q: x: let
|
||||||
z = foldl' recursiveUpdate {} (mapAttrsToList (name: mount-f { device = "/dev/${name}"; }) x.content);
|
z = foldl' recursiveUpdate {} (mapAttrsToList (name: mount-f { device = "/dev/${name}"; inherit name; }) x.content);
|
||||||
# attrValues returns values sorted by name. This is important, because it
|
# attrValues returns values sorted by name. This is important, because it
|
||||||
# ensures that "/" is processed before "/foo" etc.
|
# ensures that "/" is processed before "/foo" etc.
|
||||||
in ''
|
in ''
|
||||||
|
|
@ -168,8 +168,9 @@ let
|
||||||
|
|
||||||
mount.noop = q: x: {};
|
mount.noop = q: x: {};
|
||||||
|
|
||||||
|
mount.mdadm = q: x:
|
||||||
|
mount-f { device = "/dev/md/${q.name}"; } x.content;
|
||||||
# TODO maybe we need to do something here?
|
# TODO maybe we need to do something here?
|
||||||
mount.mdadm = mount.noop;
|
|
||||||
mount.mdraid = mount.noop;
|
mount.mdraid = mount.noop;
|
||||||
|
|
||||||
mount.partition = q: x:
|
mount.partition = q: x:
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,6 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -7,7 +7,7 @@ let
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
inherit (pkgs) system;
|
inherit (pkgs) system;
|
||||||
};
|
};
|
||||||
disko-config = import ../example/raid.nix;
|
disko-config = import ../example/mdadm.nix;
|
||||||
tsp-create = pkgs.writeScript "create" ((pkgs.callPackage ../. {}).create disko-config);
|
tsp-create = pkgs.writeScript "create" ((pkgs.callPackage ../. {}).create disko-config);
|
||||||
tsp-mount = pkgs.writeScript "mount" ((pkgs.callPackage ../. {}).mount disko-config);
|
tsp-mount = pkgs.writeScript "mount" ((pkgs.callPackage ../. {}).mount disko-config);
|
||||||
in makeTest' {
|
in makeTest' {
|
||||||
|
|
@ -34,5 +34,6 @@ in makeTest' {
|
||||||
machine.succeed("${tsp-mount}");
|
machine.succeed("${tsp-mount}");
|
||||||
machine.succeed("${tsp-mount}"); # verify that the command is idempotent
|
machine.succeed("${tsp-mount}"); # verify that the command is idempotent
|
||||||
machine.succeed("test -b /dev/md/raid1");
|
machine.succeed("test -b /dev/md/raid1");
|
||||||
|
machine.succeed("grep -qs '/mnt/raid' /proc/mounts");
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue