summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Expand)Author
2014-07-06build: Get the canonical $HOME name when testing 'guix package'....* tests/guix-package.sh (HOME): Recompute using 'pwd -P'. Ludovic Courtès
2014-07-05build: Support running the test suite from a directory with symlinks....Fixes <http://bugs.gnu.org/17935>. Reported by Alex Kost <alezost@gmail.com>. * test-env.in: Canonicalize $NIX_STORE_DIR, and remove $NIX_IGNORE_SYMLINK_STORE setting. * tests/guix-register.sh: Likewise, canonicalize $new_store_dir and $new_store and leave $NIX_IGNORE_SYMLINK_STORE unchanged. Ludovic Courtès
2014-07-05guix package: Do the right thing for '-p ~/.guix-profile'....Fixes <http://bugs.gnu.org/17939>. Reported by Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>. * guix/scripts/package.scm (canonicalize-profile): New procedure. (%options): Use it for --profile. * tests/guix-package.sh: Add test. Ludovic Courtès
2014-06-27guix {system,offload}: Improve reporting of syntax errors....* guix/scripts/system.scm (read-operating-system) <catch handler>: Add case for 'syntax-error'. Correct message for default case. * guix/scripts/offload.scm (build-machines) <catch handler>: Add case for 'syntax-error'. * tests/guix-system.sh: New file. * Makefile.am (SH_TESTS): Add it. Ludovic Courtès
2014-06-16tests: Use the C locale for 'guix package -s'....* tests/guix-package.sh: Set LC_MESSAGES=C before the 'guix package -s' test. Ludovic Courtès
2014-06-14guix build: Allow gexps to be passed to '-e'....* guix/ui.scm (%guix-user-module): New variable. (read/eval): Pass it as the second argument to 'eval'. * guix/scripts/build.scm (options/resolve-packages): Add case for 'gexp?'. * tests/guix-build.sh: Add tests. * doc/guix.texi (Invoking guix build): Document '-e gexp'. guxi build: Allow gexps to be passed to '-e'. * guix/ui.scm (%guix-user-module): New variable. (read/eval): Pass it as the second argument to 'eval'. * guix/scripts/build.scm (options/resolve-packages): Add case for 'gexp?'. * tests/guix-build.sh: Add tests. * doc/guix.texi (Invoking guix build): Document '-e gexp'. Ludovic Courtès
2014-06-04tests: Skip tests that would hit the shebang length limitation....* tests/gexp.scm (shebang): New variable. Skip "gexp->script" when SHEBANG is longer than 127 chars. * guix/gexp.scm (gexp->script): Add comment on the issue. Ludovic Courtès
2014-06-01derivations: Add #:allowed-references 'derivation' parameter....* guix/derivations.scm (derivation): Add #:allowed-references parameter. [user+system-env-vars]: Honor it. * tests/derivations.scm ("derivation #:allowed-references, ok", "derivation #:allowed-references, not allowed", "derivation #:allowed-references, self allowed", "derivation #:allowed-references, self not allowed"): New tests. * doc/guix.texi (Derivations): Document #:allowed-references. Ludovic Courtès
2014-05-27syscalls: Be more permissive in 'umount' test....* tests/syscalls.scm ("umount, ENOENT"): Rename to... ("umount, ENOENT/EPERM"): ... this. Accept EPERM as a valid return value. Ludovic Courtès
2014-05-19ui: Gracefully deal with zero-output derivations....* guix/ui.scm (show-what-to-build)[built-or-substitutable?]: New procedure. Check whether OUT is #f. Use it. * tests/ui.scm ("show-what-to-build, zero outputs"): New test. Ludovic Courtès
2014-05-10Add (guix build syscalls)....* guix/build/syscalls.scm, tests/syscalls.scm: New files. * Makefile.am (MODULES): Add guix/build/syscalls.scm. (SCM_TESTS): Add tests/syscalls.scm. * guix/utils.scm (%libc-errno-pointer, errno): Remove; take from (guix build syscalls). Ludovic Courtès
2014-05-01gexp: Add support for 'origin?' objects in 'ungexp' forms....* guix/gexp.scm (lower-inputs, gexp-inputs, gexp->sexp, canonicalize-reference): Add 'origin?' case. * guix/monads.scm (origin->derivation): New procedure. * tests/gexp.scm ("one input origin"): New test. Ludovic Courtès
2014-04-28monads: Hide 'derivation-expression' and 'lower-inputs'....* guix/monads.scm: Unexport 'lower-inputs' and 'derivation-expression'. (text-file*): Add comment about the switch to 'gexp->derivation'. (lower-inputs): Add comment about its doom. (derivation-expression): Likewise. * guix/gexp.scm (lower-inputs*): Rename to... (lower-inputs): ... this. Update callers. * tests/monads.scm (derivation-expression): New procedure. * doc/guix.texi (The Store Monad): Use 'gexp->derivation' instead of 'derivation-expression'. Remove documentation of 'derivation-expression'. * guix/ui.scm (read/eval): Use THE-ROOT-MODULE so that macros are properly expanded. * tests/guix-build.sh: Use 'gexp->derivation' instead of 'derivation-expression'.monads: Hide 'derivation-expression' and 'lower-inputs'. Ludovic Courtès
2014-04-28store: (direct-store-path? (%store-prefix)) returns #f....* guix/store.scm (direct-store-path?): Return #f if PATH is (%store-prefix). * tests/store.scm ("direct-store-path?"): Add test. Ludovic Courtès
2014-04-28Add (guix gexp)....* guix/gexp.scm: New file. * tests/gexp.scm: New file. * Makefile.am (MODULES): Add guix/gexp.scm. (SCM_TESTS): Add tests/gexp.scm. * doc/guix.texi (Derivations): Add #:inputs in 'derivation' example. Mark 'build-expression->derivation' as deprecated, refer to "G-Expressions". Remove paragraph about code strata. (G-Expressions): New node. Ludovic Courtès
2014-04-22authenticate: Allow signatures with binary data to be written to stdout....Fixes <http://bugs.gnu.org/17312>. * guix/scripts/authenticate.scm (guix-authenticate): Add calls to 'set-port-encoding!' and 'set-port-conversion-strategy!'. Wrap body in 'with-fluids' form that sets '%default-port-encoding' and '%default-port-conversion-strategy'. * tests/guix-authenticate.sh: Add test. * tests/pk-crypto.scm ("hash corrupt due to restrictive locale encoding"): Add reference to bug. Ludovic Courtès
2014-04-22pk-crypto: Use ISO-8859-1 for strings passed to 'gcry_sexp_new'....* guix/pk-crypto.scm (string->canonical-sexp): Pass "ISO-8859-1" as the 2nd argument to 'string->pointer'. * tests/pk-crypto.scm ("version"): New test. ("hash corrupt due to restrictive locale encoding"): New test. Ludovic Courtès
2014-04-14offload: '{send,receive}-files' wait for completion of the transfer....Fixes situations where the remote 'guix build' is invoked before the .drv has been completely copied, as reported at <https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00174.html>. In some cases 'send-files' would return before the other end is done importing the files, and so the subsequent 'guix build' invocation would just miss the .drv file it refers to. * guix/utils.scm (call-with-decompressed-port): Don't close PORT. (call-with-compressed-output-port): Likewise. * tests/utils.scm ("compressed-output-port + decompressed-port"): Adjust accordingly. * guix/scripts/offload.scm (send-files): Add explicit (close-pipe pipe) call. (retrieve-files): Likewise. Ludovic Courtès
2014-04-13derivations: Fix 'fixed-output-derivation?'....Reported by Nikita Karetnikov <nikita@karetnikov.org>. * guix/derivations.scm (fixed-output-derivation?): Fix pattern. * tests/derivations.scm ("fixed-output-derivation?"): Add test. Ludovic Courtès
2014-04-12store: Add 'add-permanent-root' and 'remove-permanent-root'....* guix/store.scm (add-indirect-root): Improve docstring. (%gc-roots-directory): New variable. (add-permanent-root, remove-permanent-root): New procedures. * tests/store.scm ("permanent root"): New test. Ludovic Courtès
2014-04-08ui: Add 'size->number'....* guix/scripts/gc.scm (size->number): Remove. * guix/ui.scm (size->number): New procedure. * tests/ui.scm ("size->number, bytes", "size->number, MiB", "size->number, GiB", "size->number, 1.2GiB", "size->number, invalid unit"): New tests. Ludovic Courtès
2014-04-07tests: Avoid buffering in 'fcntl-flock' tests....Partially fixes <http://bugs.gnu.org/17212>. * tests/utils.scm ("fcntl-flock wait", "fcntl-flock non-blocking"): Open files in binary mode, with no buffering. Ludovic Courtès
2014-04-02tests: Add 'union-build' test for <http://bugs.gnu.org/17083>....* tests/union.scm ("union-build with symlink to directory"): New test. Ludovic Courtès
2014-04-02union: Rewrite to be faster; handle symlink/directory conflicts....* guix/build/union.scm: Rewrite; only 'file=?' remains unchanged. Remove 'tree-union' and 'delete-duplicate-leaves' exports. Merge inputs in a breadth-first fashion. Follow symlinks for purposes of making decisions about the merge. * tests/union.scm: Remove tests of 'tree-union' and 'delete-duplicate-leaves'. Mark H Weaver
2014-04-02guix package: Register non-default profiles as GC roots....* guix/scripts/package.scm (maybe-register-gc-root): New procedure. * tests/guix-package.sh (profile): Grep the output of "guix gc --list-live" in a couple of places. Ludovic Courtès
2014-03-31Use 'signature-case' in (guix nar) and 'substitute-binary'....* guix/nar.scm (restore-file-set)[assert-valid-signature]: Rewrite in terms of 'signature-case'. * guix/scripts/substitute-binary.scm (narinfo-signature->canonical-sexp): Call 'leave' instead of 'raise' when SIGNATURE is invalid. (&nar-signature-error, &nar-invalid-hash-error): Remove. (assert-valid-signature): Add 'narinfo' parameter; remove 'port'. Rewrite in terms of 'signature-case' and 'leave'. Mention NARINFO's URI in error messages. Adjust caller. (narinfo-sha256): New procedure. (assert-valid-narinfo): Use it. (valid-narinfo?): Rewrite using 'narinfo-sha256' and 'signature-case'. * tests/substitute-binary.scm (assert-valid-signature, test-error-condition): Remove. ("corrupt signature data", "unauthorized public key", "invalid signature"): Remove. Ludovic Courtès
2014-03-31pki: Add 'signature-case' macro....* guix/pki.scm (%signature-status): New procedure. (signature-case): New macro. * tests/pki.scm (%secret-key, %alternate-secret-key): New variables. ("signature-case valid-signature", "signature-case invalid-signature", "signature-case hash-mismatch", "signature-case unauthorized-key", "signature-case corrupt-signature"): New tests. Ludovic Courtès
2014-03-30tests: Test the error output of 'substitute-binary'....* tests/substitute-binary.scm (test-error*): Rename to... (test-quit): ... this. Add 'error-rx' parameter and honor it. ("not a number", "wrong version number", "substitute, no signature", "substitute, invalid hash", "substitute, unauthorized key"): Adjust accordingly. Ludovic Courtès
2014-03-30tests: Add more signed substitute tests....* tests/substitute-binary.scm (%narinfo): Set 'URL', 'Compression', and 'NarHash'. (call-with-narinfo): Create 'example.out' and 'example.nar'. ("query narinfo without signature", "substitute, no signature", "substitute, authorized key"): New tests. Ludovic Courtès
2014-03-30tests: Simplify 'substitute-binary' tests; reduce use of global variables....* tests/substitute-binary.scm (signature-body): Change 'str' parameter to 'bv', and expect it to be a bytevector. (%signature-body, %wrong-signature, %acl): Remove. (signature): Rename to... (signature-field): ... this. Add 'bv-or-str' parameter. Change 'str' parameter to #:version. Add #:public-key parameter. Call 'signature-body' directly. Change domain part of the signature to 'example.gnu.org'. ("not a number", "wrong version number", "valid narinfo-signature->canonical-sexp"): Use 'signature-field' instead of 'signature' or %SIGNATURE. (test-error-condition): Add 'message-rx' parameter and honor it. ("corrupt signature data", "unauthorized public key", "invalid signature"): Adjust accordingly. (narinfo, %signed-narinfo): Remove. ("query narinfo with invalid hash"): Use '%narinfo' and 'signature-field' instead of 'narinfo' and '%signature'. ("query narinfo signed with authorized key", "query narinfo signed with unauthorized key", "substitute, invalid hash", "substitute, unauthorized key"): Likewise. Ludovic Courtès
2014-03-30tests: Make sure the daemon reports substitute hash mismatches....* tests/store.scm ("substitute, corrupt output hash"): New test. Ludovic Courtès
2014-03-30substitute-binary: Defer narinfo authentication and authorization checks....* guix/scripts/substitute-binary.scm (narinfo-signature->canonical-sexp): Catch 'gcry-error' around 'string->canonical-sexp' call, and re-raise as a SRFI-35 &message and &nar-signature-error. (narinfo-maker): Handle when SIGNATURE is #f or an invalid canonical sexp. (&nar-signature-error, &nar-invalid-hash-error): New variables. (assert-valid-signature): Use them. Expect 'signature' to be a canonical sexp. (read-narinfo): Remove authentication and authorization checks. (%signature-line-rx): New variable. (assert-valid-narinfo, valid-narinfo?): New procedures. (guix-substitute-binary): Wrap body in 'with-error-handling'. [valid?]: New procedure. <--query>: Show only store items of narinfos that match 'valid-narinfo?'. <--substitute>: Call 'assert-valid-narinfo'. * tests/substitute-binary.scm (test-error*): Use 'test-equal'. (%keypair): Remove. (%public-key, %private-key): Load from signing-key.{pub,sec}. (signature-body): Add #:public-key parameter. (call-with-narinfo): New procedure. (with-narinfo): New macro. ("corrupt signature data", "unauthorized public key", "invalid signature"): Make the first argument to 'assert-valid-signature' a canonical sexp. ("invalid hash", "valid read-narinfo", "valid write-narinfo"): Remove. ("query narinfo with invalid hash", "query narinfo signed with authorized key", "query narinfo signed with unauthorized key", "substitute, invalid hash", "substitute, unauthorized key"): New tests. Ludovic Courtès
2014-03-30substitute-binary: Support the Signature field of a narinfo file....* guix/scripts/substitute-binary.scm (<narinfo>): Add the 'signature' and 'contents' fields. (narinfo-signature->canonical-sexp): New function. (narinfo-maker): Add the 'signature' argument and use it. (assert-valid-signature): New function. (read-narinfo): Support the Signature field. (write-narinfo): Use 'narinfo-contents'. (%allow-unauthenticated-substitutes?): New variable. * guix/base64.scm, tests/base64.scm, tests/substitute-binary.scm: New files. * Makefile.am (SCM_TESTS): Add tests/base64.scm and tests/substitute-binary.scm. (MODULES): Add guix/base64.scm. * test-env.in: Set 'GUIX_ALLOW_UNAUTHENTICATED_SUBSTITUTES'. Nikita Karetnikov
2014-03-29tests: Make sure 'guix archive --import' succeeds....* tests/guix-archive.sh: Check the exit value of 'guix archive --import'. Ludovic Courtès
2014-03-27daemon: Add tests for substitutes and --no-substitutes....* tests/guix-daemon.sh: Add substituter tests. Ludovic Courtès
2014-03-26Merge branch 'core-updates'Ludovic Courtès
2014-03-24utils: Add 'call-with-decompressed-port' and 'call-with-compressed-output-port'....* guix/utils.scm (call-with-decompressed-port, call-with-compressed-output-port): New procedures. * tests/utils.scm ("compressed-output-port + decompressed-port"): Rewrite to use them. Ludovic Courtès
2014-03-24utils: Add 'filtered-output-port' and 'compressed-output-port'....* guix/utils.scm (filtered-output-port, compressed-output-port): New procedures. * tests/utils.scm ("compressed-output-port + decompressed-port"): New test. Ludovic Courtès
2014-03-22tests: Make sure substitutes are usable when we need them....* tests/derivations.scm ("derivation-prerequisites-to-build and substitutes"): Add call to 'set-build-options'. Ludovic Courtès
2014-03-22authenticate: Support reading the hash or key from stdin....* guix/scripts/authenticate.scm (guix-authenticate): Add clauses for ("rsautl" "-sign" "-inkey" key) and ("rsautl" "-verify" "-inkey" _ "-pubin"). * tests/guix-authenticate.sh (hash): Add test using -sign and -verify in a pipeline. Ludovic Courtès
2014-03-22utils: Add 'decompressed-port' and 'compressed-port'....* guix/utils.scm (decompressed-port, compressed-port): New procedures. * guix/scripts/substitute-binary.scm (decompressed-port): Remove. (guix-substitute-binary): Pass a symbol or #f as the first argument to 'decompress-port'. * tests/utils.scm ("compressed-port, decompressed-port, non-file"): New test. Ludovic Courtès
2014-03-22utils: 'filtered-port' doesn't leave dangling processes behind....* guix/utils.scm (filtered-port): Make sure the 'execl' child process always exits, and does (primitive-_exit 1) upon execution failure. Use 'primitive-_exit' in the 'dump-port' child process. * tests/utils.scm ("filtered-port, does not exist"): New test. Ludovic Courtès
2014-03-22Merge branch 'master' into core-updatesMark H Weaver
2014-03-20pk-crypto: Don't use Ed25519 when libgcrypt is older than 1.6.0....* guix/pk-crypto.scm (gcrypt-version): New procedure. * guix/scripts/archive.scm (%key-generation-parameters): New variable. (%options) <generate-key>: Use it. * tests/pk-crypto.scm ("sign + verify, Ed25519"): Skip if using gcrypt < 1.6.0. Ludovic Courtès
2014-03-19pk-crypto: Use RFC6979 when signing with an ECC or DSA key....* guix/pk-crypto.scm (bytevector->hash-data): Add #:key-type parameter. Use the 'pkcs1' flag when KEY-TYPE is 'rsa', and 'rfc6979' when KEY-TYPE is 'ecc' or 'dsa'. (key-type): New procedure. * guix/scripts/authenticate.scm (read-hash-data): Add 'key-type' parameter. Pass it to 'bytevector->hash-data'. Adjust caller accordingly. * tests/pk-crypto.scm (%ecc-key-pair): New variable. ("key-type"): New test. ("sign + verify"): Pass #:key-type to 'bytevector->hash-data'. ("sign + verify, Ed25519"): New test. Ludovic Courtès
2014-03-19tests: Test recovery from 'valid-path?' RPCs with an invalid parameter....* tests/store.scm ("valid-path? live", "valid-path? false", "valid-path? error", "valid-path? recovery"): New tests. Ludovic Courtès
2014-03-17build: Fix test failures due to the nix -> guix directory name change....Reported by Nikita Karetnikov <nikita@karetnikov.org> and Pierre-Antoine Rault <par@rigelk.eu>. * test-env.in: Change 'NIX_LOG_DIR' in accordance with f5768af. * tests/guix-register.sh: Likewise for 'NIX_LOG_DIR' and 'NIX_DB_DIR'. Ludovic Courtès
2014-03-17Merge branch 'master' into core-updatesLudovic Courtès
2014-03-14store: Add 'hash-part->path'....* guix/store.scm (hash-part->path): New procedure. * tests/store.scm ("hash-part->path"): New test. Ludovic Courtès
2014-03-10Merge branch 'master' into core-updatesLudovic Courtès