summary refs log tree commit diff
path: root/pkgs/test
diff options
context:
space:
mode:
authornicoo <nicoo@mur.at>2023-09-14 17:30:52 +0000
committernicoo <nicoo@mur.at>2023-10-25 23:14:16 +0000
commit1cabb1c445f8d535f66fa949362b973832f2ea2f (patch)
tree015fc461b5d5e0ae60d026bee31a46986da63a7b /pkgs/test
parent87c22100a6892b864ff94476f2965a793d8e4282 (diff)
downloadnixpkgs-1cabb1c445f8d535f66fa949362b973832f2ea2f.tar
nixpkgs-1cabb1c445f8d535f66fa949362b973832f2ea2f.tar.gz
nixpkgs-1cabb1c445f8d535f66fa949362b973832f2ea2f.tar.bz2
nixpkgs-1cabb1c445f8d535f66fa949362b973832f2ea2f.tar.lz
nixpkgs-1cabb1c445f8d535f66fa949362b973832f2ea2f.tar.xz
nixpkgs-1cabb1c445f8d535f66fa949362b973832f2ea2f.tar.zst
nixpkgs-1cabb1c445f8d535f66fa949362b973832f2ea2f.zip
tests/stdenv: Check derivations with an MD5 `outputHash` fail to evaluate
Diffstat (limited to 'pkgs/test')
-rw-r--r--pkgs/test/stdenv/default.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/test/stdenv/default.nix b/pkgs/test/stdenv/default.nix
index 0fa87cccc21..3882eb2b625 100644
--- a/pkgs/test/stdenv/default.nix
+++ b/pkgs/test/stdenv/default.nix
@@ -142,6 +142,15 @@ in
     '';
   };
 
+  # Check that mkDerivation rejects MD5 hashes
+  rejectedHashes = lib.recurseIntoAttrs {
+    md5 =
+      let drv = runCommand "md5 outputHash rejected" {
+        outputHash = "md5-fPt7dxVVP7ffY3MxkQdwVw==";
+      } "true";
+      in assert !(builtins.tryEval drv).success; {};
+  };
+
   test-inputDerivation = let
     inherit (stdenv.mkDerivation {
       dep1 = derivation { name = "dep1"; builder = "/bin/sh"; args = [ "-c" ": > $out" ]; system = builtins.currentSystem; };