summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Expand)Author
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
2014-03-10tests: 'topologically-sorted' test handles different references orders....* tests/store.scm ("topologically-sorted, more difficult"): Arrange to handle a different ordering of (references %store y). Ludovic Courtès
2014-03-09store: Add #:timeout build option....* guix/serialization.scm (write-string-pairs): New procedure. * guix/store.scm (write-arg): Add 'string-pairs' case. (set-build-options): Add 'timeout' keyword parameter. Honor it. * tests/derivations.scm ("build-expression->derivation and timeout"): New test. Ludovic Courtès
2014-03-08utils: Add a non-blocking option for 'fcntl-flock'....* guix/utils.scm (F_SETLK): New variable. (fcntl-flock): Add 'wait?' keyword parameter; honor it. * tests/utils.scm ("fcntl-flock non-blocking"): New test. Ludovic Courtès
2014-03-07store: 'export-paths' doesn't export references of the given files....This fixes a regression introduced in 99fbddf9a623757e39d88bfb431f8f7d6f24b75b ("store: Change 'export-paths' to always export in topological order.") * guix/store.scm (export-paths): Define 'ordered' variable. Iterate over it. * tests/store.scm ("export/import paths, ensure topological order"): Add 'file0'. Adjust accordingly. Ludovic Courtès
2014-03-06tests: Rewrite 'fcntl-lock' test....* tests/utils.scm (temp-file): New variable. ("fcntl-flock"): Rewrite to actually test whether the child process waits for the lock to be released. The previous test was wrong because (1) it expected F_SETLK semantics, not F_SETLKW, and (2) it got EBADF because of a mismatch between the open mode and the lock style. Ludovic Courtès
2014-02-22Merge branch 'master' into core-updates...Conflicts: gnu-system.am Ludovic Courtès
2014-02-21nar: Produce archives with files sorted in C collation order....* guix/nar.scm (write-file) <directory>: Pass 'string<?' as the second argument to 'scandir'. * tests/nar.scm ("write-file puts file in C locale collation order"): New test. Ludovic Courtès
2014-02-21derivations: Add support for recursive fixed-output derivations....* guix/derivations.scm (<derivation-output>): Add 'recursive?' field. Adjust 'make-derivation-output' callers. (%read-derivation) <fixed-output>: When HASH-ALGO starts with 'r:', set the 'recursive?' field and drop 'r:' from the hash algo name. (write-derivation)[write-output]: Write the algo as 'r:HASH-ALGO' when the RECURSIVE? field is set. (derivation-hash) <fixed-output>: Prepend "r:" when RECURSIVE? is set. (fixed-output-path): New procedure. (derivation): Add #:recursive? parameter. Use 'fixed-output-path' to compute the output file name of a fixed output derivation. (build-expression->derivation): Add #:recursive? parameter. Pass it to 'derivation'. * tests/derivations.scm ("fixed-output derivation, recursive", "build-expression->derivation produces recursive fixed-output", "build-expression->derivation uses recursive fixed-output"): New tests. * doc/guix.texi (Derivations): Document #:recursive? for 'derivation'. Add #:recursive? for 'build-expression->derivation'. Ludovic Courtès
2014-02-21guix hash: Add '--recursive'....* guix/scripts/hash.scm (show-help): Add --recursive. (%options): Likewise. (guix-hash)[file-hash]: New procedure. Honor --recursive. Use it. * guix/nar.scm (write-file): Add missing field to the &nar-error condition raised upon unsupported file type; change its message to be more descriptive. * tests/guix-hash.sh: Add tests with -r. * doc/guix.texi (Invoking guix hash): Document --recursive. Ludovic Courtès
2014-02-21nar: 'write-file' can write to non-file ports....* guix/nar.scm (write-contents): Use 'sendfile' only when P is a file port. * tests/nar.scm ("write-file supports non-file output ports"): New test. Ludovic Courtès
2014-02-10store: Change 'export-paths' to always export in topological order....* guix/store.scm (export-paths): Pass PATHS through 'topologically-sorted' before iterating. * tests/store.scm ("export/import paths, ensure topological order"): New test. Ludovic Courtès
2014-02-03monads: Add 'text-file*'....* guix/monads.scm (text-file*): New procedure. * tests/monads.scm ("text-file*"): New test. * doc/guix.texi (The Store Monad): Change example since the previous one would erroneously fail to retain a reference to Coreutils. Document 'text-file*'. Ludovic Courtès
2014-01-25tests: Adjust to recent Binutils change....* tests/guix-package.sh: Refer to 'glibc:debug' instead of 'binutils:lib' since the latter no longer exists. Ludovic Courtès
2014-01-24store: Add 'topologically-sorted'....* guix/store.scm (topologically-sorted): New procedure. * tests/store.scm ("topologically-sorted, one item", "topologically-sorted, several items", "topologically-sorted, more difficult"): New tests. Ludovic Courtès
2014-01-24nar: Add 'restore-file-set', for use by build hooks....* guix/nar.scm (&nar-invalid-hash-error, &nar-signature-error): New condition types. (&nar-error): Add 'file' and 'port' fields. (&nar-read-error): Remove 'port' and 'file' fields. (lock-store-file, unlock-store-file, finalize-store-file, temporary-store-directory, restore-file-set): New procedures. * tests/nar.scm (%seed): New variable. (random-text): New procedure. ("restore-file-set (signed, valid)", "restore-file-set (missing signature)", "restore-file-set (corrupt)"): New tests. * po/Makevars (XGETTEXT_OPTIONS): Add '--keyword=message'.nar fixes * po/POTFILES.in: Add guix/nar.scm. Ludovic Courtès
2014-01-24hash: Add 'open-sha256-input-port', for Guile > 2.0.9....* guix/hash.scm (open-sha256-input-port): New procedure. * tests/hash.scm (supports-unbuffered-cbip?): New procedure. ("open-sha256-input-port, empty", "open-sha256-input-port, hello", "open-sha256-input-port, hello, one two", "open-sha256-input-port, hello, read from wrapped port"): New tests. Ludovic Courtès
2014-01-24utils: Add 'fcntl-flock'....* guix/utils.scm (%struct-flock, F_SETLKW, F_xxLCK): New variables. (fcntl-flock): New procedure. * tests/utils.scm ("fcntl-flock"): New test. Ludovic Courtès
2014-01-24store: Add 'register-path' procedure....* guix/store.scm (register-path): New procedure. * tests/store.scm ("register-path"): New test. * guix/config.scm.in (%guix-register-program): New variable. * configure.ac: Compute and substitute 'guix_sbindir'. Compute 'guix_prefix'. * pre-inst-env.in: Define 'GUIX_REGISTER'. Ludovic Courtès
2014-01-24guix-register: Support registration in the current store, without '--prefix'....* nix/guix-register/guix-register.cc (register_validity): Leave 'info.path' unmodified when PREFIX is empty. (main): Call 'settings.processEnvironment' early on. Leave 'settings.nixStore' unmodified when PREFIX is empty. Ludovic Courtès
2014-01-06archive: Add '--missing'....* guix/scripts/archive.scm (show-help, %options): Add '--missing'. (guix-archive)[lines]: New procedure. Use it to honor '--missing'. * tests/guix-archive.sh: Add tests. * doc/guix.texi (Invoking guix archive): Document '--missing'. Ludovic Courtès