at 23.11-pre 1.2 kB view raw
1import ../make-test-python.nix ({ pkgs, ... }: 2 { 3 name = "stratis"; 4 5 meta = with pkgs.lib.maintainers; { 6 maintainers = [ nickcao ]; 7 }; 8 9 nodes.machine = { pkgs, ... }: { 10 services.stratis.enable = true; 11 virtualisation.emptyDiskImages = [ 2048 ]; 12 }; 13 14 testScript = 15 let 16 testkey1 = pkgs.writeText "testkey1" "supersecret1"; 17 testkey2 = pkgs.writeText "testkey2" "supersecret2"; 18 in 19 '' 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 testpool") 30 machine.succeed("stratis pool start --name testpool --unlock-method keyring") 31 ''; 32 })