Commit Graph

24 Commits

Author SHA1 Message Date
Mathieu Lirzin a9edb211e7 build: Add a Guile custom test driver using SRFI-64.
Before that '.log' files for scheme tests were fragmented and not
included in test-suite.log.  This unifies the semantics of SRFI-64 API
with Automake test suite.

* build-aux/test-driver.scm: New file.
* Makefile.am (SCM_LOG_DRIVER, AM_SCM_LOG_DRIVER_FLAGS): New variables.
(SCM_LOG_COMPILER, AM_SCM_LOG_FLAGS): Delete variables.
(AM_TESTS_ENVIRONMENT): Set GUILE_AUTO_COMPILE to 0.
* test-env.in: Silence guix-daemon.
* doc/guix.texi (Running the Test Suite): Describe how to display the
detailed results.  Bug reports require only 'test-suite.log' file.
* tests/base32.scm, tests/build-utils.scm, tests/builders.scm,
tests/challenge.scm, tests/cpan.scm, tests/cpio.scm, tests/cran.scm,
tests/cve.scm, tests/derivations.scm, tests/elpa.scm,
tests/file-systems.scm, tests/gem.scm, tests/gexp.scm,
tests/gnu-maintenance.scm, tests/grafts.scm, tests/graph.scm,
tests/gremlin.scm, tests/hackage.scm, tests/hash.scm,
tests/import-utils.scm, tests/lint.scm, tests/monads.scm, tests/nar.scm,
tests/packages.scm, tests/pk-crypto.scm, tests/pki.scm,
tests/profiles.scm, tests/publish.scm, tests/pypi.scm,
tests/records.scm, tests/scripts-build.scm, tests/scripts.scm,
tests/services.scm, tests/sets.scm, tests/size.scm, tests/snix.scm,
tests/store.scm, tests/substitute.scm, tests/syscalls.scm,
tests/system.scm, tests/ui.scm, tests/union.scm, tests/upstream.scm,
tests/utils.scm: Don't exit at the end of test groups.
* tests/containers.scm: Likewise.  Use 'test-skip' instead of exiting
with error code 77.
2016-04-03 14:19:09 +02:00
Ludovic Courtès 442a6ff5ea tests: Disable grafts by default.
Fixes <http://bugs.gnu.org/22872>.
Reported by myglc2 <myglc2@gmail.com>.

* test-env.in: Define and export 'GUIX_BUILD_OPTIONS'.
* tests/guix-build.sh: When setting 'GUIX_BUILD_OPTIONS', make sure it
contains '--no-grafts'.
* tests/guix-package.sh: Likewise.
* tests/guix-daemon.sh: Add (%graft? #f) in Scheme snippets.
2016-03-02 14:47:07 +01:00
Ludovic Courtès aac783cac5 build: Remove traces of 'NIX_SETUID_HELPER'.
This is a followup to 0919f5f4.

* test-env.in: Remove occurrences of 'NIX_SETUID_HELPER'.
2016-01-18 23:52:13 +01:00
Ludovic Courtès f073e52382 utils: Remove Nixpkgs helpers.
* guix/config.scm.in (%nixpkgs): Remove.
* guix/utils.scm (%nixpkgs-directory, nixpkgs-derivation,
  nixpkgs-derivation*): Remove.
* test-env.in: Export 'NIXPKGS'.
* tests/derivations.scm (%coreutils): Remove use of
  'nixpkgs-derivation'.
* tests/snix.scm (%nixpkgs-directory): New variable.
  Adjust users accordingly.
2015-10-06 23:51:04 +02:00
Ludovic Courtès 2178ed66f7 build: Reject or warn against file name length limit overruns.
* m4/guix.m4 (GUIX_TEST_ROOT_DIRECTORY, LINUX_HASH_BANG_LIMIT,
  SOCKET_FILE_NAME_LIMIT, GUIX_SOCKET_FILE_NAME_LENGTH,
  GUIX_TEST_SOCKET_FILE_NAME_LENGTH, GUIX_HASH_BANG_LENGTH,
  GUIX_CHECK_FILE_NAME_LIMITS): New macros.
* configure.ac: Use 'GUIX_CHECK_FILE_NAME_LIMITS'.
* config-daemon.ac: Use 'GUIX_TEST_ROOT_DIRECTORY'.
* test-env.in: Check socket name length and emit warning if it exceeds
  107.
2015-02-24 23:43:03 +01:00
nebuli 16eb115ef4 guix: scripts: Add GUIX_BUILD_OPTIONS environment handling.
* doc/guix.texi (Invoking guix build): Mention 'GUIX_BUILD_OPTIONS'.
* guix/scripts/archive.scm: (append args (environment-build-options)).
* guix/scripts/build.scm: Ditto.
* guix/scripts/environment.scm: Ditto.
* guix/scripts/package.scm: Ditto.
* guix/scripts/system.scm: Ditto.
* guix/ui.scm (environment-build-options): New function.
* guix/utils.scm (arguments-from-environment-variable): New function.
* tests/guix-build.sh: Add tests.
* test-env.in: Unset GUIX_BUILD_OPTIONS.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2014-11-30 18:54:07 +01:00
Ludovic Courtès d8805b95f5 build: Unset 'CDPATH' in 'test-env'.
Reported by Mathieu Lirzin.

* test-env.in: Unset 'CDPATH'.
2014-10-31 16:54:45 +01:00
Ludovic Courtès 4938b0eead substitute-binary: Ignore $GUIX_BINARY_SUBSTITUTE_URL.
* guix/scripts/substitute-binary.scm (%cache-url): Ignore the
  'GUIX_BINARY_SUBSTITUTE_URL' environment variable.
* test-env.in: Invoke 'guix-daemon' with '--substitute-urls'.
* tests/substitute-binary.scm: Set '%cache-url' to the value of
  'GUIX_BINARY_SUBSTITUTE_URL'.
2014-10-09 23:51:19 +02:00
Ludovic Courtès 8689901f95 Introduce the 'GUIX_PACKAGE_PATH' environment variable.
* gnu/packages.scm (%package-module-path): Honor $GUIX_PACKAGE_PATH.
* test-env.in: Unset 'GUIX_PACKAGE_PATH'.
* tests/guix-package.sh: Test it.
* doc/guix.texi (Package Modules): Document it.
2014-09-24 14:06:09 +02:00
Ludovic Courtès 736755e21e build: Ignore the user's language settings when running tests.
* test-env.in: Unset 'LANGUAGE', set 'LC_MESSAGE'.
2014-09-17 07:44:00 +02:00
Ludovic Courtès 8ad49499b9 build: Support running the test suite from a directory with symlinks.
Fixes <http://bugs.gnu.org/17935>.
Reported by Alex Kost <alezost@gmail.com>.

* test-env.in: Canonicalize $NIX_STORE_DIR, and remove
  $NIX_IGNORE_SYMLINK_STORE setting.
* tests/guix-register.sh: Likewise, canonicalize $new_store_dir and
  $new_store and leave $NIX_IGNORE_SYMLINK_STORE unchanged.
2014-07-05 19:15:08 +02:00
Nikita Karetnikov e9c6c58418 substitute-binary: Support the Signature field of a narinfo file.
* guix/scripts/substitute-binary.scm (<narinfo>): Add the 'signature'
  and 'contents' fields.
  (narinfo-signature->canonical-sexp): New function.
  (narinfo-maker): Add the 'signature' argument and use it.
  (assert-valid-signature): New function.
  (read-narinfo): Support the Signature field.
  (write-narinfo): Use 'narinfo-contents'.
  (%allow-unauthenticated-substitutes?): New variable.
* guix/base64.scm, tests/base64.scm, tests/substitute-binary.scm: New files.
* Makefile.am (SCM_TESTS): Add tests/base64.scm and
  tests/substitute-binary.scm.
  (MODULES): Add guix/base64.scm.
* test-env.in: Set 'GUIX_ALLOW_UNAUTHENTICATED_SUBSTITUTES'.
2014-03-30 12:02:10 +02:00
Ludovic Courtès aa2480e50d build: Fix test failures due to the nix -> guix directory name change.
Reported by Nikita Karetnikov <nikita@karetnikov.org>
and Pierre-Antoine Rault <par@rigelk.eu>.

* test-env.in: Change 'NIX_LOG_DIR' in accordance with f5768af.
* tests/guix-register.sh: Likewise for 'NIX_LOG_DIR' and 'NIX_DB_DIR'.
2014-03-17 23:30:42 +01:00
Ludovic Courtès 70d1ce9afc build: Set 'NIX_LIBEXEC_DIR' in 'pre-inst-env'.
Reported by Nikita Karetnikov <nikita@karetnikov.org>.

* test-env.in: Move 'NIX_LIBEXEC_DIR' setting to...
* pre-inst-env.in: ... here.
2014-01-26 15:53:56 +01:00
Ludovic Courtès 526382ff92 daemon: Implement signed archive import/export.
* guix/scripts/authenticate.scm, nix/scripts/guix-authenticate.in,
  tests/signing-key.pub, tests/signing-key.sec: New files.
* po/POTFILES.in: Add 'guix/scripts/authenticate.scm'.
* guix/store.scm (dump-port): New procedure.
  (process-stderr): Add 'user-port' optional parameter.  Handle
  the %STDERR-WRITE and %STDERR-READ cases as expected.
  (import-paths, export-path, export-paths): New procedures.
* tests/store.scm ("export/import several paths", "import corrupt
  path"): New tests.
* Makefile.am (MODULES): Add 'guix/scripts/authenticate.scm'.
  (EXTRA_DIST): Add 'tests/signing-key.{pub,sec}'.
* daemon.am (libstore_a_CPPFLAGS)[-DNIX_CONF_DIR]: Change 'NIX_CONF_DIR'
  to .../guix.  Change 'OPENSSL_PATH' to 'guix-authenticate'.
* config-daemon.ac: Instantiate 'nix/scripts/guix-authenticate'.
* nix/nix-daemon/guix-daemon.cc (main): Augment $PATH to include
  'settings.nixLibexecDir'.
* test-env.in: Export 'NIX_CONF_DIR' and 'NIX_LIBEXEC_DIR'.  Populate
  $NIX_CONF_DIR.
2013-12-20 17:17:42 +01:00
Ludovic Courtès b49632e793 daemon: Set the umask to 022 when starting.
* nix/nix-daemon/guix-daemon.cc (main): Add 'umask' call.
* test-env.in: Remove use of 'umask'.
2013-10-10 21:43:14 +02:00
Ludovic Courtès a7a4e6a4f7 Add 'guix-register'.
* nix/guix-register/guix-register.cc, tests/guix-register.sh: New
  files.
* Makefile.am (SH_TESTS)[BUILD_DAEMON]: Add tests/guix-register.sh.
* daemon.am (sbin_PROGRAMS, guix_register_SOURCES,
  guix_register_CPPFLAGS, guix_register_LDADD): New variables.
* test-env.in: Export 'storedir', 'prefix', 'datarootdir', 'datadir',
  and 'localstatedir'.
2013-09-23 00:33:50 +02:00
Ludovic Courtès caddc24fa4 build: Set the umask to 0022 before running the daemon for tests.
* test-env.in: Run "umask 0022" before running the daemon.
  Reported by Matthew Lien - 練喆明 <bluet@bluet.org>
2013-07-08 22:43:53 +02:00
Ludovic Courtès eba783b7b2 substitute-binary: Add a local cache.
* guix/scripts/substitute-binary.scm (%narinfo-cache-directory,
  %narinfo-ttl, %narinfo-negative-ttl): New variables.
  (with-atomic-file-output, object->fields, read-narinfo,
  write-narinfo, narinfo->string, string->narinfo, lookup-narinfo): New
  procedures.
  (fetch-narinfo): Adjust to use `read-narinfo'.
  (guix-substitute-binary): Ensure the existence of
  %NARINFO-CACHE-DIRECTORY.  Use `lookup-narinfo' instead of
  `fetch-narinfo'.
2013-04-15 23:42:55 +02:00
Ludovic Courtès f65cf81a3c Add preliminary binary substituter.
* guix/scripts/substitute-binary.scm: New file.
* Makefile.am (MODULES): Add it.
* nix/scripts/substitute-binary.in: New file.
* config-daemon.ac: Produce nix/scripts/substitute-binary.
* daemon.am (nodist_pkglibexec_SCRIPTS): Add
  nix/scripts/substitute-binary.
* guix/store.scm (substitutable-path-info): Use the
  `query-substitutable-path-infos' RPC.
* nix/nix-daemon/guix-daemon.cc (main): Honor `NIX_SUBSTITUTERS'.
* pre-inst-env.in: Set `NIX_SUBSTITUTERS'.
* test-env.in: Leave `NIX_SUBSTITUTERS' unchanged.  Set
  `GUIX_BINARY_SUBSTITUTE_URL, and create
  $NIX_STATE_DIR/substituter-data.
  Run `guix-daemon' within `./pre-inst-env'.
* tests/store.scm ("substitute query"): New test.
2013-04-03 22:44:39 +02:00
Ludovic Courtès 233e76769a Update license headers.
Change all license headers, except guix/build/* and ld-wrapper.scm, with
this code:

  (use-modules (guix build utils)
	       (srfi srfi-1))

  (fluid-set! %default-port-encoding "UTF-8")

  (substitute* (remove (lambda (f)
			 (or (string-contains f ".tar.")
			     (string-contains f ".git/")
			     (string-contains f ".so")
			     (string-suffix? ".o" f)
			     (string-suffix? ".a" f)
			     (string-suffix? ".go" f)
			     (string-suffix? ".pdf" f)
			     (string-suffix? ".png" f)
			     (string-suffix? ".info" f)
			     (equal? (basename f) "guix-daemon")
			     (equal? (basename f) "nix-setuid-helper")
			     (string-contains f "nix-upstream/")
			     (string-contains f "distro/packages/bootstrap/")))
		       (find-files "." "\\.[a-z]+$"))
    (("^([[:graph:]]+) This file is part of Guix." _ comment-start)
     (string-append comment-start " This file is part of GNU Guix."))
    (("^([[:graph:]]+) Guix --- Nix package management.*" _ comment-start)
     (string-append comment-start
		    " GNU Guix --- Functional package management for GNU\n"))
    (("^([[:graph:]]+) Guix is " _ comment-start)
     (string-append comment-start " GNU Guix is "))
    (("^([[:graph:]]+) along with Guix." _ comment-start)
     (string-append comment-start " along with GNU Guix."))
    (("^([[:graph:]]+) Copyright \\(C\\)" _ comment-start)
     (string-append comment-start " Copyright ©")))

Change headers using C-style comments manually.
2013-01-06 00:47:50 +01:00
Ludovic Courtès e1b7096acd daemon: Build `nix-setuid-helper'.
* daemon.am (libexec_PROGRAMS, nix_setuid_helper_SOURCES,
  nix_setuid_helper_CPPFLAGS, nix_setuid_helper_LDADD): New variables.
* test-env.in: Set and export `NIX_SETUID_HELPER'.
* README (Installing Guix as non-root): New section.
2012-12-14 18:15:37 +01:00
Ludovic Courtès 8a9451c89e tests: Arrange to have the socket file name fit in `sun_path'.
* test-env.in (NIX_STATE_DIR): Choose a slightly smaller directory name.
2012-12-13 00:24:27 +01:00
Ludovic Courtès 69cfce50db build: Run all the tests against the just-built daemon.
* test-env.in: New file.
* configure.ac: Add it to `AC_CONFIG_FILES' and `commands-exec'.
* config-daemon.ac: Set and substitute `GUIX_TEST_ROOT'.
* Makefile.am (SCM_LOG_COMPILER, SH_LOG_COMPILER): Use it in lieu of
  `pre-inst-env'.
* daemon.am (test_root): Remove
  (AM_TESTS_ENVIRONMENT): Remove `TEST_ROOT'.
  (clean-local): Use $(GUIX_TEST_ROOT); make files writable before
  removing them.guix_test_root
* tests/guix-daemon.sh: Remove `NIX_' variable settings; don't launch
  `guix-daemon'.
2012-12-06 00:07:08 +01:00