Skip to content

Commit

Permalink
nixos/zfs: convert test to python
Browse files Browse the repository at this point in the history
  • Loading branch information
blitz authored and Jacek Galowicz committed Nov 4, 2019
1 parent 48508da commit 40396a7
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions nixos/tests/zfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
Expand All @@ -55,9 +55,7 @@ let
"umount /tmp/mnt",
"zpool destroy rpool",
"udevadm settle"
);
)
'' + extraTest;

};
Expand All @@ -70,16 +68,16 @@ 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",
"umount /tmp/mnt",
"zpool destroy rpool",
"udevadm settle"
);
)
'';
};

Expand Down

0 comments on commit 40396a7

Please sign in to comment.