aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2018-03-02Merge branch 'write-failure-fixes' of git://github.com/lheckemann/nixShea Levy
2018-02-26libexpr: Fix prim_replaceStrings() to work on an empty source stringTuomas Tynkkynen
Otherwise, running e.g. nix-instantiate --eval -E --strict 'builtins.replaceStrings [""] ["X"] "abc"' would just hang in an infinite loop. Found by afl-fuzz. First attempt of this was reverted in e2d71bd1862cdda because it caused another infinite loop, which is fixed now and a test added.
2018-02-22Merge branch 'fix/dry-run-partially' of https://github.com/dtzWill/nixEelco Dolstra
2018-02-21Revert "libexpr: Fix prim_replaceStrings() to work on an empty source string"Eelco Dolstra
This reverts commit 4ea9707591beceacf9988b3c185faf50da238403. It causes an infinite loop in Nixpkgs evaluation, e.g. "nix-instantiate -A hello" hung. PR #1886.
2018-02-19libexpr: Fix prim_replaceStrings() to work on an empty source stringTuomas Tynkkynen
Otherwise, running e.g. nix-instantiate --eval -E --strict 'builtins.replaceStrings [""] ["X"] "abc"' would just hang in an infinite loop. Found by afl-fuzz.
2018-02-19Merge branch 'register-settings' of https://github.com/shlevy/nixEelco Dolstra
2018-02-14Add splitVersion primop.Shea Levy
Fixes #1868.
2018-02-13Allow plugins to define new settings.Shea Levy
2018-02-13Fix plugin tests on darwinShea Levy
2018-02-13Fix #1762Linus Heckemann
nix-store --export, nix-store --dump, and nix dump-path would previously fail silently if writing the data out failed, because a) FdSink::write ignored exceptions, and b) the commands relied on FdSink's destructor, which ignores exceptions, to flush the data out. This could cause rather opaque issues with installing nixos, because nix-store --export would happily proceed even if it couldn't write its data out (e.g. if nix-store --import on the other side of the pipe failed). This commit adds tests that expose these issues in the nix-store commands, and fixes them for all three.
2018-02-13Allow includes from nix.confShea Levy
2018-02-13Merge branch 'register-constant' of https://github.com/shlevy/nixEelco Dolstra
2018-02-13Merge branch 'plugins' of https://github.com/shlevy/nixEelco Dolstra
2018-02-08Allow using RegisterPrimop to define constants.Shea Levy
This enables plugins to add new constants, as well as new primops.
2018-02-08Add plugins to make Nix more extensible.Shea Levy
All plugins in plugin-files will be dlopened, allowing them to statically construct instances of the various Register* types Nix supports.
2018-02-08nix-env: Fix parsing of --systemEelco Dolstra
https://hydra.nixos.org/build/68827814
2018-02-08dsa -> ed25519Eelco Dolstra
DSS is disabled by default in NixOS 18.03. https://hydra.nixos.org/build/68788560
2018-02-07build-dry: disable failing portion of test until issue is fixedWill Dietz
2018-02-07tests: Add (failing) tests for reported --dry-run issues.Will Dietz
2018-02-07builtins.path test: Don't rely on shlevy's XDG_RUNTIME_DIRShea Levy
2018-02-07Improve filtering of ANSI escape sequences in build logsEelco Dolstra
All ANSI sequences except color setting are now filtered out. In particular, terminal resets (such as from NixOS VM tests) are filtered out. Also, fix the completely broken tab character handling.
2018-02-07Merge pull request #1816 from shlevy/add-pathEelco Dolstra
Add path primop.
2018-02-06Add path primop.Shea Levy
builtins.path allows specifying the name of a path (which makes paths with store-illegal names now addable), allows adding paths with flat instead of recursive hashes, allows specifying a filter (so is a generalization of filterSource), and allows specifying an expected hash (enabling safe path adding in pure mode).
2018-02-06realiseContext(): Add derivation outputs to the allowed pathsEelco Dolstra
This makes import-from-derivation work in restricted mode again.
2018-02-05Fix evaluationEelco Dolstra
2018-02-03Remove nix-build --hashEelco Dolstra
Instead, if a fixed-output derivation produces has an incorrect output hash, we now unconditionally move the outputs to the path corresponding with the actual hash and register it as valid. Thus, after correcting the hash in the Nix expression (e.g. in a fetchurl call), the fixed-output derivation doesn't have to be built again. It would still be good to have a command for reporting the actual hash of a fixed-output derivation (instead of throwing an error), but "nix-build --hash" didn't do that.
2018-02-01Remove obsolete references to manifestsEelco Dolstra
Closes #323.
2018-01-24Merge pull request #1797 from dezgeg/userns-tests-fixEelco Dolstra
Fix tests using user namespaces on kernels that don't have it
2018-01-22Fix testEelco Dolstra
https://hydra.nixos.org/build/67806811
2018-01-22Don't access tarballs.nixos.org in a testEelco Dolstra
https://hydra.nixos.org/build/67806811
2018-01-19Rewrite builtin derivation environmentEelco Dolstra
Also add a test. Fixes #1803. Closes #1805.
2018-01-19Add a test for --check / --repeatEelco Dolstra
2018-01-16Add pure evaluation modeEelco Dolstra
In this mode, the following restrictions apply: * The builtins currentTime, currentSystem and storePath throw an error. * $NIX_PATH and -I are ignored. * fetchGit and fetchMercurial require a revision hash. * fetchurl and fetchTarball require a sha256 attribute. * No file system access is allowed outside of the paths returned by fetch{Git,Mercurial,url,Tarball}. Thus 'nix build -f ./foo.nix' is not allowed. Thus, the evaluation result is completely reproducible from the command line arguments. E.g. nix build --pure-eval '( let nix = fetchGit { url = https://github.com/NixOS/nixpkgs.git; rev = "9c927de4b179a6dd210dd88d34bda8af4b575680"; }; nixpkgs = fetchGit { url = https://github.com/NixOS/nixpkgs.git; ref = "release-17.09"; rev = "66b4de79e3841530e6d9c6baf98702aa1f7124e4"; }; in (import (nix + "/release.nix") { inherit nix nixpkgs; }).build.x86_64-linux )' The goal is to enable completely reproducible and traceable evaluation. For example, a NixOS configuration could be fully described by a single Git commit hash. 'nixos-rebuild' would do something like nix build --pure-eval '( (import (fetchGit { url = file:///my-nixos-config; rev = "..."; })).system ') where the Git repository /my-nixos-config would use further fetchGit calls or Git externals to fetch Nixpkgs and whatever other dependencies it has. Either way, the commit hash would uniquely identify the NixOS configuration and allow it to reproduced.
2018-01-13Fix tests using user namespaces on kernels that don't have itTuomas Tynkkynen
Disable various tests if the kernel doesn't support unprivileged user namespaces (e.g. Arch Linux disables them) or disable them via a sysctl (Debian, Ubuntu). Fixes #1521 Fixes #1625
2018-01-09fetchGit.sh: Test we don't "corrupt" cache if invoke w/o git availWill Dietz
2018-01-04Rename "use-substitutes" to "substitute"Eelco Dolstra
Commit c2154d4c8422ddc1c201d503bb52edff854af2ad renamed "build-use-substitutes" to "use-substitutes", but that broke "nix-copy-closure --use-substitutes".
2018-01-02Merge pull request #1770 from dtzWill/fix/run-test-sandbox-ubuntuEelco Dolstra
run.sh: include lib64 in sandbox-paths to fix on ubuntu 16.XX
2017-12-30run.sh: include lib64 in sandbox-paths to fix on ubuntu 16.XXWill Dietz
(cc #1769)
2017-12-30use libbrotli directly when availableWill Dietz
* Look for both 'brotli' and 'bro' as external command, since upstream has renamed it in newer versions. If neither are found, current runtime behavior is preserved: try to find 'bro' on PATH. * Limit amount handed to BrotliEncoderCompressStream to ensure interrupts are processed in a timely manner. Testing shows negligible performance impact. (Other compression sinks don't seem to require this)
2017-12-22fetchGit: Fix handling of local repo when not using 'master' branchWill Dietz
Add tests checking this behavior.
2017-12-22release.nix: Use fetchTarball and fetchGitEelco Dolstra
In particular, using fetchGit means we don't need hackery to clean the source tree when building from an unclean tree.
2017-12-07Fix testEelco Dolstra
2017-12-07nix ls-{nar,store}: Return offset of files in the NAR if knownEelco Dolstra
E.g. $ nix ls-store --json --recursive --store https://cache.nixos.org /nix/store/b0w2hafndl09h64fhb86kw6bmhbmnpm1-blender-2.79 \ | jq .entries.bin.entries.blender.narOffset 400
2017-12-05Merge branch 'fetchGit-fast-revision-update'Shea Levy
2017-11-25build-remote: Fix missing log outputaszlig
The storeUri variable in the build-remote hook is declared very much to the start of the main function and a bunch of lines later, the same variable gets checked via hasPrefix() but it gets assigned *after* that check when the most suitable machine for the build was choosen. So I guess this was just a typo in d16fd2497374671c92cb877f9570d65783a7 and what we really want is to either checkd the prefix *after* assigning storeUri or use bestMachine->storeUri directly. I choose the latter, because the former could introduce even more regressions if the try block where the variable gets assigned terminates early. Nevertheless, the reason why the log output didn't work is because hasPrefix() checked for "ssh://" in front of storeUri, but if the storeUri isn't set correctly (or at all), we don't get the log file descriptor set up properly, leading to no log output. I've adjusted the remote-builds test to include a regression test for this, so that we can make sure we get a build output when using remote builds. In addition to that I've tested this with two of my build farms and the build logs are emitted correctly again. Signed-off-by: aszlig <aszlig@nix.build>
2017-11-24nix-shell/nix-build: Support .drv files againEelco Dolstra
Fixes #1663. Also handle '!<output-name>' (#1694).
2017-11-24fetchGit: Ignore tarballTtl if rev is set and not in the repo.Shea Levy
Fixes #1697.
2017-11-21tests/run.sh: Fix /build conflict when building in a sandboxEelco Dolstra
https://hydra.nixos.org/build/64519355
2017-11-21fetchGit/fetchMercurial: Fix directory inclusion checkEelco Dolstra
E.g. the existence of .gitignore would cause .git to be included.
2017-11-20Add tests for verifying/copying content-addressed pathsEelco Dolstra
These don't require signatures.