1 import ../make-test-python.nix (
6 meta = with pkgs.lib.maintainers; {
7 maintainers = [ nickcao ];
13 services.stratis.enable = true;
14 virtualisation.emptyDiskImages = [ 2048 ];
19 testkey1 = pkgs.writeText "testkey1" "supersecret1";
20 testkey2 = pkgs.writeText "testkey2" "supersecret2";
23 machine.wait_for_unit("stratisd")
24 # test creation of encrypted pool and filesystem
25 machine.succeed("stratis key set testkey1 --keyfile-path ${testkey1}")
26 machine.succeed("stratis key set testkey2 --keyfile-path ${testkey2}")
27 machine.succeed("stratis pool create testpool /dev/vdb --key-desc testkey1")
28 machine.succeed("stratis fs create testpool testfs")
29 # test rebinding encrypted pool
30 machine.succeed("stratis pool rebind keyring testpool testkey2")
31 # test restarting encrypted pool
32 machine.succeed("stratis pool stop --name testpool")
33 machine.succeed("stratis pool start --name testpool --unlock-method keyring")