summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Expand)Author
2020-07-11Add 'guix git authenticate'....* guix/scripts/git.scm, guix/scripts/git/authenticate.scm, tests/guix-git-authenticate.sh: New files. * Makefile.am (MODULES): Add the *.scm files. (SH_TESTS): Add 'tests/guix-git-authenticate.sh'. * doc/guix.texi (Channels)[Specifying Channel Authorizations]: Mention 'guix git authenticate'. (Invoking guix git authenticate): New node. * po/guix/POTFILES.in: Add 'guix/scripts/git.scm' and 'guix/scripts/git/authenticate.scm'. Ludovic Courtès
2020-07-01channels: Dependencies listed in '.guix-channel' can have an introduction....Suggested by Ricardo Wurmus and Simon Tournier. * guix/channels.scm (sexp->channel-introduction): New procedure. (read-channel-metadata): Use it. (profile-channels)[sexp->channel-introduction]: Remove. * tests/channels.scm ("latest-channel-instances, authenticate dependency"): New test. * doc/guix.texi (Channels)[Declaring Channel Dependencies]: Augment example. Ludovic Courtès
2020-07-01channels: Properly diagnose test failure....This fixes a style issue similar to that of a18d02def9862dfb9b7a5e3d5aa3b541b066d198. * tests/channels.scm ("authenticate-channel, .guix-authorizations"): Change to 'test-equal' so that test failures are properly diagnosed. Ludovic Courtès
2020-07-01channels: Make channel introductions public....* guix/channels.scm (<channel-introduction>): Rename constructor to '%make-channel-introduction'. (make-channel-introduction): New procedure. * tests/channels.scm ("authenticate-channel, wrong first commit signer") ("authenticate-channel, .guix-authorizations"): Use 'make-channel-introduction' without '@@' and without third argument. * doc/guix.texi (Channels)[Channel Authentication, Specifying Channel Authorizations]: New subsections. Ludovic Courtès
2020-06-28tests: Do not fail when network interface aliases are present....Fixes <https://bugs.gnu.org/42111>. * tests/syscalls.scm ("network-interface-names"): Filter interface names with a colon. Marius Bakke
2020-06-28channels: Error out when the 'guix' channel lacks an introduction....* guix/channels.scm (latest-channel-instance): Raise an error instead of warning when 'guix is unauthenticated. * tests/channels.scm ("latest-channel-instances, missing introduction for 'guix'"): New test. Ludovic Courtès
2020-06-28tests: Allow 'tests/git-authenticate.scm' to run when git/gpg is missing....Fixes <https://bugs.gnu.org/42077>. Reported by Jan Nieuwenhuizen <janneke@gnu.org>. The typo was introduced in 7b06781a58326f251c4af6340379d68e3cb98adb. * tests/git-authenticate.scm <top level>: Remove call to 'which' around (gpg+git-available?). Ludovic Courtès
2020-06-27packages: Recognize SHA3 and BLAKE2s for 'content-hash'....* guix/packages.scm (build-content-hash): Add 'sha3-256', 'sha3-512', and 'blake2s-256'. * tests/packages.scm ("package-source-derivation, origin, sha3-512"): New test. Ludovic Courtès
2020-06-27daemon: Recognize SHA3 and BLAKE2s....* nix/libutil/hash.hh (HashType): Add htSHA3_256, htSHA3_512, and htBLAKE2s_256. * nix/libutil/hash.cc (parseHashType, printHashType): Recognize them. * tests/store.scm ("add-to-store"): Test these algorithms. Ludovic Courtès
2020-06-26tests: Skip lint tests when HTTP server cannot listen....This could happen when running tests in parallel. * tests/lint.scm ("github-url") ("github-url: one suggestion") ("github-url: already the correct github url") ("archival: missing content") ("archival: content available") ("archival: missing revision") ("archival: revision available") ("archival: rate limit reached"): Add 'test-skip' statement above. Ludovic Courtès
2020-06-25channels: Fix test for introductory commit signer....Until now the test would always succeed because it would return 'failed, which has truth value. The exercise 'verify-introductory-commit', we need to add a second commit beyond the introductory commit, which is what we do here. * tests/channels.scm ("authenticate-channel, wrong first commit signer"): Add a second commit and authenticate up to that one. Change 'message?' to 'message-condition?'. Ludovic Courtès
2020-06-20tests: Skip tests that requires gpg when gpg is unavailable....Partly fixes <https://bugs.gnu.org/41932>. Reported by Simen Endsjø <simendsjo@gmail.com>. * tests/git-authenticate.scm ("signed commits, SHA1 signature"): Use 'gpg+git-available?' in skip guard. Ludovic Courtès
2020-06-20tests: Actually run 'tests/guix-environment-container.sh'....This test was skipped since the switch to Guile 3 because 'assert-container-features' would be inlined and thus accessing it with @@ would fail with an unbound-variable error. * guix/scripts/environment.scm (assert-container-features): Export. * tests/guix-environment-container.sh: Use single '@'. Ludovic Courtès
2020-06-16channels: Make 'validate-pull' call right after clone/pull....This should come before patching, authentication, etc. * guix/channels.scm (latest-channel-instance): Add #:validate-pull parameter and honor it. Return a single value: the instance. (ensure-forward-channel-update): Change 'instance' parameter to 'commit' and adjust accordingly. (latest-channel-instances): Adjust to 'latest-channel-instance' changes. * guix/scripts/pull.scm (warn-about-backward-updates): Change 'instance' parameter to 'commit' and adjust accordingly. * tests/channels.scm ("latest-channel-instances #:validate-pull"): Likewise. Ludovic Courtès
2020-06-16channels: 'latest-channel-instance' authenticates Git checkouts....Fixes <https://bugs.gnu.org/22883>. * guix/channels.scm (<channel>)[introduction]: New field. (<channel-introduction>): New record type. (%guix-channel-introduction): New variable. (%default-channels): Use it. (<channel-metadata>)[keyring-reference]: New field. (%default-keyring-reference): New variable. (read-channel-metadata, read-channel-metadata-from-source): Initialize the 'keyring-reference' field. (commit-short-id, verify-introductory-commit) (authenticate-channel): New procedures. (latest-channel-instance): Call 'authenticate-channel' when CHANNEL has an introduction. * tests/channels.scm (gpg+git-available?, commit-id-string): New procedures. ("authenticate-channel, wrong first commit signer"): ("authenticate-channel, .guix-authorizations"): New tests. * doc/guix.texi (Invoking guix pull): Mention authentication. Ludovic Courtès
2020-06-16tests: Move OpenPGP helpers to (guix tests gnupg)....* tests/git-authenticate.scm (key-id): Remove. (%ed25519-public-key-file, %ed25519-secret-key-file) (%ed25519bis-public-key-file, %ed25519bis-secret-key-file) (read-openpgp-packet, key-fingerprint): Move to... * guix/tests/gnupg.scm: ... here. Ludovic Courtès
2020-06-14guix repl: Add script execution....* guix/scripts/repl.scm: Add filename options for script execution. * doc/guix.texi (Invoking guix repl): Document it. * tests/guix-repl.sh: Test it. * Makefile.am: (SH_TESTS): Add it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Konrad Hinsen
2020-06-14lint: Add 'check-for-collisions' checker....Suggested by Edouard Klein <edk@beaver-labs.com>. * guix/profiles.scm (check-for-collisions): Export. * guix/lint.scm (check-profile-collisions): New procedure. (%local-checkers): Add 'profile-collisions' checker. * tests/lint.scm ("profile-collisions: no warnings") ("profile-collisions: propagated inputs collide") ("profile-collisions: propagated inputs collide, store items"): New tests. * doc/guix.texi (Invoking guix lint): Document it. Ludovic Courtès
2020-06-12git-authenticate: Disallow SHA1 (and MD5) signatures....* guix/git-authenticate.scm (commit-signing-key): Add #:disallowed-hash-algorithms and honor it. (authenticate-commit)[recent-commit?]: New variable. Pass #:disallowed-hash-algorithms to 'commit-signing-key'. * tests/git-authenticate.scm ("signed commits, SHA1 signature"): New test. Ludovic Courtès
2020-06-11packages: 'package-grafts' returns grafts for all the relevant outputs....Fixes <https://bugs.gnu.org/41796>. Reported by Jakub Kądziołka <kuba@kadziolka.net>. * guix/packages.scm (input-graft): Add 'output' parameter and honor it. Add OUTPUT to the cache key. (input-cross-graft): Likewise. (fold-bag-dependencies): Operate on inputs instead of nodes. Turn VISITED into a vhash instead of a set. Pass PROC HEAD and OUTPUT instead of just HEAD. (bag-grafts): Adjust accordingly. * tests/packages.scm ("package-grafts, dependency on several outputs"): New test. Ludovic Courtès
2020-06-09git: 'commit-difference' really excludes the ancestors of #:excluded....* guix/git.scm (commit-difference): Initialize VISITED to the closure of OLD and EXCLUDED, as written in the docstring. * tests/git.scm ("commit-difference, excluded commits"): Adjust accordingly. Ludovic Courtès
2020-06-08system: examples: Add bare-hurd.tmpl....* gnu/system/hurd.scm (%hurd-def%hurd-default-operating-system-kernel, %hurd-default-operating-system): New exported variables. * gnu/system/examples/bare-hurd.tmpl: New file. * Makefile.am (EXAMPLES): Add it. * tests/guix-system.sh: Add --target=i586-pc-gnu when testing it. Jan (janneke) Nieuwenhuizen
2020-06-07git-authenticate: Prevent removal of '.guix-authorizations'....* guix/git-authenticate.scm (commit-authorized-keys) [parents-have-authorizations-file?, assert-parents-lack-authorizations]: New procedures. Use the latter before returning DEFAULT-AUTHORIZATIONS. * guix/git.scm (false-if-git-not-found): Export. * guix/tests/git.scm (populate-git-repository): Add 'remove' clause. * tests/git-authenticate.scm ("signed commits, .guix-authorizations removed"): New test. Ludovic Courtès
2020-06-06packages: Make 'bag-grafts' insensitive to '%current-target-system'....Fixes <https://bugs.gnu.org/41713>. Reported by Mathieu Othacehe. * guix/packages.scm (bag-grafts): Wrap 'fold-bag-dependencies' calls in 'parameterize'. * tests/packages.scm ("package->bag, sensitivity to %current-target-system"): New test. Ludovic Courtès
2020-06-05git-authenticate: Add tests....* guix/tests/git.scm (call-with-environment-variables) (with-environment-variables): Remove. * guix/tests/git.scm (populate-git-repository): Add clauses for signed commits and signed merges. * guix/tests/gnupg.scm: New file. * tests/git-authenticate.scm: New file. * tests/ed25519bis.key, tests/ed25519bis.sec: New files. * Makefile.am (dist_noinst_DATA): Add 'guix/tests/gnupg.scm'. (SCM_TESTS): Add 'tests/git-authenticate.scm'. (EXTRA_DIST): Add tests/ed25519bis.{key,sec}. Ludovic Courtès
2020-06-05tests: syscall: Support file-systems without extended attributes....* tests/syscalls.scm (setxattr): Catch ENOTSUP that can be raised if the file-system does not support extended user attributes. Mathieu Othacehe
2020-06-02tests: Allow passing on systems without support for swap devices....* tests/syscalls.scm ("swapon", "swapoff"): Accept ENOSYS as a valid result. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Simon South
2020-05-25gexp: Fix expansion for (file-append (local-file ...) ...)....Fixes <https://bugs.gnu.org/41527>. Regression introduced in d03001a31a6d460b712825640dba11e3f1a53a14. * guix/gexp.scm (lower+expand-object): When LOWERED is not a struct and EXPAND is true, call EXPAND. * tests/gexp.scm ("file-append, raw store item"): New test. Ludovic Courtès
2020-05-25tests: Hide quoted (define-module ...) form from Geiser....* tests/gexp.scm (%extension-package): Split (define-module ...) form to fool Geiser. Ludovic Courtès
2020-05-25channels: 'latest-channel-instances' guards against non-forward updates....* guix/channels.scm (latest-channel-instance): Add #:starting-commit and pass it to 'update-cached-checkout'. Return the commit relation as a second value. (ensure-forward-channel-update): New procedure. (latest-channel-instances): Add #:current-channels and #:validate-pull. [current-commit]: New procedure. Pass #:starting-commit to 'latest-channel-instance'. When the returned relation is true, call VALIDATE-PULL. (latest-channel-derivation): Add #:current-channels and #:validate-pull. Pass them to 'latest-channel-instances*'. * tests/channels.scm ("latest-channel-instances #:validate-pull"): New test. Ludovic Courtès
2020-05-25git: 'update-cached-checkout' returns the commit relation....* guix/git.scm (update-cached-checkout): Add #:starting-commit parameter. Call 'commit-relation' when #:starting-commit is true. Always return the relation or #f as the third value. (latest-repository-commit): Adjust accordingly. * guix/import/opam.scm (get-opam-repository): Likewise. * tests/channels.scm ("latest-channel-instances includes channel dependencies") ("latest-channel-instances excludes duplicate channel dependencies"): Update mock of 'update-cached-checkout' accordingly. Ludovic Courtès
2020-05-25git: Add 'commit-relation'....* guix/git.scm (commit-relation): New procedure. * tests/git.scm ("commit-relation"): New test. Ludovic Courtès
2020-05-23guix package: Support multiple profiles with '--list-installed'....* guix/scripts/package.scm (process-query): List installed multiple profiles. * tests/guix-package-net.sh: Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> zimoun
2020-05-23tests: Use a #:prefix for (gcrypt hash)....* tests/packages.scm: Use #:prefix instead of #:hide for (gcrypt hash). This accomodates for 'sha512' syntax literal matches with Guile-Gcrypt 0.3.0, which exports 'sha512' in addition to 'sha256'. Ludovic Courtès
2020-05-22packages: Introduce <content-hash> and use it in <origin>....* guix/packages.scm (<content-hash>): New record type. (define-content-hash-constructor, build-content-hash) (content-hash): New macros. (print-content-hash): New procedure. (<origin>): Rename constructor to '%origin'. [sha256]: Remove field. [hash]: New field. Adjust users. (origin-compatibility-helper, origin): New macros. (origin-sha256): New deprecated procedure. (origin->derivation): Adjust accordingly. * tests/packages.scm ("package-source-derivation, origin, sha512"): New test. * guix/tests.scm: Hide (gcrypt hash) 'sha256' for proper syntax matching. * tests/challenge.scm: Add #:prefix for (gcrypt hash) and adjust users. * tests/derivations.scm: Likewise. * tests/store.scm: Likewise. * tests/graph.scm ("bag DAG, including origins"): Provide 'sha256' field with the right length. * gnu/packages/aspell.scm (aspell-dictionary) (aspell-dict-ca, aspell-dict-it): Use 'hash' and 'content-hash' for proper syntax matching. * gnu/packages/bash.scm (bash-patch): Rename 'sha256' to 'sha256-bv'. * gnu/packages/bootstrap.scm (bootstrap-executable): Rename 'sha256' to 'bv'. * gnu/packages/readline.scm (readline-patch): Likewise. * gnu/packages/virtualization.scm (qemu-patch): Rename 'sha256' to 'sha256-bv'. * guix/import/utils.scm: Hide (gcrypt hash) 'sha256'. Ludovic Courtès
2020-05-22guix hash, guix download: Support base64 format....* guix/scripts/download.scm (show-help, %options): Support "base64" format. * guix/scripts/hash.scm (show-help, %options): Likewise. * tests/guix-hash.sh: Test it. * doc/guix.texi (Invoking guix hash): Document it. Ludovic Courtès
2020-05-22guix hash, guix download: Add '--hash'....* guix/scripts/download.scm (%default-options): Add 'hash-algorithm'. (show-help, %options): Add "--hash". (guix-download): Honor it. * guix/scripts/hash.scm (%default-options): Add 'hash-algorithm'. (show-help, %options): Add "--hash". (guix-hash): Honor it. * tests/guix-hash.sh: Test '-H sha512'. * doc/guix.texi (Invoking guix download): Document it. (Invoking guix hash): Document it. Ludovic Courtès
2020-05-22tests: Test fixed-output derivations with several hash algorithms....* tests/derivations.scm ("fixed-output derivation"): Test several hash algorithms. Ludovic Courtès
2020-05-22tests: Test 'add-to-store' with several hash algorithms....* tests/store.scm ("add-to-store"): New test. Ludovic Courtès
2020-05-20bootloader: grub: Allow booting from a Btrfs subvolume....* gnu/bootloader/grub.scm (strip-mount-point): Remove procedure. (normalize-file): Add procedure. (grub-configuration-file): New BTRFS-SUBVOLUME-FILE-NAME parameter. When defined, prepend its value to the kernel and initrd file names, using the NORMALIZE-FILE procedure. Adjust the call to EYE-CANDY to pass the BTRFS-SUBVOLUME-FILE-NAME argument. Normalize the KEYMAP file as well. (eye-candy): Add a BTRFS-SUBVOLUME-FILE-NAME parameter, and use it, along with the NORMALIZE-FILE procedure, to normalize the FONT-FILE and IMAGE nested variables. Adjust doc. * gnu/bootloader/depthcharge.scm (depthcharge-configuration-file): Adapt. * gnu/bootloader/extlinux.scm (extlinux-configuration-file): Likewise. * gnu/system/file-systems.scm (btrfs-subvolume?) (btrfs-store-subvolume-file-name): New procedures. * gnu/system.scm (operating-system-bootcfg): Specify the Btrfs subvolume file name the store resides on to the `operating-system-bootcfg' procedure, using the new BTRFS-SUBVOLUME-FILE-NAME argument. * doc/guix.texi (File Systems): Add a Btrfs subsection to document the use of subvolumes. * gnu/tests/install.scm (%btrfs-root-on-subvolume-os) (%btrfs-root-on-subvolume-os-source) (%btrfs-root-on-subvolume-installation-script) (%test-btrfs-root-on-subvolume-os): New variables. Maxim Cournoyer
2020-05-20file-systems: Add helpers for parsing the options string into an alist....* gnu/system/file-systems.scm (file-system-options->alist) (alist->file-system-options): New procedures. * tests/file-systems.scm: New tests. * doc/guix.texi (File Systems): Add note about the newly added procedures. Maxim Cournoyer
2020-05-16gexp: Add 'let-system'....* guix/gexp.scm (<system-binding>): New record type. (let-system): New macro. (system-binding-compiler): New procedure. (default-expander): Add 'self-quoting?' case. (self-quoting?): New procedure. (lower-inputs): Add 'filterm'. Pass the result of 'mapm/accumulate-builds' through FILTERM. (gexp->sexp)[self-quoting?]: Remove. * tests/gexp.scm ("let-system", "let-system, target") ("let-system, ungexp-native, target") ("let-system, nested"): New tests. * doc/guix.texi (G-Expressions): Document it. Ludovic Courtès
2020-05-14pack: Add relocation via ld.so and fakechroot....* gnu/packages/aux-files/run-in-namespace.c (HAVE_EXEC_WITH_LOADER): New macro. (bind_mount): Rename to... (mirror_directory): ... this. Add 'firmlink' argument and use it instead of calling mkdir/open/close/mount directly. (bind_mount, make_symlink): New functions. (exec_in_user_namespace): Adjust accordingly. (exec_with_loader) [HAVE_EXEC_WITH_LOADER]: New function. (exec_performance): New function. (engines): Add them. * guix/scripts/pack.scm (wrapped-package)[fakechroot-library] [audit-module]: New procedures. [audit-source]: New variable. [build](elf-interpreter, elf-loader-compile-flags): New procedures. (build-wrapper): Use them. * tests/guix-pack-relocatable.sh: Test with 'GUIX_EXECUTION_ENGINE=fakechroot'. * doc/guix.texi (Invoking guix pack): Document the 'performance' and 'fakechroot' engines. * gnu/packages/aux-files/pack-audit.c: New file. * Makefile.am (AUX_FILES): Add it. Ludovic Courtès
2020-05-14pack: Wrapper honors 'GUIX_EXECUTION_ENGINE' environment variable....* gnu/packages/aux-files/run-in-namespace.c (struct engine): New type. (exec_default): New function. (engines): New variable. (execution_engine): New function. (main): Use it instead of calling 'exec_in_user_namespace' and 'exec_with_proot' directly. * tests/guix-pack-relocatable.sh: Add test with 'GUIX_EXECUTION_ENGINE'. * doc/guix.texi (Invoking guix pack): Document 'GUIX_EXECUTION_ENGINE'. Ludovic Courtès
2020-05-14store: 'mapm/accumulate-builds' preserves '%current-target-system'....Fixes <https://bugs.gnu.org/41182>. * guix/store.scm (mapm/accumulate-builds): Pass #:system and #:target to 'run-with-store'. * tests/store.scm ("mapm/accumulate-builds, %current-target-system"): New test. * tests/guix-pack.sh: Add 'guix pack -d --target' test. Ludovic Courtès
2020-05-14packages: Ensure bags are insensitive to '%current-target-system'....Fixes a bug whereby a bag's transitive dependencies would depend on the global '%current-target-system' value. Partly fixes <https://issues.guix.gnu.org/41182>. * guix/packages.scm (bag-transitive-inputs) (bag-transitive-build-inputs, bag-transitive-target-inputs): Parameterize '%current-target-system'. * tests/packages.scm ("package->bag, sensitivity to %current-target-system"): New test. Ludovic Courtès
2020-05-14syscalls: Add 'getxattr'....* guix/build/syscalls.scm (getxattr): New procedure. * tests/syscalls.scm ("getxattr, setxattr"): Test it, together with setxattr. Jan (janneke) Nieuwenhuizen
2020-05-11guix graph: Add '--path'....* guix/scripts/graph.scm (display-path): New procedure. (%options, show-help): Add '--path'. (guix-graph): Handle it. * tests/guix-graph.sh: Add tests. * doc/guix.texi (Invoking guix graph): Document it. (Invoking guix size): Mention it. Ludovic Courtès
2020-05-11graph: Add 'shortest-path'....* guix/graph.scm (shortest-path): New procedure. * tests/graph.scm ("shortest-path, packages + derivations") ("shortest-path, reverse packages") ("shortest-path, references"): New tests. Ludovic Courtès
2020-05-11graph: reference/referrer node types work with graph traversal....The graph traversal procedures in (guix graph) assume that nodes can be compared with 'eq?', which was not the case for nodes of %REFERENCE-NODE-TYPE and %REFERRER-NODE-TYPE (strings). * guix/scripts/graph.scm (intern): New procedure. (ensure-store-items, references*) (%reference-node-type, non-derivation-referrers) (%referrer-node-type): Use it on all store items. * tests/graph.scm ("node-transitive-edges, references"): New test. Ludovic Courtès