nixos/zfs: convert test to python
This commit is contained in:
parent
48508da01e
commit
40396a7e12
|
@ -7,7 +7,7 @@ with import ../lib/testing.nix { inherit system pkgs; };
|
|||
|
||||
let
|
||||
|
||||
makeTest = import ./make-test.nix;
|
||||
makeTest = import ./make-test-python.nix;
|
||||
|
||||
makeZfsTest = name:
|
||||
{ kernelPackage ? pkgs.linuxPackages_latest
|
||||
|
@ -34,12 +34,12 @@ let
|
|||
};
|
||||
|
||||
testScript = ''
|
||||
$machine->succeed("modprobe zfs");
|
||||
$machine->succeed("zpool status");
|
||||
machine.succeed("modprobe zfs")
|
||||
machine.succeed("zpool status")
|
||||
|
||||
$machine->succeed("ls /dev");
|
||||
machine.succeed("ls /dev")
|
||||
|
||||
$machine->succeed(
|
||||
machine.succeed(
|
||||
"mkdir /tmp/mnt",
|
||||
|
||||
"udevadm settle",
|
||||
|
@ -55,9 +55,7 @@ let
|
|||
"umount /tmp/mnt",
|
||||
"zpool destroy rpool",
|
||||
"udevadm settle"
|
||||
|
||||
);
|
||||
|
||||
)
|
||||
'' + extraTest;
|
||||
|
||||
};
|
||||
|
@ -70,8 +68,8 @@ in {
|
|||
unstable = makeZfsTest "unstable" {
|
||||
enableUnstable = true;
|
||||
extraTest = ''
|
||||
$machine->succeed(
|
||||
"echo password | zpool create -o altroot='/tmp/mnt' -O encryption=aes-256-gcm -O keyformat=passphrase rpool /dev/vdb1",
|
||||
machine.succeed(
|
||||
"echo password | zpool create -o altroot=\"/tmp/mnt\" -O encryption=aes-256-gcm -O keyformat=passphrase rpool /dev/vdb1",
|
||||
"zfs create -o mountpoint=legacy rpool/root",
|
||||
"mount -t zfs rpool/root /tmp/mnt",
|
||||
"udevadm settle",
|
||||
|
@ -79,7 +77,7 @@ in {
|
|||
"umount /tmp/mnt",
|
||||
"zpool destroy rpool",
|
||||
"udevadm settle"
|
||||
);
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue