1 import ./make-test-python.nix ({ lib, pkgs, ... }:
3 name = "btrbk-no-timer";
4 meta.maintainers = with lib.maintainers; [ oxalica ];
6 nodes.machine = { ... }: {
7 environment.systemPackages = with pkgs; [ btrfs-progs ];
8 services.btrbk.instances.local = {
10 settings.volume."/mnt" = {
11 snapshot_dir = "btrbk/local";
12 subvolume = "to_backup";
20 # Create btrfs partition at /mnt
21 machine.succeed("truncate --size=128M /data_fs")
22 machine.succeed("mkfs.btrfs /data_fs")
23 machine.succeed("mkdir /mnt")
24 machine.succeed("mount /data_fs /mnt")
25 machine.succeed("btrfs subvolume create /mnt/to_backup")
26 machine.succeed("mkdir -p /mnt/btrbk/local")
28 # The service should not have any triggering timer.
29 unit = machine.get_unit_info('btrbk-local.service')
30 assert "TriggeredBy" not in unit
32 # Manually starting the service should still work.
33 machine.succeed("echo foo > /mnt/to_backup/bar")
34 machine.start_job("btrbk-local.service")
35 machine.wait_until_succeeds("cat /mnt/btrbk/local/*/bar | grep foo")