nixos/tests/btrbk-section-order.nix: fix test
This commit is contained in:
parent
54aac082a4
commit
b3475a9eef
@ -29,10 +29,12 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
|||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
|
import difflib
|
||||||
machine.wait_for_unit("basic.target")
|
machine.wait_for_unit("basic.target")
|
||||||
got = machine.succeed("cat /etc/btrbk/local.conf")
|
got = machine.succeed("cat /etc/btrbk/local.conf").strip()
|
||||||
expect = """
|
expect = """
|
||||||
backend btrfs-progs-sudo
|
backend btrfs-progs-sudo
|
||||||
|
stream_compress no
|
||||||
timestamp_format long
|
timestamp_format long
|
||||||
target ssh://global-target/
|
target ssh://global-target/
|
||||||
ssh_user root
|
ssh_user root
|
||||||
@ -46,6 +48,9 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
|||||||
ssh_user root
|
ssh_user root
|
||||||
""".strip()
|
""".strip()
|
||||||
print(got)
|
print(got)
|
||||||
|
if got != expect:
|
||||||
|
diff = difflib.unified_diff(expect.splitlines(keepends=True), got.splitlines(keepends=True), fromfile="expected", tofile="got")
|
||||||
|
print("".join(diff))
|
||||||
assert got == expect
|
assert got == expect
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user