summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2022-12-20cpio: Skip test on inode numbers that don't fit on 32 bits.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/60202>. Reported by Christopher Baines <mail@cbaines.net>. * tests/cpio.scm (%test-file): New variable. ("file->cpio-header + write-cpio-header + read-cpio-header"): Use it. Skip test when the inode number of %TEST-FILE is too big.
2022-12-20tests: Adjust 'guix package' test to latest package search metrics.Ludovic Courtès
With commit bbcd06e56c06376e640a7ac81a7109e7135a20f2, the command "guix package -s '^fileutils$'" would match the 'ocaml-fileutils' package, because its 'package-upstream-name*' is "fileutils". Work around it. Reported by Vagrant Cascadian. * tests/guix-package.sh: Change "fileutils" example to use a different package name.
2022-12-13ui: Take package upstream name into account when searching.Lars-Dominik Braun
* guix/ui.scm (%package-metrics): Add PACKAGE-UPSTREAM-NAME*. * tests/ui.scm ("package-relevance and upstream name"): New test. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-12-13packages: Add 'package-upstream-name*'.Lars-Dominik Braun
* guix/packages.scm (package-upstream-name*): New procedure. * tests/packages.scm ("package-upstream-name*"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-12-12Merge branch 'version-1.4.0'Ludovic Courtès
2022-12-12pki: 'public-keys->acl' deduplicates entries.Ludovic Courtès
Reported by Tobias Geerinckx-Rice <me@tobias.gr> in <https://issues.guix.gnu.org/50892>. * guix/pki.scm (public-keys->acl): Add call to 'delete-duplicates'. * tests/pki.scm ("public-keys->acl deduplication"): New test.
2022-12-10deduplicate: Use 'sendfile' for small file copies.Ludovic Courtès
* guix/store/deduplication.scm (dump-file/deduplicate): Use 'sendfile' instead of 'dump-port'. * tests/store-deduplication.scm ("copy-file/deduplicate, below %deduplication-minimum-size"): New test.
2022-12-08records: 'match-record' checks fields at macro-expansion time.Ludovic Courtès
This allows 'match-record' to be more efficient (field offsets are computed at compilation time) and to report unknown fields at macro-expansion time. * guix/records.scm (map-fields): New macro. (define-record-type*)[rtd-identifier]: New procedure. Define TYPE as a macro and use a separate identifier for the RTD. (lookup-field, match-record-inner): New macros. (match-record): Rewrite in terms of 'match-error-inner'. * tests/records.scm ("match-record, simple") ("match-record, unknown field"): New tests. * gnu/services/cuirass.scm (cuirass-shepherd-service): Rename 'log-file' local variable to 'main-log-file'. * gnu/services/getmail.scm (serialize-getmail-configuration-file): Move after <getmail-configuration-file> definition.
2022-12-04tests: Fix guix-system.sh test.Maxim Cournoyer
The regression was introduce with commit c7793b82efd3383a9f7adf0dfa82d71ee032e41b ("gnu: raspberry-pi: Add a bootloader-chain for the Raspberry Pi and os examples.") due to the examples needing to be built for the aarch64-linux system. * tests/guix-system.sh: Invoke guix system build with '--system=aarch64-linux' to build the Raspberry Pi systems.
2022-12-02records: 'match-record' checks fields at macro-expansion time.Ludovic Courtès
This allows 'match-record' to be more efficient (field offsets are computed at compilation time) and to report unknown fields at macro-expansion time. * guix/records.scm (map-fields): New macro. (define-record-type*)[rtd-identifier]: New procedure. Define TYPE as a macro and use a separate identifier for the RTD. (lookup-field, match-record-inner): New macros. (match-record): Rewrite in terms of 'match-error-inner'. * tests/records.scm ("match-record, simple") ("match-record, unknown field"): New tests. * gnu/services/cuirass.scm (cuirass-shepherd-service): Rename 'log-file' local variable to 'main-log-file'. * gnu/services/getmail.scm (serialize-getmail-configuration-file): Move after <getmail-configuration-file> definition.
2022-11-18import/utils: spdx-string->license: Support '+' operator.Philip McGrath
Previously, '+' was supported only via special cases for deprecated GNU identifiers like 'GPL-N+'. This commit adds support for other uses of '+', such as 'AFL-2.0+' and 'LPPL-1.0+'. Strictly speaking, '+' is an operator, not part of the SPDX license identifier, but it is useful to handle it here. * guix/import/utils.scm (spdx-string->license): Support '+' operator. * tests/import-utils.scm ("spdx-string->license"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-11-18import/utils: spdx-string->license: Match case-insensitively.Philip McGrath
SPDX specifies that license identifiers (unlike the 'AND', 'OR', and 'WITH' operators) are matched case-insensitively. * guix/import/utils.scm (%spdx-license-identifiers): New variable. (spdx-string->license): Search in '%spdx-license-identifiers' using 'string-ci=?'. * tests/import-utils.scm ("spdx-string->license"): New test. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-11-15shell: Detect --symlink spec problems early.Maxim Cournoyer
* guix/scripts/pack.scm (symlink-spec-option-parser): Remove extraneous char-set. Raise an exception when the target is an absolute file name. (guix-pack): Move with-error-handler earlier. * guix/scripts/shell.scm (guix-shell): Likewise. * guix/scripts/environment.scm (guix-environment): Wrap the whole guix-environment* call with the with-error-handling handler. * tests/guix-environment-container.sh: Add tests. * tests/guix-pack.sh: Adjust symlink spec.
2022-11-15guix: shell: Add '--symlink' option.Maxim Cournoyer
* guix/scripts/pack.scm (%options): Extract symlink parsing logic to... (symlink-spec-option-parser): ... here. (self-contained-tarball/builder): Add a comment mentioning why a relative file name is used for the link target. * guix/scripts/environment.scm (show-environment-options-help): Document new --symlink option. (%default-options): Add default value for symlinks. (%options): Register new symlink option. (launch-environment/container): Add #:symlinks argument and extend doc, and create symlinks using evaluate-populate-directive. (guix-environment*): Pass symlinks arguments to launch-environment/container. * doc/guix.texi (Invoking guix shell): Document it. * tests/guix-shell.sh: Add a --symlink (negative) test. * tests/guix-environment-container.sh: Add tests.
2022-11-11gnu-maintenance: 'release-file?' excludes "valgrind-3.20.0.RC1.tar.bz2".Ludovic Courtès
* guix/gnu-maintenance.scm (%alpha-tarball-rx): Add "." before "(alpha|beta|...)". * tests/gnu-maintenance.scm ("release-file?"): Add test for Valgrind.
2022-11-11grafts: Run with a UTF-8 locale.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/55968>. Reported by Maxime Devos <maximedevos@telenet.be>. * guix/grafts.scm (%graft-with-utf8-locale?): New parameter. (graft-derivation/shallow)[glibc-locales, set-utf8-locale]: New variables. [build]: Use 'set-utf8-locale'. * tests/gexp.scm, tests/grafts.scm, tests/packages.scm: Set '%graft-with-utf8-locale?' to #f.
2022-11-06shell: Fix '--emulate-fhs' sometimes not including 'glibc-for-fhs'.John Kehayias
Fixes <https://issues.guix.gnu.org/58861>. Previously the order of the options giving to 'guix shell' could mean that the 'glibc-for-fhs' package included with the '--emulate-fhs' option would not appear in the container. For example, using the development option with a package using the 'gnu-build-system', e.g. 'guix shell -CFD hello', would include the regular 'glibc' package. The option ordered mattered: 'guix shell -CD hello -F' would include the expected 'glibc-for-fhs'. We fix this by having 'glibc-for-fhs' added to the package list just before calling 'options-with-caching' so the option order given by the user does not matter. * guix/scripts/shell.scm (%options): Move the '--emulate-fhs' (expression . ...) component from here... (parse-args): ... to here. * tests/guix-environment-container.sh: Add a test to check that 'glibc-for-fhs' is in the container even when 'glibc' is included in the 'guix shell' package list. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-27gnu: python-setuptools: Move to python-build.Lars-Dominik Braun
* gnu/packages/python-xyz.scm (python-setuptools): Move… * gnu/packages/python-build.scm: …here. * gnu/packages/chemistry.scm, gnu/packages/messaging.scm, gnu/packages/sequoia.scm, tests/lint.scm: Adjust module imports accordingly. Co-authored-by: Marius Bakke <marius@gnu.org>
2022-10-22Remove now unnecessary uses of (guix grafts).Ludovic Courtès
These modules would use (guix grafts) just to access '%graft?' and related bindings, which are now in (guix store). * gnu/ci.scm, guix/gexp.scm, guix/lint.scm, guix/scripts.scm, guix/scripts/archive.scm, guix/scripts/build.scm, guix/scripts/challenge.scm, guix/scripts/deploy.scm, guix/scripts/environment.scm, guix/scripts/home.scm, guix/scripts/pack.scm, guix/scripts/package.scm, guix/scripts/pull.scm, guix/scripts/size.scm, guix/scripts/system.scm, guix/scripts/weather.scm, tests/builders.scm, tests/channels.scm, tests/cpan.scm, tests/derivations.scm, tests/gexp.scm, tests/graph.scm, tests/guix-daemon.sh, tests/monads.scm, tests/pack.scm, tests/packages.scm, tests/profiles.scm, tests/system.scm: Remove #:use-module (guix grafts).
2022-10-22tests: 'guix build --with-commit' output no longer refers to the tag ID.Ludovic Courtès
This is a followup to 46f7011591601b4783b2dc2c7252c41564ca0140. * tests/guix-build-branch.sh: Replace tag ID by commit ID.
2022-10-17lint: source: Add check for <svn-reference> over HTTP(S).Ludovic Courtès
* guix/lint.scm (svn-reference-uri-with-userinfo): New procedure. (check-source): Add 'svn-reference?' clause. * tests/lint.scm ("source: svn-reference, HTTP 200") ("source: svn-reference, HTTP 404"): New tests.
2022-10-17git: 'update-cached-checkout' returns the commit ID when given a tag.Ludovic Courtès
Previously, starting with commit efa578ecaece67366b4b0e2266de7c2faaa4ae54, 'update-cached-checkout' would return the OID of the annotated tag the tag points to. With this change it returns the OID of the commit object in all cases. * guix/git.scm (resolve-reference): In the 'tag' case, call 'tag-target-id' and 'tag-lookup' when OID designates an annotated tag. * tests/git.scm ("update-cached-checkout, tag"): New test.
2022-10-13shell: Handle '--emulate-fhs' in 'guix shell', not in 'guix environment'.Ludovic Courtès
Previously, using 'guix shell -CF coreutils' twice (such that the profile is cache) would result in: guix shell: error: '--profile' cannot be used with package options This patch fixes it by moving argument handling to (guix scripts shell), before 'options-with-caching' is called. * guix/scripts/environment.scm (show-environment-options-help) (%options): Remove '--emulate-fhs'. (guix-environment*): Pass OPTS as-is to 'options/resolve-packages'. * guix/scripts/shell.scm (show-help, %options): Add '--emulate-fhs'. Add the (expression . ...) component to RESULT right from the argument handler. * tests/guix-environment-container.sh: Change '--emulate-fhs' tests to use 'guix shell' instead of 'guix environment'.
2022-10-13environment: Add '--emulate-fhs'.John Kehayias
* guix/scripts/environment.scm (show-environment-options-help, %options): Add '--emulate-fhs'. (setup-fhs): New procedure. Setup for the Filesystem Hierarchy Standard (FHS) container. Defines and uses FHS-SYMLINKS and LINK-CONTENTS to create FHS expected directories and creates /etc/ld.so.conf. (launch-environment): Add 'emulate-fhs?' key and implement it to set $PATH and generate /etc/ld.so.cache before calling COMMAND. (launch-environment/container): Add 'emulate-fhs?' and 'setup-hook' keys and implement them. Define and use FHS-MAPPINGS, to set up additional bind mounts in the container to follow FHS expectations. (guix-environment*): Add glibc-for-fhs to the container packages when 'emulate-fhs?' key is in OPTS. * doc/guix.texi (Invoking guix shell): Document '--emulate-fhs'. (Invoking guix environment): Document '--emulate-fhs'. * tests/guix-environment-container.sh: Add tests for '--emulate-fhs'. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-10-10packages: Raise an exception for invalid 'license' values.Ludovic Courtès
This is written in such a way that the type check turns into a no-op at macro-expansion time for trivial cases: > ,optimize (validate-license gpl3+) $18 = gpl3+ > ,optimize (validate-license (list gpl3+ gpl2+)) $19 = (list gpl3+ gpl2+) * guix/packages.scm (valid-license-value?, validate-license): New macros. (<package>)[license]: Add 'sanitize' option. (&package-license-error): New error condition type. * tests/packages.scm ("license type checking"): New test.
2022-10-07tests: Attempt to build 'desktop.tmpl' on all major architectures.Ludovic Courtès
Partly fixes <https://issues.guix.gnu.org/58352>. * tests/guix-system.sh: Try to build 'desktop.tmpl' for x86_64, i686, and aarch64.
2022-10-05tests: Add new test cases for beautify-description.Ricardo Wurmus
* tests/import-utils.scm ("beautify-description: use double spacing"): Update. ("beautify-description: remove single quotes", "beautify-description: escape @"): New tests.
2022-09-29transformations: '--with-source' now operates in depth.Ludovic Courtès
The '--with-source' option is the first one that was implemented, and it's the only one that would operate only on leaf packages rather than traversing the dependency graph. This change makes it consistent with the rest of the transformation options. * guix/transformations.scm (evaluate-source-replacement-specs): New procedure. (transform-package-source): Rewrite using it. * tests/transformations.scm ("options->transformation, with-source, no matches"): Rewrite since we no longer get a warning. ("options->transformation, with-source, in depth"): New test. * doc/guix.texi (Package Transformation Options): Adjust examples.
2022-09-29import: print: Quasiquote propertiesitd
* guix/import/print.scm (package->code): Quasiquote properties. * tests/print.scm (pkg-with-properties, pkg-with-properties-source): New variables. ("package with properties"): New test Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-09-29import/utils: alist->package: Include properties.itd
* guix/import/utils.scm (alist->package): Process properties field in input data and include it in the generated package. * tests/import-utils.scm ("alist->package with properties"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-09-28substitute: Retry downloading when a nar is unavailable.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/57978> Reported by Attila Lendvai <attila@lendvai.name>. Previously, if a narinfo was available but its corresponding nar was missing (for instance because the narinfo was cached and the server became unreachable in the meantime), 'guix substitute --substitute' would try to download the nar from its preferred location and abort when that fails. This change forces one retry with each of the URLs. * guix/scripts/substitute.scm (download-nar): Do not catch 'http-get-error?' exceptions. (system-error?, network-error?, process-substitution/fallback): New procedures. (process-substitution): Call 'process-substitution/fallback' upon 'network-error?'. * tests/substitute.scm ("substitute, first URL has narinfo but lacks nar, second URL unauthorized") ("substitute, first URL has narinfo but nar is 404, both URLs authorized") ("substitute, first URL has narinfo but nar is 404, one URL authorized") ("substitute, narinfo is available but nar is missing"): New tests.
2022-09-26gnu-maintenance: Test latest-html-release.Maxime Devos
* tests/gnu-maintenance.scm ("latest-html-release, no signature") ("latest-html-release, signature): New tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-09-24substitute: Test behavior with unroutable substitute server addresses.Ludovic Courtès
* tests/substitute.scm (%unroutable-substitute-url): New variable. ("query narinfo signed with authorized key, unroutable URL first") ("substitute, authorized key, first substitute URL is unroutable"): New tests.
2022-09-20home: import: Use (guix read-print) to render the config file.Ludovic Courtès
* guix/scripts/home/import.scm (manifest+configuration-files->code): Insert calls to 'comment' and 'vertical-space'. (import-manifest): Use 'pretty-print-with-comments/splice' instead of a loop on 'pretty-print'. * tests/home-import.scm (remove-recursively): New procedure. (eval-test-with-home-environment): Use it.
2022-09-20read-print: Correctly support multiple same-named newline forms.Ludovic Courtès
Previously (home-environment (services ...)) would not be considered a "newline form". This fixes it. * guix/read-print.scm (newline-form?): Use 'vhash-foldq*' instead of 'vhash-assq' and iterate over candidates. * tests/read-print.scm: Add test.
2022-09-17gnu-maintenance: Support // URLs in latest-html-release.Maxime Devos
This makes "./pre-inst-env guix refresh -u" download the release tarball from the right place -- previously, it downloaded from https://www.libreoffice.org//download.documentfoundation.org/libreoffice/src/7.4.0/libreoffice-7.4.0.3.tar.xz?idx=1 whereas it should download from https://download.documentfoundation.org/libreoffice/src/7.4.0/libreoffice-7.4.0.3.tar.xz?idx=1 instead. * guix/gnu-maintenance.scm (latest-html-release)[url-release]: Adjust computation in the case of an absolute URI-reference without a scheme. * tests/gnu-maintenance.scm ("latest-html-release, scheme-less URIs"): Test it. Signed-off-by: Christopher Baines <mail@cbaines.net>
2022-09-17import: gem: Support importing a specific version of a gem.Taiju HIGASHI
* guix/import/gem.scm: (rubygems-fetch, gem->guix-package) (gem-recursive-import): Fix to fetch the specified version of the gem. * guix/scripts/import/gem.scm (show-help): Update the help message. (guix-import-gem): Modify so the version number to be passed to subsequent procedures. * tests/gem.scm: Add tests. * doc/guix.texi (Invoking guix import): Document. Signed-off-by: Christopher Baines <mail@cbaines.net>
2022-09-04guix system: Do not use 'vm-image.tmpl' in tests.Ludovic Courtès
This is a followup to 95a03aa5c507d48e2cde19ea007b8f90a4e0108a. Since that commit, merely evaluating 'vm-image.tmpl' would trigger the build of 'current-guix' so skip it. * tests/guix-system.sh: Do not try to build 'vm-image.tmpl'.
2022-09-04guix describe: Adjust test to latest changes.Ludovic Courtès
This is a followup to 64a070717c3de32332201df5d6d2d52a7f99dce9. * tests/guix-describe.sh: Add trailing slash when checking URL.
2022-09-04store: Open daemon connections with SOCK_CLOEXEC.Ludovic Courtès
Previously, 'guix shell' for example would leak the socket that's connected to the daemon. * guix/store.scm (open-unix-domain-socket, open-inet-socket): Pass SOCK_CLOEXEC to 'socket'. * tests/guix-shell.sh: Add test.
2022-09-02read-print: Define forms for which \n, \t, etc. are not escaped.Ludovic Courtès
Previously, the pretty-printer would unconditionally leave everything but double-quotes and backslashes unescaped when rendering a string. With this change, the previous behavior only applies to forms listed in %NATURAL-WHITESPACE-STRING-FORMS. * guix/read-print.scm (%natural-whitespace-string-forms): New variable. (printed-string): New procedure. (pretty-print-with-comments): Use it instead of 'escaped-string'. * tests/read-print.scm: Add test.
2022-09-01read-print: Guess the base to use for integers being printed.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/57090>. Reported by Christopher Rodriguez <yewscion@gmail.com>. * guix/read-print.scm (%symbols-followed-by-octal-integers) (%symbols-followed-by-hexadecimal-integers): New variables. * guix/read-print.scm (integer->string): New procedure. (pretty-print-with-comments): Use it. * tests/read-print.scm: Add test.
2022-08-28services: Add lightdm-service-type.Maxim Cournoyer
* gnu/services/lightdm.scm: New service. * tests/services/lightdm.scm: Test it. * doc/guix.texi (X Window): Document it. * gnu/local.mk (GNU_SYSTEM_MODULES): Register it. Co-authored-by: L p R n d n <guix@lprndn.info> Co-authored-by: Ricardo Wurmus <rekado@elephly.net>
2022-08-28tests: Add test for menu-entry roundtrips as sexps.Josselin Poiret
* tests/boot-parameters.scm (%uuid-menu-entry, %file-system-label-menu-entry): New variables. ("menu-entry roundtrip, uuid", "menu-entry roundtrip, file-system-label"): New tests. Signed-off-by: Marius Bakke <marius@gnu.org>
2022-08-25services: configuration: Change the value of the unset marker.Attila Lendvai
The new value of %unset-value sticks out more when something goes wrong, and is also more unique; i.e. easier to search for. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2022-08-25services: Use the new maybe/unset API.Attila Lendvai
* gnu/home/services/ssh.scm (serialize-address-family): Use the public API of the maybe infrastructure. * gnu/services/file-sharing.scm (serialize-maybe-string): Use maybe-value. (serialize-maybe-file-object): Use maybe-value-set?. * gnu/services/getmail.scm (getmail-retriever-configuration): Don't use internals in unset field declarations. (getmail-destination-configuration): Ditto. * gnu/services/messaging.scm (raw-content?): Use maybe-value-set?. (prosody-configuration): Use %unset-value. * gnu/services/telephony.scm (jami-shepherd-services): Use maybe-value-set?. (archive-name->username): Use maybe-value-set?. * tests/services/configuration.scm ("maybe type, no default"): Use %unset-value. Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2022-08-10read-print: Report missing closing parens instead of looping.Ludovic Courtès
Fixes <https://issues.guix.gnu.org/57093>. Reported by Mohammed AMAR-BENSABER <renken@shione.net>. Previously 'read-with-comments' would enter an infinite loop. * guix/read-print.scm (read-with-comments)[missing-closing-paren-error]: New procedure. Call it when 'loop' as called from 'liip' returns EOF. * tests/read-print.scm ("read-with-comments: missing closing paren"): New test.
2022-08-09tests: configuration: Add a test to cover 'unset regression.Maxim Cournoyer
The regression was introduced with a2b89a3319dc1d621c546855f578acae5baaf6da, and introduce a risk that 'unset leaks to serialized configuration files. * tests/services/configuration.scm (maybe-symbol): New type. (config-with-maybe-symbol): New configuration. ("symbol maybe value serialization, unspecified"): New test. Reported-by: Attila Lendvai <attila@lendvai.name>
2022-08-08read-print: Add 'case' and 'cond' special forms.Ludovic Courtès
* guix/read-print.scm (%special-forms): Add 'case' and 'cond'. * tests/read-print.scm: Add tests.
2022-08-08read-print: Support printing multi-line comments.Ludovic Courtès
* guix/read-print.scm (%not-newline): New variable. (print-multi-line-comment): New procedure. (pretty-print-with-comments): Use it. * tests/read-print.scm ("pretty-print-with-comments, multi-line comment"): New test.