nixos/borgbackup: add test
We had problems to get borg's own test suite running. This test is intended to perform a quick smoke test to see whether we have missed not any important dependency necessary to create backups with borg. tested with: $ nix-build nixos/release.nix -A tests.borgbackup.x86_64-linux
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import ./make-test.nix ({ pkgs, ...}: {
|
||||
name = "borgbackup";
|
||||
meta = with pkgs.stdenv.lib.maintainers; {
|
||||
maintainers = [ mic92 ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
machine = { config, pkgs, ... }: {
|
||||
environment.systemPackages = [ pkgs.borgbackup ];
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
my $borg = "BORG_PASSPHRASE=supersecret borg";
|
||||
$machine->succeed("$borg init --encryption=repokey /tmp/backup");
|
||||
$machine->succeed("mkdir /tmp/data/ && echo 'data' >/tmp/data/file");
|
||||
$machine->succeed("$borg create --stats /tmp/backup::test /tmp/data");
|
||||
$machine->succeed("$borg extract /tmp/backup::test");
|
||||
$machine->succeed('c=$(cat data/file) && echo "c = $c" >&2 && [[ "$c" == "data" ]]');
|
||||
'';
|
||||
})
|
||||
Reference in New Issue
Block a user