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