aboutsummaryrefslogtreecommitdiff
path: root/tests/ca
diff options
context:
space:
mode:
authorregnat <rg@regnat.ovh>2021-05-05 21:00:08 +0200
committerregnat <rg@regnat.ovh>2021-05-05 21:00:08 +0200
commitbf485dcf460cd0df113c33f36c9f1f29d6e3a2d5 (patch)
treecbf07d9aed98b446e887d0432ef47356f6db67d0 /tests/ca
parentfe3a10a9b2c61ba19b24da4c93c4abc9e7583f3d (diff)
Properly normalize the content-addressed paths
Make sure that their timestamp are always normalized. Otherwise, strange − and non-deterministic − things might happen, like https://github.com/NixOS/nixpkgs/issues/121813 Fix #4775
Diffstat (limited to 'tests/ca')
-rw-r--r--tests/ca/build.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ca/build.sh b/tests/ca/build.sh
index 35bf1dcf7..c8877f87f 100644
--- a/tests/ca/build.sh
+++ b/tests/ca/build.sh
@@ -59,9 +59,17 @@ testNixCommand () {
nix build --experimental-features 'nix-command ca-derivations' --file ./content-addressed.nix --no-link
}
+# Regression test for https://github.com/NixOS/nix/issues/4775
+testNormalization () {
+ clearStore
+ outPath=$(buildAttr rootCA 1)
+ test "$(stat -c %Y $outPath)" -eq 1
+}
+
# Disabled until we have it properly working
# testRemoteCache
clearStore
+testNormalization
testDeterministicCA
clearStore
testCutoff