mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-11 23:50:05 +01:00
also test zfs filesystem options
This commit is contained in:
parent
05a90d4227
commit
57b7c5506a
2 changed files with 22 additions and 0 deletions
|
|
@ -12,11 +12,16 @@
|
||||||
zroot = {
|
zroot = {
|
||||||
type = "zpool";
|
type = "zpool";
|
||||||
mode = "mirror";
|
mode = "mirror";
|
||||||
|
rootFsOptions = {
|
||||||
|
compression = "lz4";
|
||||||
|
"com.sun:auto-snapshot" = "false";
|
||||||
|
};
|
||||||
datasets = [
|
datasets = [
|
||||||
{
|
{
|
||||||
type = "zfs_filesystem";
|
type = "zfs_filesystem";
|
||||||
name = "zfs_fs";
|
name = "zfs_fs";
|
||||||
mountpoint = "/zfs_fs";
|
mountpoint = "/zfs_fs";
|
||||||
|
options."com.sun:auto-snapshot" = "true";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
type = "zfs_filesystem";
|
type = "zfs_filesystem";
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,23 @@ makeDiskoTest {
|
||||||
disko-config = import ../example/zfs.nix;
|
disko-config = import ../example/zfs.nix;
|
||||||
extraTestScript = ''
|
extraTestScript = ''
|
||||||
machine.succeed("test -b /dev/zvol/zroot/zfs_testvolume");
|
machine.succeed("test -b /dev/zvol/zroot/zfs_testvolume");
|
||||||
|
|
||||||
|
def assert_property(ds, property, expected_value):
|
||||||
|
out = machine.succeed(f"zfs get -H {property} {ds} -o value").rstrip()
|
||||||
|
assert (
|
||||||
|
out == expected_value
|
||||||
|
), f"Expected {property}={expected_value} on {ds}, got: {out}"
|
||||||
|
|
||||||
|
assert_property("zroot", "compression", "lz4")
|
||||||
|
assert_property("zroot/zfs_fs", "compression", "lz4")
|
||||||
|
assert_property("zroot", "com.sun:auto-snapshot", "false")
|
||||||
|
assert_property("zroot/zfs_fs", "com.sun:auto-snapshot", "true")
|
||||||
|
assert_property("zroot/zfs_testvolume", "volsize", "10M")
|
||||||
|
|
||||||
|
# FIXME: we cannot mount rootfs yet
|
||||||
|
#machine.succeed("mountpoint /mnt");
|
||||||
|
machine.succeed("mountpoint /mnt/zfs_fs");
|
||||||
|
machine.succeed("mountpoint /mnt/zfs_legacy_fs");
|
||||||
machine.succeed("mountpoint /mnt/ext4onzfs");
|
machine.succeed("mountpoint /mnt/ext4onzfs");
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue