summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2015-09-15lint: Add 'check-texinfo-markup' checker.Mathieu Lirzin
* guix/script/lint.scm (check-description-style): Check for invalid Texinfo markup. * tests/lint.scm: Test it.
2015-09-14guix: lint: Check for meaningful origin file names.Eric Bavier
* guix/scripts/lint.scm (check-source-file-name): New procedure. (%checkers): Add 'source-file-name' checker. * tests/lint.scm ("source-file-name", "source-file-name: v prefix") ("source-file-name: valid", "source-file-name: bad checkout") ("source-file-name: good checkout"): New tests. * doc/guix.texi (Invoking guix lint): Mention file name check.
2015-09-14guix: packages: Add origin-actual-file-name.Eric Bavier
* guix/scripts/graph.scm (uri->file-name, node-full-name): Move origin file name logic to... * guix/packages.scm (origin-actual-file-name): ...here. * tests/packages.scm ("origin-actual-file-name") ("origin-actual-file-name, file-name"): New tests.
2015-09-10guix: packages: Add transitive-input-references.Eric Bavier
* guix/packages.scm (transitive-input-references): New procedure. * gnu/packages/version-control.scm (package-transitive-propagated-labels*) (package-propagated-input-refs): Delete. (git)[arguments]: Adjust to transitive-input-references.
2015-09-06lint: Add 'license' checker.Ludovic Courtès
* guix/scripts/lint.scm (check-license): New procedure. (%checkers): Add 'license' checker. * tests/lint.scm ("license: invalid license"): New test.
2015-09-05tests: Fix typos.Ludovic Courtès
* tests/derivations.scm ("substitutable-derivation?", "derivation-prerequisites-to-build and substitutes, local build"): Fix harmless typos.
2015-09-04monads: Fix 'liftN' fallback case.Ludovic Courtès
Reported by Andy Wingo <wingo@igalia.com>. * guix/monads.scm (define-lift) <fallback case>: Add missing #'. Remove extra formal parameter. * tests/monads.scm ("lift"): Add test with 'lift1' as a procedure.
2015-09-02graph: Add '--expression'.Ludovic Courtès
* guix/scripts/graph.scm (%options, show-help): Add '--expression'. (guix-graph): Call 'read/eval-package-expression' for 'expression' pairs in OPTS. * tests/guix-graph.sh: Add tests. * doc/guix.texi (Invoking guix graph): Document it.
2015-09-01import: gem: Fix minor bug and add unit test.David Thompson
* guix/import/gem.scm (make-gem-sexp): Properly handle an empty list of licenses. When rendering a list of licenses, cons 'list onto the front of the expression. * tests/gem.scm: New file. * Makefile.am (SCM_TESTS): Add it.
2015-08-31import: Add 'cran' importer.Ricardo Wurmus
* guix/import/cran.scm: New file. * guix/scripts/import.scm: Add "cran" to 'importers'. * guix/scripts/import/cran.scm: New file. * tests/cran.scm: New file. * Makefile.am (MODULES): Add 'guix/import/cran.scm' and 'guix/scripts/import/cran.scm'. (SCM_TESTS): Add 'tests/cran.scm'. * doc/guix.texi (Invoking guix import): Document it. * po/guix/POTFILES.in: Add 'guix/scripts/import/cran.scm'.
2015-08-27tests: Skip 'set-network-interface-address' test when running as root.Ludovic Courtès
Reported by Eric Hanchrow <eric.hanchrow@gmail.com> in <http://bugs.gnu.org/21354>. * tests/syscalls.scm ("set-network-interface-address"): Skip when (getuid) returns zero.
2015-08-27Add 'guix graph'.Ludovic Courtès
* guix/scripts/graph.scm, tests/graph.scm, tests/guix-graph.sh, doc/images/coreutils-bag-graph.dot, doc/images/coreutils-graph.dot: New files. * Makefile.am (MODULES): Add guix/scripts/graph.scm. (SH_TESTS): Add tests/guix-graph.sh. (SCM_TESTS): Add tests/graph.scm. * doc.am (DOT_FILES, DOT_VECTOR_GRAPHICS): New variables. (EXTRA_DIST): Use them. (dist_infoimage_DATA): Use $(DOT_FILES). (pdf-local, info-local, ps-local): Likewise. * doc/guix.texi (Packages with Multiple Outputs): Add cross-reference to 'guix graph'. (Invoking guix gc): Likewise. (Invoking guix graph): New section.
2015-08-27gexp: Add 'lower-object'.Ludovic Courtès
* guix/gexp.scm (lower-object): New procedure. (lower-inputs, lower-references, gexp->sexp): Use it. * tests/gexp.scm ("lower-object"): New test. * doc/guix.texi (G-Expressions): Document it.
2015-08-26tests: Work around Btrfs handling of nlink for empty directories.Ludovic Courtès
Fixes <http://bugs.gnu.org/21280>. Reported by Leo Famulari <leo@famulari.name>. * tests/nar.scm (file-tree-equal?): Use #t as the initial result. Btrfs would set nlink to 1 instead of 2 for an empty directory, thereby leading 'file-tree-equal?' to return #f.
2015-08-19scripts: package: Add --install-from-file option.David Thompson
* guix/scripts/package.scm (show-help): Add help text for --install-from-file option. (%options): Add --install-from-file option. * tests/guix-package.sh: Test it. * doc/guix.texi ("invoking guix package"): Document it. * doc/package-hello.scm: New file. * doc.am (EXTRA_DIST): Add it.
2015-08-19lint: Add 'formatting' checker.Ludovic Courtès
* guix/scripts/lint.scm (report-tabulations, report-trailing-white-space, report-long-line, report-formatting-issues, check-formatting): New procedures. (%formatting-reporters): New variable. (%checkers): Add 'formatting' checker. * tests/lint.scm ("formatting: tabulation", "formatting: trailing white space", "formatting: long line", "formatting: alright"): New tests. * doc/guix.texi (Invoking guix lint): Mention the 'formatting' checker.
2015-08-11tests: containers: Skip if setgroups file does not exist.David Thompson
Fixes bug #21226. Linux 3.19 introduced a fix for a security vulnerability in user namespaces. This fix introduced a new proc file called 'setgroups' and was backported to many older kernels. However, some users run a kernel that is new enough to support user namespaces yet old enough to not include the patch, so we must skip the tests. * tests/containers.scm: Skip all tests if /proc/self/setgroups does not exist.
2015-08-08build: container: Add #:host-uids argument to call-with-container.David Thompson
It's not always possible to map 65536 uids when creating a container as the root user within another user namespace. This is true when building Guix within the build daemon's container. By using a uid range of 1 by default, even as the root user, the tests now pass. * gnu/build/linux-container.scm (initialize-user-namespace, run-container): Add 'host-uids' argument. (call-with-container): Add #:host-uids keyword argument. * tests/containers.scm ("container-excursion"): Update 'run-container' call.
2015-07-25syscalls: Add 'network-interfaces', which wraps libc's 'getifaddrs'.Ludovic Courtès
Based on discussions with Rohan Prinja <rohan.prinja@gmail.com>. * guix/build/syscalls.scm (<interface>): New record type. (write-interface, values->interface, unfold-interface-list, network-interfaces, free-ifaddrs): New procedures. (ifaddrs): New C struct. (%struct-ifaddrs-type, %sizeof-ifaddrs): New macros. * tests/syscalls.scm ("network-interfaces returns one or more interfaces", "network-interfaces returns \"lo\""): New tests.
2015-07-25syscalls: Rename 'network-interfaces' and 'all-network-interfaces'.Ludovic Courtès
* guix/build/syscalls.scm (network-interfaces): Rename to... (network-interface-names): ... this. (all-network-interfaces): Rename to... (all-network-interface-names): ... this. * gnu/services/networking.scm (dhcp-client-service): Adjust accordingly. * tests/syscalls.scm ("all-network-interfaces"): Rename to... ("all-network-interface-names"): ... this, and adjust accordingly. ("network-interfaces"): Rename to... ("network-interface-names"): ... this, and adjust accordingly.
2015-07-20tests: Skip container tests if namespaces are not available.David Thompson
* tests/containers.scm: Skip all tests if user namespaces do not exist.
2015-07-20tests: Make #:references-graphs gexp test more tolerant.Ludovic Courtès
* tests/gexp.scm ("gexp->derivation #:references-graphs"): Use 'lset=' instead of 'equal?' since the order in which references are listed in not guaranteed.
2015-07-19Merge branch 'master' into core-updatesMark H Weaver
2015-07-18tests: Fix 'publish' test for nix-base32 format.Alex Kost
This is a followup to commit 3b307162e892e0050836434b12e14376758419cc. * tests/publish.scm ("/*.narinfo"): Use 'bytevector->nix-base32-string', not 'bytevector->base32-string'.
2015-07-16file-systems: 'uuid' raises a syntax error for invalid UUIDs.Ludovic Courtès
* gnu/system/file-systems.scm (uuid): Call 'syntax-violation' when 'string->uuid' returns #f. * tests/file-systems.scm ("uuid, syntax error"): New test.
2015-07-15Merge branch 'master' into core-updatesMark H Weaver
2015-07-14file-systems: Allow users to specify file system UUIDs as strings.Ludovic Courtès
Fixes <http://bugs.gnu.org/19778>. Reported by Mark H Weaver <mhw@netris.org>. * gnu/system/file-systems.scm (%uuid-rx): New variable. (string->uuid): New procedure. (uuid): New macro. * tests/file-systems.scm: New file. * Makefile.am (SCM_TESTS): Add it. * doc/guix.texi (File Systems): Give an example of UUID.
2015-07-13substitute: Honor "substitute-urls" option passed by "untrusted" clients.Ludovic Courtès
* guix/scripts/substitute.scm (or*): New macro. (%cache-url): Honor "untrusted-substitute-urls". * guix/tests.scm (%test-substitute-urls): New variable. (open-connection-for-tests): Use it. * tests/derivations.scm ("derivation-prerequisites-to-build and substitutes", "derivation-prerequisites-to-build and substitutes, non-substitutable build", "derivation-prerequisites-to-build and substitutes, local build"): Pass it to 'set-build-options'. * tests/guix-daemon.sh: Likewise. * tests/store.scm ("substitute query, alternating URLs"): New test. ("substitute query", "substitute", "substitute + build-things with output path", "substitute, corrupt output hash", "substitute --fallback"): Pass #:substitute-urls to 'set-build-options'.
2015-07-13substitute: Store cached narinfo in cache-specific sub-directories.Ludovic Courtès
This ensures that switching between different substitute servers doesn't lead to a polluted narinfo cache. * guix/scripts/substitute.scm (narinfo-cache-file): Add 'cache-url' parameter. Add the base32 of CACHE-URL as a sub-directory under %NARINFO-CACHE-DIRECTORY. Update callers. (cached-narinfo): Likewise. Call 'mkdir-p' on the dirname of the cache file. Update callers. (remove-expired-cached-narinfos): Add 'directory' parameter and use it instead of %NARINFO-CACHE-DIRECTORY. (narinfo-cache-directories): New procedure. (maybe-remove-expired-cached-narinfo): Call 'remove-expired-cached-narinfos' for each item returned by 'narinfo-cache-directories'.
2015-07-12packages: Rewrite 'transitive-inputs' to be linear and remove duplicates.Ludovic Courtès
There were two issues: 1. Use of 'delete-duplicates', which is quadratic, was a serious problem for closures with lots of propagated inputs, such as that of the 'hydra' package (several minutes for 'guix build hydra -n'!). 2. The 'delete-duplicates' call essentially had no effect since duplicate inputs typically had a different label and were thus kept. For instance, (bag-transitive-inputs (package->bag inkscape)) would return 216 items whereas (delete-duplicates (map cdr THAT)) contains only 67 items. The new implementation returns 67 items in this case. For 'hydra', we're down from 42211 items to 361, and roughly 13s for 'guix build hydra'. * guix/packages.scm (transitive-inputs): Rewrite as a breadth-first traversal. Remove duplicate propagated inputs. * tests/packages.scm ("package-transitive-inputs", "package->bag, propagated inputs"): Adjust to use simple labels for propagated inputs, without "/". ("package-transitive-inputs, no duplicates"): New test.
2015-07-12tests: Adjust tests for new bootstrap Guile.Ludovic Courtès
This is a followup to commit 5d6792f ("gnu: bootstrap: Create a wrapper for guile to set the system load path.") * tests/size.scm ("store-profile"): Expect profile of 'bash' bootstrap binary. * tests/gexp.scm ("gexp->derivation #:references-graphs"): Expect GUILE-DRV to depend on 'bash' bootstrap binary.
2015-07-10tests: Skip namespace-related tests when that feature is missing.Ludovic Courtès
* tests/syscalls.scm ("clone", "setns", "pivot-root"): Skip unless (user-namespace (getpid)) exists.
2015-07-09gnu: build: Add Linux container module.David Thompson
* gnu/build/linux-container.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. * .dir-locals.el: Add Scheme indent rules for 'call-with-container', and 'container-excursion'. * tests/containers.scm: New file. * Makefile.am (SCM_TESTS): Add it.
2015-07-08tests: Use the right identifier in tests/elpa.scm.Ludovic Courtès
* tests/elpa.scm: Change 'nil->empty' to 'ensure-list' in the whole file.
2015-07-08import: Add 'elpa' importer.Federico Beffa
* guix/import/elpa.scm: New file. * guix/scripts/import.scm: Add "elpa" to 'importers'. * guix/scripts/import/elpa.scm: New file. * Makefile.am (MODULES): Add 'guix/import/elpa.scm' and 'guix/scripts/import/elpa.scm'. (SCM_TESTS): Add 'tests/elpa.scm'. * doc/guix.texi (Invoking guix import): Document it. * tests/elpa.scm: New file. * po/guix/POTFILES.in: Add 'guix/scripts/import/elpa.scm'.
2015-07-07build: syscalls: Add pivot-root.David Thompson
* guix/build/syscalls.scm (pivot-root): New procedure. * tests/syscalls.scm ("pivot-root"): New test.
2015-07-07build: syscalls: Add setns.David Thompson
* guix/build/syscalls.scm (setns): New procedure. * tests/syscalls.scm ("setns"): New test. squash: setns
2015-07-07build: syscalls: Add clone.David Thompson
* guix/build/syscalls.scm (clone): New procedure. (CLONE_NEWNS, CLONE_NEWUTS, CLONE_NEWIPC, CLONE_NEWUSER, CLONE_NEWPID, CLONE_NEWNET): New variables. * tests/syscalls.scm ("clone"): New test.
2015-07-07build: syscalls: Add mkdtemp!David Thompson
* guix/build/syscalls.scm (mkdtemp!): New procedure. * tests/syscalls.scm ("mkdtemp!"): New test.
2015-07-08tests: Test the exit code of 'guix environment'.Ludovic Courtès
This is a followup to d2cef62. * tests/guix-environment.sh: Add test for the exit code.
2015-07-08store: 'run-with-store' initializes %CURRENT-TARGET-SYSTEM to #f.Ludovic Courtès
* guix/store.scm (run-with-store): Set %CURRENT-TARGET-SYSTEM to #f. * tests/gexp.scm ("gexp->derivation vs. %current-target-system"): New test.
2015-07-03derivations: Add #:substitutable?, distinguished from #:local-build?.Ludovic Courtès
Fixes <http://bugs.gnu.org/18747>. * guix/derivations.scm (substitutable-derivation?): Rewrite to check for "allowSubstitutes". (derivation): Add #:substitutable? parameter. [user+system-env-vars]: Honor it. (build-expression->derivation): Add #:substitutable? and honor it. * guix/gexp.scm (gexp->derivation): Likewise. * tests/derivations.scm ("derivation-prerequisites-to-build and substitutes, non-substitutable build"): Use #:substitutable? instead of #:local-build?. ("substitutable-derivation?", "derivation-prerequisites-to-build and substitutes, local build"): New tests. * guix/download.scm (url-fetch): Adjust comment. * guix/git-download.scm (git-fetch): Likewise. * guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Use #:substitutable? instead of #:local-build?. * doc/guix.texi (Derivations, G-Expressions): Adjust accordingly.
2015-07-01environment: For --ad-hoc, allow users to specify an output.Ludovic Courtès
* guix/scripts/environment.scm (package+propagated-inputs): Add 'output' parameter. Use it in return value. (options/resolve-packages): Use 'append-map' instead of 'map'. For 'load' and 'expression', return all the outputs of the resulting package. For 'package', use 'specification->package+output' instead of 'specification->package'. (guix-environment): Adjust uses of PACKAGES accordingly. * doc/guix.texi (Invoking guix environment): Document it. * tests/guix-environment.sh: Add test for --ad-hoc guile-bootstrap:out.
2015-07-01environment: Add only the specified outputs of the dependencies.Ludovic Courtès
Before that, 'guix environment guile' (for instance) would define environment variables that would refer to the "include" output of Bash, the "debug" output of libgc, etc., even though these are not listed as inputs in the recipe of 'guile'. * guix/gexp.scm (lower-inputs): Export. * guix/scripts/environment.scm (evaluate-input-search-paths): Remove 'derivations' parameter; add 'search-paths'. Expect 'inputs' to be a list of tuples. Adjust callers. (create-environment): Remove 'derivations' parameter; add 'search-paths'. (show-search-paths): Likewise. (package+propagated-inputs): New procedure. (packages->transitive-inputs, packages+propagated-inputs): Remove. (build-inputs): Expect INPUTS to be a list of derivation tuples. (guix-environment): Compute INPUTS using 'package+propagated-inputs', 'package->bag', and 'bag-transitive-inputs'. Move 'run-with-store' higher. * tests/guix-environment.sh: Add test with FINDUTILS-BOOT0.
2015-07-01tests: Add tests for 'guix environment'.Ludovic Courtès
* tests/guix-environment.sh: New file. * Makefile.am (SH_TESTS): Add it.
2015-06-24import: pypi: Detect inputs.Cyril Roelandt
* guix/import/pypi.scm (python->package-name, maybe-inputs, compute-inputs, guess-requirements): New procedures. * guix/import/pypi.scm (guix-hash-url): Now takes a filename instead of an URL as input. * guix/import/pypi.scm (make-pypi-sexp): Now tries to generate the inputs automagically. * tests/pypi.scm: Update the test.
2015-06-24Add (guix cpio).Ludovic Courtès
* guix/cpio.scm, tests/cpio.scm: New files. * Makefile.am (MODULES): Add guix/cpio.scm. (SCM_TESTS): Add tests/cpio.scm.
2015-06-24tests: Move 'file=?' to (guix tests).Ludovic Courtès
* tests/nar.scm (file-tree-equal?)[file=?]: Move to... * guix/tests.scm (file=?): ... here. New procedure.
2015-06-19gexp: 'local-file' canonicalizes its file argument.Ludovic Courtès
Reported by Alex Kost <alezost@gmail.com> at <http://lists.gnu.org/archive/html/guix-devel/2015-06/msg00235.html>. * guix/gexp.scm (local-file): Add call to 'canonicalize-path'. * tests/gexp.scm ("one local file, symlink"): New test.
2015-06-19gexp: 'local-file' now defaults to non-recursive.Ludovic Courtès
Reported by Alex Kost <alezost@gmail.com> at <http://lists.gnu.org/archive/html/guix-devel/2015-06/msg00235.html>. * guix/gexp.scm (local-file): Change #:recursive? to default to #f. * tests/gexp.scm ("one local file", "gexp->derivation, local-file"): Adjust calls to 'add-to-store' and 'interned-file' accordingly.