summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2017-11-17workers: Add test with exceptions.Ludovic Courtès
* tests/workers.scm ("exceptions"): New test.
2017-11-13tests: 'guix-gc.sh' passes even when 'out' or 'drv' are defined as env vars.Ludovic Courtès
This fixes a test failure exhibited by fb17a89912c2a3738dae716e30481c11e1c6f0ac whereby assignments to 'out' in guix-gc.sh would go to the 'out' environment variable, when it exists, which in turn prevents garbage collection of $out. * tests/guix-gc.sh: Add 'unset' invocations.
2017-11-11tests: Adjust to new unbound-variable error message.Ludovic Courtès
This is a followup to dc856223f5eab57d8a4881782ec0f50abd12afa3. * tests/guix-package.sh: Adjust unbound-variable message regexp.
2017-11-11tests: Refer to "time@1.8".Ludovic Courtès
This is a followup to dd00e0919fcecd895ff4e5a646cf068f46ff8d12. * tests/guix-build.sh: Refer to "time@1.8".
2017-11-10tests: Adjust to unbound-variable exception printer.Ludovic Courtès
* tests/guix-system.sh: Adjust unbound-variable test for commit dc856223f5eab57d8a4881782ec0f50abd12afa3.
2017-11-08gnu: Improve error reporting of the use-.*modules macros.Ludovic Courtès
Suggested by Julien Lepiller and myglc2 at <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00106.html>. * gnu.scm (%try-use-modules): New procedure. (package-module-hint, service-module-hint): New procedures. (try-use-modules): New macro. (use-package-modules, use-service-modules, use-system-modules): Use it. * tests/guix-system.sh: Test it.
2017-11-08services: Add 'lookup-service-types'.Ludovic Courtès
* gnu/services.scm (lookup-service-types): New procedure. * tests/services.scm ("lookup-service-types"): New test.
2017-10-30Revert "import: cpan: Use HTTPS for home pages."Tobias Geerinckx-Rice
This reverts commit 29f7bf59d5d4d4b848eaedc6766bb4e02cae20d3: HTTPS support at search.cpan.org is unreliable, at best. Don't rely on it.
2017-10-29import: cpan: Use HTTPS for home pages.Tobias Geerinckx-Rice
* guix/import/cpan.scm (cpan-home): Use HTTPS. * tests/cpan.scm ("cpan->guix-package"): Expect it.
2017-10-28import: cpan: Add trailing "/" on home-page.Eric Bavier
This appeases 'guix lint', which otherwise complains about permanent redirects. * guix/import/cpan.scm (cpan-module->sexp): Add trailing "/" on home-page. * tests/cpan.scm ("cpan->guix-package"): Adjust accordingly.
2017-10-28import: cpan: Propagate imported dependencies.Eric Bavier
This is most often the need for perl module dependencies. * guix/import/cpan.scm (cpan-module->sexp): 'inputs -> 'propagated-inputs. * tests/cpan.scm ("cpan->guix-package"): Adjust accordingly.
2017-10-12lint: 'home-page' checker reports permanent redirects.Ludovic Courtès
* guix/scripts/lint.scm (probe-uri): Add special case for HTTP 301. (validate-uri): Likewise. * tests/lint.scm ("home-page: 301, invalid") ("home-page: 301 -> 200", "home-page: 301 -> 404") ("source: 301 -> 200", "source: 301 -> 404"): New tests.
2017-10-12tests: Support multiple HTTP server instances.Ludovic Courtès
* guix/tests/http.scm (%http-server-socket): Turn into... (open-http-server-socket): ... this procedure. (http-server-can-listen?): New procedure. (http-write, %http-server-lock, %http-server-ready) (http-open, stub-http-server): Move to 'call-with-http-server' body. (call-with-http-server): Add #:headers parameter. (with-http-server): Add an additional pattern with headers. * tests/derivations.scm: Use (http-server-can-listen?) instead of (force %http-server-socket). * tests/lint.scm: Likewise.
2017-10-11zlib: Fix memory leak due to revealed ports not being GC'd.Ludovic Courtès
Fixes <https://bugs.gnu.org/28784>. This mostly reverts 81a0f1cdf12e7bcc34c1203f034a323fa8f52cf5, which introduced a regression: revealed ports are *never* GC'd (contrary to what Guile's manual suggests). In addition to the revert, 'close-procedure' now explicitly swallows EBADF errors when 'close-port' is called. * guix/zlib.scm (close-procedure): New procedure. (make-gzip-input-port)[gzfile]: Use 'fileno' instead of 'port->fdes'. Use 'close-procedure' instead of 'gzclose'. (make-gzip-output-port): Likewise. * tests/zlib.scm ("compression/decompression pipe"): Use 'port-closed?' to determine whether PARENT has been closed.
2017-10-10ui: Improve reporting of missing closing parentheses.Ludovic Courtès
Suggested by Ricardo Wurmus. Works around <https://bugs.gnu.org/28295>. * guix/ui.scm (report-load-error): Add case for 'read-error'. * tests/guix-system.sh: Test missing-closing-paren errors.
2017-10-06import: Use a 'file://' URL in 'alist->package' test.Ludovic Courtès
* tests/import-utils.scm ("alist->package with simple source"): Use a 'file://' URL.
2017-10-06uuid: Fix typo in 'uuid=?' test.Ludovic Courtès
* tests/uuid.scm ("uuid=?"): Change to 'test-assert'.
2017-10-05publish: Cache uncompressed nars as well.Ludovic Courtès
Fixes <https://bugs.gnu.org/28664>. Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>. * guix/scripts/publish.scm (bake-narinfo+nar): When COMPRESSION is 'none, write NAR instead of doing nothing. (make-request-handler): Use 'render-nar/cached' for /nar URLs with no compression. * tests/publish.scm ("with cache", "with cache, uncompressed"): Adjust expected result accordingly.
2017-10-05uuid: Add 'uuid=?' and use it.Ludovic Courtès
* gnu/system/uuid.scm (uuid=?): New procedure. * tests/uuid.scm ("uuid=?"): New test. * gnu/build/file-systems.scm (partition-uuid-predicate) (luks-partition-uuid-predicate): Use it instead of 'bytevector=?'.
2017-09-28import: Add generic data to package converter.Ricardo Wurmus
* guix/import/utils.scm (build-system-modules, lookup-build-system-by-name, specs->package-lists, source-spec->object, alist->package): New procedures. * tests/import-utils.scm: Add tests for alist->package.
2017-09-28import: Add package->code.Ricardo Wurmus
* guix/import/print.scm: New file. * tests/print.scm: New file. * Makefile.am (SCM_TESTS): Add new test file. (MODULES): Add print.scm.
2017-09-22uuid: Add a parser for FAT32 UUIDs.Ludovic Courtès
* gnu/system/uuid.scm (%fat32-uuid-rx): New variable. (string->fat32-uuid): New procedure. (%uuid-parsers): Add it. * tests/uuid.scm ("uuid, FAT32, format preserved"): New test.
2017-09-16guix system: Add 'search' command.Ludovic Courtès
* guix/scripts/system.scm (resolve-subcommand): New procedure. (process-command): Handle 'search'. (guix-system): Likewise. (show-help): Augment. * guix/scripts/system/search.scm: New file. * po/guix/POTFILES.in: Add it. * Makefile.am (MODULES): Add it. * guix/ui.scm (%text-width): Export. * doc/guix.texi (Invoking guix system): Document it. (Service Types and Services): Mention 'guix system search'. * tests/guix-system.sh: Test it.
2017-09-14uuid: Move tests to 'tests/uuid.scm'.Ludovic Courtès
* tests/file-systems.scm ("uuid->string", "string->uuid") ("uuid", "uuid, syntax error"): Move to... * tests/uuid.scm: ... here. New file. ("uuid, ISO-9660, format preserved"): New test.
2017-09-14uuid: Adjust tests.Ludovic Courtès
This is a followup to 9b336338cdc0e46a3bf7a2913c2f61cd2410c4d6. * tests/file-systems.scm ("uuid"): Add call to 'uuid-bytevector'. ("uuid, syntax error"): Add 'dce to the expected form.
2017-09-14import: cpan: Adjust expected license in tests.Ludovic Courtès
This is a followup to 01ef804d69b2e57dd7b1d3d13e66e3f67e7c548a. * tests/cpan.scm ("cpan->guix-package"): Expect 'perl-license'.
2017-09-11substitute: Download from unauthorized sources that provide the right content.Ludovic Courtès
This allows substitutes to be downloaded from unauthorized servers, as long as they advertise the same hash and references as one of the authorized servers. * guix/scripts/substitute.scm (assert-valid-narinfo): Remove. (valid-narinfo?): Add #:verbose?. Handle each case of 'signature-case'. (equivalent-narinfo?): New procedure. (lookup-narinfos/diverse): Add 'authorized?' parameter and honor it. [select-hit]: New procedure. (lookup-narinfo): Add 'authorized?' parameter and pass it. (process-query): Adjust callers accordingly. (process-substitution): Remove call to 'assert-valid-narinfo'. Check whether 'lookup-narinfo' returns true and call 'leave' if not. * tests/substitute.scm (%main-substitute-directory) (%alternate-substitute-directory): New variables. (call-with-narinfo): Make 'narinfo-directory' a parameter. Call 'mkdir-p' to create it. Change unwind handler to check whether CACHE-DIRECTORY exists before deleting it. (with-narinfo*): New macro. ("substitute, no signature") ("substitute, invalid hash") ("substitute, unauthorized key"): Change expected error message to "no valid substitute". ("substitute, unauthorized narinfo comes first") ("substitute, unsigned narinfo comes first") ("substitute, first narinfo is unsigned and has wrong hash") ("substitute, first narinfo is unsigned and has wrong refs") ("substitute, unsigned narinfo comes first") ("substitute, two invalid narinfos"): New tests. * doc/guix.texi (Substitutes): Explain the new behavior.
2017-09-11substitute: Make substitute URLs a SRFI-39 parameter.Ludovic Courtès
* guix/scripts/substitute.scm (%cache-urls): Rename to... (%default-substitute-urls): ... this. (substitute-urls): New variable. (guix-substitute): Use it instead of %CACHE-URLS. * tests/substitute.scm: Likewise.
2017-08-24graft: Correctly replace references near the end of the scan buffer.Ludovic Courtès
Fixes <http://bugs.gnu.org/28212>. Reported by Leo Famulari <leo@famulari.name>. * guix/build/graft.scm (replace-store-references): When I >= END, check whether WRITTEN > END and call 'get-bytevector-n!' when it is. * tests/grafts.scm (buffer-size): New variable. ("replace-store-references, <http://bugs.gnu.org/28212>"): New test.
2017-08-23gnu: bootloader: Deprecate "device" field in favor of "target".Andy Wingo
* gnu/bootloader.scm (<bootloader-configuration>): Deprecate "device" field in favor of "target" field. This is mostly a renaming but also a generalization to support UEFI targets being paths to a mounted partition instead of a device name. * gnu/system/examples/bare-bones.tmpl: * gnu/system/examples/desktop.tmpl: * gnu/system/examples/lightweight-desktop.tmpl: * gnu/system/examples/vm-image.tmpl: * gnu/system/install.scm: * gnu/tests.scm: * gnu/tests/install.scm: * gnu/tests/nfs.scm: * tests/system.scm: Adapt all invocations of bootloader-configuration. * guix/scripts/system.scm (perform-action): Rename device argument to bootloader-target. (process-action): Adapt caller. * doc/guix.texi (Proceeding with the Installation): * doc/guix.texi (Bootloader Configuration): Update documentation.
2017-08-20guix download: Support retrieving local file without the URI scheme.宋文武
* guix/scripts/download.scm (guix-download): Treat the URL argument as a local file path when it fails on 'string->uri'. Call 'fetch' with the processed 'uri' instead of the original URL argument. * tests/guix-download.sh: Adjust accordingly.
2017-07-17gexp: 'ungexp-splicing' properly accounts for nested native inputs.Ludovic Courtès
Previously, (gexp-native-inputs #~#$@(list #~#+foo)) would return '(). This is a followup to 5b14a7902c58d9fb7923f9e16871f549fbe59b6e. * guix/gexp.scm (gexp-inputs)[add-reference-inputs]: In the list case, remove 'if' around 'fold-right'. In 'map' lambda, always inherit N?. * tests/gexp.scm ("gexp list splicing + ungexp-splicing"): New test.
2017-07-12syscalls: Add network-interface-running?Danny Milosavljevic
* guix/build/syscalls.scm (network-interface-running?): New variable. Export it. * tests/syscalls.scm: Add test. Co-authored-by: John Darrington <jmd@gnu.org>
2017-07-03discovery: Recurse into directories pointed to by a symlink.Ludovic Courtès
Reported by Christopher Baines <mail@cbaines.net> and Alex Kost <alezost@gmail.com> at <https://lists.gnu.org/archive/html/guix-devel/2017-06/msg00290.html>. * guix/discovery.scm (scheme-files): When ENTRY is a symlink that doesn't end in '.scm', call 'stat' and recurse if it points to a directory. * tests/discovery.scm ("scheme-modules recurses in symlinks to directories"): New test.
2017-06-26guix package: 'guix package -r PKG -u' does not upgrade PKG.Ludovic Courtès
Fixes <http://bugs.gnu.org/27262>. Reported by Mark H Weaver <mhw@netris.org>. * guix/scripts/package.scm (transaction-upgrade-entry): Check if ENTRY matches 'manifest-transaction-removal-candidate?' and return TRANSACTION if it does. (process-actions): Move 'options->removable' from step 2 to step 1.
2017-06-26profiles: Add 'manifest-transaction-removal-candidate?'.Ludovic Courtès
* guix/profiles.scm (manifest-transaction-removal-candidate?): New procedure. * tests/profiles.scm ("manifest-transaction-removal-candidate?"): New test.
2017-06-22daemon: '--listen' can be passed several times, can specify TCP endpoints.Ludovic Courtès
* nix/nix-daemon/guix-daemon.cc (DEFAULT_GUIX_PORT): New macro. (listen_options): New variable. (parse_opt): Push back '--listen' options to LISTEN_OPTIONS. (open_unix_domain_socket, open_inet_socket) (listening_sockets): New functions. (main): Use it. Pass SOCKETS to 'run'. * nix/nix-daemon/nix-daemon.cc (matchUser): Remove. (SD_LISTEN_FDS_START): Remove. (acceptConnection): New function. (daemonLoop): Rewrite to take a vector of file descriptors, to select(2) on them, and to call 'acceptConnection'. (run): Change to take a vector of file descriptors. * tests/guix-daemon.sh: Add test.
2017-06-21environment: Disable profile collision checks.Ludovic Courtès
Reported by Efraim Flashner. This is a followup to a654dc4bcf7c8e205bdefa1a1d5f23444dd22778. * guix/profiles.scm (profile-derivation): Add #:allow-collisions? and honor it. * guix/scripts/environment.scm (inputs->profile-derivation): Pass #:allow-collisions? #f to 'profile-derivation'. * tests/guix-environment.sh: Test "guix environment guix".
2017-06-21profiles: Catch and report collisions in the profile.Ludovic Courtès
* guix/profiles.scm (&profile-collision-error): New error condition. (manifest-transitive-entries, manifest-entry-lookup, lower-manifest-entry) (check-for-collisions): New procedures. (profile-derivation): Add call to 'check-for-collisions'. * guix/ui.scm (call-with-error-handling): Handle '&profile-collision-error'. * tests/profiles.scm ("collision", "collision of propagated inputs") ("no collision"): New tests.
2017-06-21profiles: Manifest entries keep a reference to their parent entry.Ludovic Courtès
* guix/profiles.scm (<manifest-entry>)[parent]: New field. (package->manifest-entry): Add #:parent parameter. Fill out the 'parent' field of <manifest-entry>; pass #:parent in recursive calls. * guix/profiles.scm (sexp->manifest)[sexp->manifest-entry]: New procedure. Use it for version 3. * tests/profiles.scm ("manifest-entry-parent"): New procedure. ("read-manifest")[entry->sexp]: Add 'manifest-entry-parent' to the result.
2017-06-21profiles: Represent propagated inputs as manifest entries.Ludovic Courtès
* guix/profiles.scm (package->manifest-entry): Turn DEPS into a list of manifest entries. (manifest->gexp)[entry->gexp]: Call 'entry->gexp' on DEPS. Bump version to 3. (sexp->manifest)[infer-dependency]: New procedure. Use it for versions 1 and 2. Parse version 3. (manifest-inputs)[entry->gexp]: New procedure. Adjust to 'dependencies' being a list of <manifest-entry>. * tests/profiles.scm ("packages->manifest, propagated inputs") ("read-manifest"): New fields.
2017-06-18import: pypi: Adjust URIs in tests.Ludovic Courtès
This is a followup to d1e7ca2df8c0e0dd601079c77f67ba6828cec08a. * tests/pypi.scm ("pypi->guix-package") ("pypi->guix-package, wheels"): Expect (pypi-uri "foo" version) for the 'uri' field.
2017-06-18discovery: 'scheme-files' returns '() for a non-accessible directory.Ludovic Courtès
Fixes a regression introduced in d27cc3bfaafe6b5b0831e88afb1c46311d382a0b. Reported by Ricardo Wurmus <rekado@elephly.net>. * guix/discovery.scm (scheme-files): Catch 'scandir*' system errors. Return '() and optionally raise a warning upon 'system-error'. * tests/discovery.scm ("scheme-modules, non-existent directory"): New test.
2017-06-16syscalls: Add 'scandir*'.Ludovic Courtès
* guix/build/syscalls.scm (%struct-dirent-header): New C struct. (string->pointer/utf-8, pointer->string/utf-8): New procedures. (opendir*, closedir*, readdir*, scandir*): New procedures. * tests/syscalls.scm ("scandir*, ENOENT") ("scandir*, ASCII file names", "scandir*, UTF-8 file names") ("scandir*, properties): New tests.
2017-06-15guix: Add texlive importer.Ricardo Wurmus
* guix/import/texlive.scm: New file. * guix/scripts/import/texlive.scm: New file. * Makefile.am (MODULES): Add them. * tests/texlive.scm: New file. * Makefile.am (SCM_TESTS): Add it. * guix/scripts/import.scm (importers): Add texlive importer. * doc/guix.texi (Invoking guix import): Document it.
2017-06-07import: cpan: Update CPAN importer to use MetaCPAN v1 API.James Richardson
* guix/import/cpan.scm (module->dist-name, cpan-fetch): Use metacpan.org URLs. * tests/cpan.scm ("cpan->guix-package"): Adjust accordingly. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-06-04daemon: Add '--timeout' and '--max-silent-time'.Ludovic Courtès
* nix/nix-daemon/guix-daemon.cc (GUIX_OPT_TIMEOUT) (GUIX_OPT_MAX_SILENT_TIME): New macros. * nix/nix-daemon/guix-daemon.cc (options): Add '--timeout' and '--max-silent-time'. (parse_opt): Honor them. * tests/guix-daemon.sh: Add test. * doc/guix.texi (Invoking guix-daemon): Document the options. (Common Build Options): Properly describe default timeout/max-silent-time value. Add cross-ref to "Invoking guix-daemon".
2017-06-02derivations: 'derivation-prerequisites-to-build' returns <substitutable>.Ludovic Courtès
* guix/derivations.scm (derivation-prerequisites-to-build): Rename #:substitutable? to #:substitutable-info. [derivation-substitutable?]: Rename to... [derivation-substitutable-info]: ... this. Return a list of <substitutable>. Second return value is now a list of <substitutable> instead of a list of strings. * guix/ui.scm (show-what-to-build)[substitutable?]: Rename to... [substitutable-info]: ... this. Adjust to new 'derivation-prerequisites-to-build' return value type. * tests/derivations.scm ("derivation-prerequisites-to-build and substitutes"): Adjust. ("derivation-prerequisites-to-build and substitutes, local build"): Likewise.
2017-06-02derivations: 'substitution-oracle' returns a <substitutable>.Ludovic Courtès
* guix/derivations.scm (substitution-oracle): Use 'substitution-path-info' instead of 'substitution-paths'. Turn SUBST into a vhash from path to <substitutable>. Change the returned procedure to provide a <substitutable> instead of a Boolean. * tests/derivations.scm ("substitution-oracle and #:substitute? #f"): Mock 'substitutable-path-info' instead of 'substitutable-paths'.
2017-06-02tests: Remove 't-profile-alt-*-link' files.Ludovic Courtès
Reported by myglc2 <myglc2@gmail.com> at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27137#11>. * tests/guix-package-net.sh: In the trap, remove $profile_alt-[0-9]*.