summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* tests: Adjust wildcard when testing OS examples.Ludovic Courtès2019-04-29
| | | | | * tests/guix-system.sh: Use *.tmpl instead of *, to avoid catching backup files, etc.
* guix package: Add 'guix search' alias.Ludovic Courtès2019-04-29
| | | | | | | | | * guix/scripts/search.scm: New file. * Makefile.am (MODULES): Add it. * po/guix/POTFILES.in: Add it. * tests/guix-package-aliases.sh: Add test. * doc/guix.texi (Invoking guix package): Document it and use it in a couple of examples.
* guix package: Add 'install', 'remove', and 'upgrade' aliases.Ludovic Courtès2019-04-29
| | | | | | | | | | | | | | | | * guix/scripts/install.scm, guix/scripts/remove.scm, guix/scripts/upgrade.scm, tests/guix-package-aliases.sh: New files. * Makefile.am (MODULES, SH_TESTS): Add them. * po/guix/POTFILES.in: Add them. * guix/scripts/package.scm (guix-package): Split with... (guix-package*): ... this. New procedure. * doc/guix.texi (Invoking guix package): Document them. (Binary Installation, Application Setup, Package Management) (Packages with Multiple Outputs, Package Modules) (X.509 Certificates, Installing Debugging Files): Use 'guix install' in simple examples. * etc/completion/bash/guix (_guix_complete): Handle "install", "remove", and "upgrade".
* tests: Adjust accounts test to shell-as-config change.Ludovic Courtès2019-04-27
| | | | | | | This is a followup to 504a0fc636ec591e65b4a229a37e522e425d8a0c. * tests/accounts.scm ("allocate-passwd with previous state"): Change expected 'shell' for "alice" to "/bin/sh".
* guix build: Accept multiple '-s' options.Ludovic Courtès2019-04-19
| | | | | | | | | | | * guix/scripts/build.scm (%default-options): Remove 'system'. (%options) <--system>: Keep previous occurrences of 'system in RESULT. (options->derivations)[system]: Remove. [systems, things-to-build]: New variables. [compute-derivation]: New procedure. Iterate on all of SYSTEMS to compute the derivations of THINGS-TO-BUILD. * tests/guix-build.sh: Add test for one and multiple '-s' flags. * doc/guix.texi (Additional Build Options): Document this behavior.
* tests: Gracefully skip zlib test when zlib is missing.Ludovic Courtès2019-04-16
| | | | | * tests/zlib.scm: Use 'test-skip' instead of (exit 77) when (zlib-available?) returns false.
* guix build: Fix relative file name canonicalization for '--root'.Ludovic Courtès2019-04-15
| | | | | | | | | Fixes <https://bugs.gnu.org/35271>. Reported by rendaw <7e9wc56emjakcm@s.rendaw.me>. * guix/scripts/build.scm (register-root): When ROOT is a relative file name, append the basename of ROOT, not ROOT itself. * tests/guix-build.sh: Add test.
* guix gc: Add '--list-roots'.Ludovic Courtès2019-04-10
| | | | | | | | * guix/scripts/gc.scm (show-help, %options): Add '--list-roots'. (guix-gc)[list-roots]: New procedure. Handle '--list-roots'. * tests/guix-gc.sh: Test it. * doc/guix.texi (Invoking guix gc): Document it.
* Add (guix store roots).Ludovic Courtès2019-04-10
| | | | | | * guix/store/roots.scm, tests/store-roots.scm: New files. * Makefile.am (STORE_MODULES): Add guix/store/roots.scm. (SCM_TESTS): Add tests/store-roots.scm.
* environment: '-C' creates namespaces where the user is not root.Ludovic Courtès2019-04-02
| | | | | | | | | * guix/scripts/environment.scm (launch-environment/container): Add UID and GID. Use them in PASSWD and GROUPS. Pass them as #:guest-uid and #:guest-gid to 'call-with-container'. * tests/guix-environment-container.sh: Test the inner UID. In '--user' test, replace hard-coded 0 with 1000. * doc/guix.texi (Invoking guix environment): Adjust accordingly.
* linux-container: Make the guest UID and GID a parameter.Ludovic Courtès2019-04-02
| | | | | | | | | * gnu/build/linux-container.scm (initialize-user-namespace): Add #:guest-uid and #:guest-gid parameters and honor them. (run-container): Likewise. (call-with-container): Likewise. * tests/containers.scm ("call-with-container, user namespace, guest UID/GID"): New test.
* records: Support custom 'this' identifiers.Ludovic Courtès2019-03-30
| | | | | | | | | | | This lets record users choose an identifier other than 'this-record'. * guix/records.scm (make-syntactic-constructor): Add #:this-identifier. [wrap-field-value]: Honor it. (define-record-type*): Add form with extra THIS-IDENTIFIER and honor it. * tests/records.scm ("define-record-type* & thunked & inherit & custom this"): New test.
* environment: Create /etc/group in containers.Ludovic Courtès2019-03-26
| | | | | | | | Reported by Pierre Neidhardt <mail@ambrevar.xyz>. * guix/scripts/environment.scm (launch-environment/container): Create GROUPS and call 'write-group'. * tests/guix-environment-container.sh: Test it.
* environment: Use (gnu build accounts) for /etc/passwd handling.Ludovic Courtès2019-03-26
| | | | | | | | | * guix/scripts/environment.scm (launch-environment/container): Remove call to 'mock-passwd'; instantiate a <password-entry> instead. Call 'write-passwd' to write the pasword database instead of using custom code. (mock-passwd): Remove. * tests/guix-environment-container.sh: Test 'getpwuid'.
* accounts: Add default value for the 'home-directory' field of <user-account>.Ludovic Courtès2019-03-25
| | | | | | | | | | | | | | | | | | * gnu/system/accounts.scm (<user-account>)[home-directory]: Mark as thunked and add a default value. (default-home-directory): New procedure. * doc/guix.texi (User Accounts): Remove 'home-directory' from example. * gnu/system/examples/bare-bones.tmpl: Likewise. * gnu/system/examples/beaglebone-black.tmpl: Likewise. * gnu/system/examples/desktop.tmpl: Likewise. * gnu/system/examples/docker-image.tmpl: Likewise. * gnu/system/examples/lightweight-desktop.tmpl: Likewise. * gnu/system/install.scm (installation-os): Likewise. * gnu/tests.scm (%simple-os): Likewise. * gnu/tests/install.scm (%minimal-os, %minimal-os-on-vda): (%separate-home-os, %encrypted-root-os, %btrfs-root-os): Likewise. * tests/accounts.scm ("allocate-passwd") ("allocate-passwd with previous state"): Likewise.
* records: Allow thunked fields to refer to 'this-record'.Ludovic Courtès2019-03-25
| | | | | | | | | | | | * guix/records.scm (this-record): New syntax parameter. (make-syntactic-constructor)[wrap-field-value]: When F is thunked, return a one-argument lambda instead of a thunk, and parameterize THIS-RECORD. (define-record-type*)[thunked-field-accessor-definition]: Pass X to (real-get X). * tests/records.scm ("define-record-type* & thunked & this-record") ("define-record-type* & thunked & default & this-record") ("define-record-type* & thunked & inherit & this-record"): New tests.
* tests: Adjust 'guix pack -f squashfs' test.Ludovic Courtès2019-03-24
| | | | | | | This is a followup to 427c87d0bdc06cc3ee7fc220fd3ad36084412533. * tests/pack.scm ("squashfs-image + localstatedir"): Expect "bin" to be a relative symlink.
* tests: Add missing import.Ludovic Courtès2019-03-24
| | | | | | This is a followup to 22f95e028f038cee342f455dfc55bd32b804907c. * tests/scripts.scm: Use (guix tests).
* graph: Add the 'reverse-bag' graph.Ludovic Courtès2019-03-23
| | | | | | | | | Suggested by Julien Lepiller. * guix/scripts/graph.scm (%reverse-bag-node-type): New variable. (%node-types): Add it. * tests/graph.scm ("reverse bag DAG"): New test. * doc/guix.texi (Invoking guix graph): Document it.
* guix build: '--with-commit' makes recursive checkouts.Ludovic Courtès2019-03-17
| | | | | | | | | | This was an omission from commit 024a6bfba906742c136a47b4099f06880f1d3f15. * guix/scripts/build.scm (transform-package-source-commit): Add 'recursive?' field to SOURCE. * tests/scripts-build.scm ("options->transformation, with-branch") ("options->transformation, with-commit"): New tests.
* guix build: Transformation options match packages by spec.Ludovic Courtès2019-03-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to combine several transformations on a given package, in particular '--with-git-url' and '--with-branch'. Previously transformations would ignore each other since they would all take (specification->package SOURCE) as their replacement source, compare it by identity, which doesn't work if a previous transformation has already changed SOURCE. * guix/scripts/build.scm (evaluate-replacement-specs): Adjust to produce an alist as expected by 'package-input-rewriting/spec', with a package spec as the first element of each pair. (evaluate-git-replacement-specs): Likewise. (transform-package-inputs): Adjust accordingly and use 'package-input-rewriting/spec'. (transform-package-inputs/graft): Likewise. (transform-package-source-branch, transform-package-source-commit): Use 'package-input-rewriting/spec'. (transform-package-source-git-url): Likewise, and adjust the REPLACEMENTS alist accordingly. (options->transformation): Iterate over OPTS instead of over %TRANSFORMATIONS. Invoke transformations one by one. * tests/scripts-build.scm ("options->transformation, with-input"): Adjust test to compare packages by name rather than by identity. ("options->transformation, with-git-url + with-branch"): New test.
* packages: Add 'package-input-rewriting/spec'.Ludovic Courtès2019-03-17
| | | | | | | * guix/packages.scm (package-input-rewriting/spec): New procedure. * tests/packages.scm ("package-input-rewriting/spec") ("package-input-rewriting/spec, partial match"): New tests. * doc/guix.texi (Defining Packages): Document it.
* guix build: Add '--with-git-url'.Ludovic Courtès2019-03-17
| | | | | | | | | | | | * guix/scripts/build.scm (%not-equal): New variable. (evaluate-git-replacement-specs): Use it instead of local variable 'not-equal'. (transform-package-source-git-url): New procedure. (%transformations): Add 'with-git-url'. (%transformation-options, show-transformation-options-help): Add '--with-git-url'. * tests/scripts-build.scm ("options->transformation, with-git-url"): New test.
* booloader: Add 'invoke/quiet'.Ludovic Courtès2019-03-16
| | | | | | | | | * gnu/build/bootloader.scm (G_): New macro. (open-pipe-with-stderr, invoke/quiet): New procedures. * tests/build-utils.scm ("invoke/quiet, success") ("invoke/quiet, failure") ("invoke/quiet, failure, message on stderr"): New tests. * po/guix/POTFILES.in: Add bootloader.scm.
* tests: Add 'with-environment-variable'.Ludovic Courtès2019-03-16
| | | | | | | * tests/scripts.scm (with-environment-variable): Move to... * guix/tests.scm (with-environment-variable): ... here. * tests/build-utils.scm ("wrap-program, one input, multiple calls"): Use it instead of 'setenv'.
* pack: "-RR" produces PRoot-enabled relocatable binaries.Ludovic Courtès2019-03-15
| | | | | | | | | | | | | | | | * gnu/packages/aux-files/run-in-namespace.c (exec_with_proot): New function. (main): When 'clone' fails, call 'rm_rf'. [PROOT_PROGRAM]: When 'clone' fails, call 'exec_with_proot'. * guix/scripts/pack.scm (wrapped-package): Add #:proot?. [proot]: New procedure. [build]: Compile with -DPROOT_PROGRAM when PROOT? is true. * guix/scripts/pack.scm (%options): Set the 'relocatable?' value to 'proot when "-R" is passed several times. (guix-pack): Pass #:proot? to 'wrapped-package'. * tests/guix-pack-relocatable.sh: Use "-RR" on Intel systems that lack user namespace support. * doc/guix.texi (Invoking guix pack): Document -RR.
* Add (gnu build accounts).Ludovic Courtès2019-03-07
| | | | | | * gnu/build/accounts.scm, tests/accounts.scm: New files. * Makefile.am (SCM_TESTS): Add tests/accounts.scm. * gnu/local.mk (GNU_SYSTEM_MODULES): Add build/accounts.scm.
* environment: Rename '--inherit' to '--preserve'.Ludovic Courtès2019-03-04
| | | | | | | | | Suggested by Eric Bavier and Ricardo Wurmus. * guix/scripts/environment.scm (show-help, %options): Emit a deprecation warning for "--inherit" and add -E/--preserve. * tests/guix-environment.sh: Adjust accordingly. * doc/guix.texi (Invoking guix environment): Update accordingly.
* environment: Remove deprecated -E/--exec option.Ludovic Courtès2019-03-04
| | | | | | * guix/scripts/environment.scm (%options): Remove "--exec", which was deprecated in commit 1de2fe95e017c42aacbaa34f5dab8d48249cc064 in 2015. * tests/guix-environment.sh: Remove use of '-E'.
* packages: Remove duplicates from package cache.Ludovic Courtès2019-02-16
| | | | | | | | | | | | | Previously the same package could appear several times if several variables were bound to it, as is notably the case for "python" currently. This, in turn, would lead to obnoxious "ambiguous package specification" messages. * gnu/packages.scm (generate-package-cache)[expand-cache]: Change RESULT to RESULT+SEEN and adjust accordingly. Call 'first' on the result of 'fold-module-public-variables*'. * tests/packages.scm ("fold-available-packages with/without cache"): Check for lack of duplicates in FROM-CACHE.
* environment: Add '--inherit'.Ludovic Courtès2019-02-16
| | | | | | | | | | | | | * guix/scripts/environment.scm (purify-environment): Add 'white-list' parameter and honor it. (create-environment): Add #:white-list parameter and honor it. (launch-environment): Likewise. (launch-environment/fork): Likewise. (show-help, %options): Add '--inherit'. (guix-environment): Define 'white-list' and pass it to 'launch-environment/fork'. * tests/guix-environment.sh: Test '--inherit'. * doc/guix.texi (Invoking guix environment): Document it.
* inferior: Add 'inferior-available-packages'.Ludovic Courtès2019-02-12
| | | | | * guix/inferior.scm (inferior-available-packages): New procedure. * tests/inferior.scm ("inferior-available-packages"): New test.
* profiles: Raise an error for unmatched patterns.Ludovic Courtès2019-02-07
| | | | | | | | | | | | | | | Previously, "guix package -r something-not-installed" would silently complete. Now an error is raised. * guix/profiles.scm (&unmatched-pattern-error): New condition type. (manifest-matching-entries): Rewrite to raise an error when one of PATTERNS is not matched. * guix/ui.scm (call-with-error-handling): Handle 'unmatched-pattern-error?'. * tests/guix-package.sh: Add test. * tests/profiles.scm ("manifest-matching-entries"): Don't try to remove unmatched pattern. ("manifest-matching-entries, no match"): New test. ("manifest-transaction-effects"): Remove 'remove' field.
* daemon: Emit a 'build-succeeded' event in check mode.Ludovic Courtès2019-02-06
| | | | | | | | | | | Until now, something like "guix build sed -v1 --check" would not get a 'build-succeeded' event, which in turn meant that the spinner would not be erased upon build completion. * nix/libstore/build.cc (DerivationGoal::registerOutputs): When 'buildMode' is bmCheck and 'settings.printBuildTrace' emit a "@ build-succeeded" trace upon success. * tests/store.scm ("build-succeeded trace in check mode"): New test.
* import: opam: Fix conditions.Julien Lepiller2019-02-05
| | | | | | * guix/import/opam.scm (condition-eq, condition-neq): The first argument can be empty. * tests/opam.scm: Add test case.
* status: Keep track of the current build phase.Ludovic Courtès2019-02-05
| | | | | | | | * guix/status.scm (<build>)[phase]: New field. (%phase-start-rx): New variable. (update-build): Add clause to match %PHASE-START-RX and adjust the 'phase' field accordingly. * tests/status.scm ("compute-status, build phase"): Add test
* daemon: Rename 'NIX_STATE_DIR' and 'NIX_DB_DIR' environment variables.Ludovic Courtès2019-02-04
| | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/22459>. Reported by Jeff Mickey <j@codemac.net>. * guix/config.scm.in (%state-directory): Change NIX_STATE_DIR to GUIX_STATE_DIRECTORY. (%store-database-directory): Change NIX_DB_DIR to GUIX_DATABASE_DIRECTORY. * nix/libstore/globals.cc (Settings::processEnvironment): Likewise. * guix/self.scm (make-config.scm): Likewise. * build-aux/build-self.scm (make-config.scm): Likewise. * build-aux/test-env.in: Likewise. * tests/derivations.scm ("derivation #:leaked-env-vars"): Likewise. * tests/guix-build.sh (GUIX_DAEMON_SOCKET): Likewise. * tests/guix-daemon.sh (socket): Likewise.
* status: Keep track of build completion as reported by build tools.Ludovic Courtès2019-01-29
| | | | | | | | | * guix/status.scm (<build>)[completion]: New field. (build): Add #:completion parameter. (%percentage-line-rx, %fraction-line-rx): New variables. (update-build): New procedure. (compute-status): Add 'build-log' case. * tests/status.scm ("compute-status, build completion"): New test.
* status: Record more information about builds.Ludovic Courtès2019-01-29
| | | | | | | | | | | | | | | * guix/status.scm (<build>): New record type. (build, matching-build): New procedures. (compute-status): Adjust to manipulate <build> records instead of derivation file names in 'build-status-builds-completed' and 'build-status-building'. (build-event-output-port)[process-line]: Use 'string-split' to preserve spaces. * tests/status.scm ("compute-status, builds + substitutes") ("compute-status, missing events"): Adjust to expect <build> records. Produce complete "build-started" events. ("compute-status, multiplexed build output"): Likewise, and remove "bar.drv" from 'builds-completed'.
* upstream: Temporarily skip failing test.Ludovic Courtès2019-01-28
| | | | * tests/upstream.scm ("coalesce-sources same version"): Skip.
* packages: Add 'package-closure'.Ludovic Courtès2019-01-25
| | | | | * guix/packages.scm (package-closure): New procedure. * tests/packages.scm ("package-closure"): New test.
* tests: Remove duplicate field initializers.Ludovic Courtès2019-01-24
| | | | | | | | | | | | | | | Fixes a regression introduced in c2dcff41c2e47f5f978f467864d5ed7829939884, whereby many tests in 'tests/packages.scm' would trigger a syntax error due to duplicate field intializers in forms like: (dummy-package "foo" (version "0")) * guix/tests.scm (dummy-package, dummy-origin): Rewrite to inherit from a base record. This restores the semantics from before c2dcff41c2e47f5f978f467864d5ed7829939884. * tests/services.scm ("instantiate-missing-services, indirect"): Remove duplicate 'extensions' field.
* records: Detect duplicate field initializers.Ludovic Courtès2019-01-22
| | | | | | | | | * guix/records.scm (report-duplicate-field-specifier): New procedure. (make-syntactic-constructor): Call it. * tests/records.scm ("define-record-type* & duplicate initializers"): New test. Co-authored-by: Mark H Weaver <mhw@netris.org>
* tests: Adjust for removal of 'device' field in <bootloader-configuration>.Ludovic Courtès2019-01-21
| | | | | | | This is a followup to commit 5f7467f046c3c1648cdf6eb81b3ec041bfc1f9bb. * tests/guix-system.sh: For <bootloader-configuration> records, use 'target' rather than 'device'.
* store: Rename '&nix-error' to '&store-error'.Ludovic Courtès2019-01-21
| | | | | | | | | | | | | | | | | | | * guix/store.scm (&nix-error): Rename to... (&store-error): ... this, and adjust users. (&nix-connection-error): Rename to... (&store-connection-error): ... this, and adjust users. (&nix-protocol-error): Rename to... (&store-protocol-error): ... this, adjust users. (&nix-error, &nix-connection-error, &nix-protocol-error): Define these condition types and their getters as deprecrated aliases. * build-aux/run-system-tests.scm, guix/derivations.scm, guix/grafts.scm, guix/scripts/challenge.scm, guix/scripts/graph.scm, guix/scripts/lint.scm, guix/scripts/offload.scm, guix/serialization.scm, guix/ssh.scm, guix/tests.scm, guix/ui.scm, tests/derivations.scm, tests/gexp.scm, tests/guix-daemon.sh, tests/packages.scm, tests/store.scm, doc/guix.texi: Adjust to use the new names.
* inferior: 'gexp->derivation-in-inferior' honors EXP's load path.Ludovic Courtès2019-01-20
| | | | | | | | | | | | Previously the imported modules and extensions of EXP would be missing from the load path of 'guix repl'. * guix/inferior.scm (gexp->derivation-in-inferior)[script]: New variable. [trampoline]: Write (primitive-load #$script) to PIPE. Add #$output. * tests/channels.scm ("channel-instances->manifest")[depends?]: Check for requisites rather than direct references. Adjust callers accordingly.
* channels: Don't pull from the same channel more than once.Ludovic Courtès2019-01-20
| | | | | | | | | | | | | Previous 'channel-instance->manifest' would call 'latest-channel-derivation', which could trigger another round of 'latest-repository-commit' for no good reason. * guix/channels.scm (resolve-dependencies): New procedure. (channel-instance-derivations)[edges]: New variable. [instance->derivation]: New procedure. * tests/channels.scm (make-instance): Use 'checkout->channel-instance' instead of 'channel-instance'. ("channel-instances->manifest"): New test.
* tests: More adjustments to python.scm split.Efraim Flashner2019-01-20
| | | | | | This is a followup to 44d10b1f722856ab8e9b942804aa7ef33e2ef739. * tests/lint.scm: Update imports.
* profiles: Allow a profile to be added as an entry of another profile.Ludovic Courtès2019-01-20
| | | | | | | * guix/build/profiles.scm (build-etc/profile): When 'OUTPUT/etc/profile' already exists, delete it first. (build-profile): Likewise for 'OUTPUT/manifest'. * tests/profiles.scm ("profile in profile"): New test.
* tests: Adjust to python.scm split.Ludovic Courtès2019-01-20
| | | | | | | This is a followup to 44d10b1f722856ab8e9b942804aa7ef33e2ef739. * tests/profiles.scm ("package->manifest-entry, search paths"): Adjust module name for PYTHON2-MATPLOTLIB.