1 # This tests validates the order of generated sections that may contain
3 # When a `volume` section has both `subvolume` and `target` children,
4 # `target` must go before `subvolume`. Otherwise, `target` will become
5 # a child of the last `subvolume` instead of `volume`, due to the
6 # order-sensitive config format.
8 # Issue: https://github.com/NixOS/nixpkgs/issues/195660
9 import ./make-test-python.nix ({ lib, pkgs, ... }: {
10 name = "btrbk-section-order";
11 meta.maintainers = with lib.maintainers; [ oxalica ];
13 nodes.machine = { ... }: {
14 services.btrbk.instances.local = {
17 timestamp_format = "long";
18 target."ssh://global-target/".ssh_user = "root";
20 snapshot_dir = "/volume-snapshots";
21 target."ssh://volume-target/".ssh_user = "root";
22 subvolume."@subvolume" = {
23 snapshot_dir = "/subvolume-snapshots";
24 target."ssh://subvolume-target/".ssh_user = "root";
32 machine.wait_for_unit("basic.target")
33 got = machine.succeed("cat /etc/btrbk/local.conf")
35 backend btrfs-progs-sudo
37 target ssh://global-target/
40 snapshot_dir /volume-snapshots
41 target ssh://volume-target/
44 snapshot_dir /subvolume-snapshots
45 target ssh://subvolume-target/