diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/build.sh | 5 | ||||
-rw-r--r-- | tests/functional/flakes/flakes.sh | 11 | ||||
-rw-r--r-- | tests/functional/fod-failing.nix | 2 |
3 files changed, 18 insertions, 0 deletions
diff --git a/tests/functional/build.sh b/tests/functional/build.sh index 95a20dc6a..a540cf8fd 100644 --- a/tests/functional/build.sh +++ b/tests/functional/build.sh @@ -142,6 +142,8 @@ test "$(<<<"$out" grep -E '^error:' | wc -l)" = 2 <<<"$out" grepQuiet -E "hash mismatch in fixed-output derivation '.*-x1\\.drv'" <<<"$out" grepQuiet -vE "hash mismatch in fixed-output derivation '.*-x3\\.drv'" <<<"$out" grepQuiet -vE "hash mismatch in fixed-output derivation '.*-x2\\.drv'" +<<<"$out" grepQuiet -E "likely URL: https://meow.puppy.forge/puppy.tar.gz" +<<<"$out" grepQuiet -vE "likely URL: https://kitty.forge/cat.tar.gz" <<<"$out" grepQuiet -E "error: build of '.*-x[1-4]\\.drv\\^out', '.*-x[1-4]\\.drv\\^out', '.*-x[1-4]\\.drv\\^out', '.*-x[1-4]\\.drv\\^out' failed" out="$(nix build -f fod-failing.nix -L x1 x2 x3 --keep-going 2>&1)" && status=0 || status=$? @@ -151,6 +153,9 @@ test "$(<<<"$out" grep -E '^error:' | wc -l)" = 4 <<<"$out" grepQuiet -E "hash mismatch in fixed-output derivation '.*-x1\\.drv'" <<<"$out" grepQuiet -E "hash mismatch in fixed-output derivation '.*-x3\\.drv'" <<<"$out" grepQuiet -E "hash mismatch in fixed-output derivation '.*-x2\\.drv'" +<<<"$out" grepQuiet -E "likely URL: https://meow.puppy.forge/puppy.tar.gz" +<<<"$out" grepQuiet -E "likely URL: https://kitty.forge/cat.tar.gz" +<<<"$out" grepQuiet -E "likely URL: \(unknown\)" <<<"$out" grepQuiet -E "error: build of '.*-x[1-3]\\.drv\\^out', '.*-x[1-3]\\.drv\\^out', '.*-x[1-3]\\.drv\\^out' failed" out="$(nix build -f fod-failing.nix -L x4 2>&1)" && status=0 || status=$? diff --git a/tests/functional/flakes/flakes.sh b/tests/functional/flakes/flakes.sh index 68a2fd2ce..97dc6d818 100644 --- a/tests/functional/flakes/flakes.sh +++ b/tests/functional/flakes/flakes.sh @@ -366,6 +366,17 @@ nix registry pin flake1 flake3 nix registry remove flake1 [[ $(nix registry list | wc -l) == 5 ]] +# 'nix registry add' should accept flake shorthands (with or without branch or rev) +# in the from argument, but reject fully-qualified from-urls (direct or indirect). +nix registry add nixpkgz github:NixOS/nixpkgz +nix registry remove nixpkgz +nix registry add nixpkgz/branch github:NixOS/nixpkgz +nix registry remove nixpkgz/branch +nix registry add nixpkgz/branch/1db42b7fe3878f3f5f7a4f2dc210772fd080e205 github:NixOS/nixpkgz +nix registry remove nixpkgz/branch/1db42b7fe3878f3f5f7a4f2dc210772fd080e205 +! nix registry add flake:nixpkgz github:NixOS/nixpkgz +! nix registry add github:NixOS/nixpkgz github:NixOS/nixpkgz + # Test 'nix registry list' with a disabled global registry. nix registry add user-flake1 git+file://$flake1Dir nix registry add user-flake2 git+file://$flake2Dir diff --git a/tests/functional/fod-failing.nix b/tests/functional/fod-failing.nix index 37c04fe12..b63fbd900 100644 --- a/tests/functional/fod-failing.nix +++ b/tests/functional/fod-failing.nix @@ -6,6 +6,7 @@ rec { '' echo $name > $out ''; + url = "https://meow.puppy.forge/puppy.tar.gz"; outputHashMode = "recursive"; outputHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; }; @@ -15,6 +16,7 @@ rec { '' echo $name > $out ''; + urls = "https://kitty.forge/cat.tar.gz"; outputHashMode = "recursive"; outputHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; }; |