Merge pull request #315857 from mweinelt/misc-test-pathinfo-variants

nixos/tests/misc: support old and new path-info output structure
This commit is contained in:
Jörg Thalheim 2024-05-30 16:05:06 +02:00 committed by GitHub
commit 5da922e0d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -73,16 +73,19 @@ let
with subtest("nix-db"):
info = get_path_info("${foo}")
out = "${foo}"
info = get_path_info(out)
print(info)
pathinfo = info[0] if isinstance(info, list) else info[out]
if (
info[0]["narHash"]
pathinfo["narHash"]
!= "sha256-BdMdnb/0eWy3EddjE83rdgzWWpQjfWPAj3zDIFMD3Ck="
):
raise Exception("narHash not set")
if info[0]["narSize"] != 128:
if pathinfo["narSize"] != 128:
raise Exception("narSize not set")
with subtest("nixos-version"):