Commit Graph

179 Commits (master)

Author SHA1 Message Date
Marius Bakke 3b97a1779f
services: Add Varnish service.
* gnu/services/web.scm (<varnish-configuration>): New record type.
(%varnish-accounts, %varnish-service-type): New variables.
(varnish-shepherd-service): New procedure.
* gnu/tests/web.scm (%varnish-vcl, %varnish-os): New variables.
(%test-varnish): New test.
* doc/guix.texi (Web Services): Document it.
2018-09-26 00:33:01 +02:00
Arun Isaac 9926b8f809
gnu: services: Add iptables service.
* gnu/services/networking.scm (<iptables-configuration>): New record type.
(iptables-service-type): New variable.
* gnu/tests/networking.scm (run-iptables-test): New procedure.
(%test-iptables): New variable.
* doc/guix.texi (Networking Services): Document it.
2018-09-20 13:09:55 +05:30
Ludovic Courtès 19de8273ee
services: tailon: Move to (gnu services web).
This allows (gnu services admin) to remain deeper in the module graph
and to be used by (gnu services web).

* gnu/services/admin.scm (<tailon-configuration-file>)
(tailon-configuration-files-string)
(tailon-configuration-file-compiler, <tailon-configuration>)
(tailon-shepherd-service, %tailon-accounts)
(tailon-service-type): Move to...
* gnu/services/web.scm: ... here.
* gnu/tests/admin.scm: Remove.  Move test to...
* gnu/tests/web.scm (%tailon-os)
(run-tailon-test, %test-tailon): ... here.
2018-09-10 12:12:50 +02:00
Ludovic Courtès 4ab6a2f23d
tests: base: Add Guile-Gcrypt & co. to the search path.
Fixes a regression introduced in
ca71942445, whereby (gcrypt hash) would
not be found in the system under test, leading to a failure of the
"/run/current-system is a GC root" test.

* gnu/tests/base.scm (run-basic-test)[guix&co]: New variable.
[test]: Add all of GUIX&CO to %LOAD-PATH.
2018-09-08 23:02:01 +02:00
Chris Marusich 3bcb305b98
services: tor: Make it easier to use UNIX sockets.
* doc/guix.texi (Networking Services): Document it, and mention that
tor-service is deprecated.
* gnu/services/networking.scm (<tor-configuration>) <socks-socket-type>:
New field.
(tor-configuration->torrc): When socks-socket-type is 'unix, set
SocksPort to UNIX domain socket /var/run/tor/socks-sock and set
UnixSocksGroupWritable to 1.
* gnu/tests/networking.scm (%tor-os/unix-socks-socket): Instead of using
a custom config file, just set socks-socket-type to 'unix.
2018-08-28 00:25:05 -07:00
Chris Marusich b0f951e4f0
tests: tor: Add more test cases.
* gnu/tests/networking.scm (%tor-os/unix-socks-socket): New variable.
(run-tor-test) <os/unix-socks-socket, marionette/unix-socks-socket>
<socket-directory>: New variables.
<"tor is alive">: Move common code from this test case...
<tor-is-alive?>: ...into this new procedure.
<"tor is listening", "tor is alive, even when using a SOCKS socket">
<"tor is listening, even when using a SOCKS socket">: New test cases.
2018-08-28 00:19:58 -07:00
Chris Marusich 5dfd80e1c5
services: tor: Add a system test.
* gnu/services/networking.scm (tor-configuration->torrc): Set PidFile to
/var/run/tor/tor.pid in the base torrc configuration.
(tor-shepherd-service) <start>: Call make-forkexec-constructor/container with
a new #:pid-file argument to tell Shepherd where to find the PID file.  Add a
a new <file-system-mapping> to its existing #:mappings argument to share
/var/run/tor with the the container.
(tor-hidden-services-activation): Update docstring.  Create /var/run/tor and
set its permissions so only the tor user can access it.
* gnu/tests/networking.scm (%test-tor, %tor-os): New variables.
(run-tor-test): New procedure.
2018-08-28 00:14:24 -07:00
Arun Isaac de30205ba0
gnu: services: Add pcscd service.
* gnu/services/security-token.scm: New file.
* gnu/tests/security-token.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Register new files.
* doc/guix.texi (Miscellaneous Services): Document the service.
2018-08-16 02:46:27 +05:30
Ludovic Courtès 147c5aa5d4
services: mcron: Add 'schedule' action.
Inspired by
<https://lists.gnu.org/archive/html/help-guix/2018-07/msg00035.html>.

* gnu/services/mcron.scm (shepherd-schedule-action): New procedure.
(mcron-shepherd-services): Add 'actions' field.
* gnu/tests/base.scm (run-mcron-test)["schedule action"]: New test.
* doc/guix.texi (Scheduled Job Execution): Mention 'herd schedule'.
2018-07-13 00:08:55 +02:00
Gábor Boskovits a33652ee33
services: Add prometheus-node-exporter-service-type.
* gnu/services/monitoring.scm (prometheus-node-exporter-service-type):
New variable.
(<prometheus-node-exporter-configuration>): New record type.
(prometheus-node-exporter-shepherd-service): New procedure.
* gnu/doc/guix.texi (Monitoring Services): Document it.
* gnu/tests/monitoring.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add test module.
2018-07-09 10:39:06 +02:00
Ludovic Courtès 3c78f5b5c3
tests: basic: Wait for /var/run/shepherd/socket to be ready.
* gnu/tests/base.scm (run-basic-test)["shepherd socket ready"]: New test.
2018-07-03 17:50:04 +02:00
Ludovic Courtès 378daa8cb6
services: boot: Take gexps instead of monadic gexps.
* gnu/services.scm (compute-boot-script): Rename 'mexps' to 'gexps' and
remove 'mlet' form.
(boot-service-type): Update comment.
(cleanup-gexp): Remove 'with-monad' and 'return'.
(activation-script): Rewrite in non-monadic style: use 'scheme-file'
instead of 'gexp->file'.
(gexps->activation-gexp): Remove 'mlet', return a gexp.
* gnu/services/shepherd.scm (shepherd-boot-gexp): Remove 'with-monad'
and 'return'.
* gnu/system.scm (operating-system-boot-script): Remove outdated comment.
* gnu/tests/base.scm (%cleanup-os): For 'dirty-service', remove
'with-monad' and 'return'.
2018-06-20 23:47:08 +02:00
Ludovic Courtès 76c321d8e8
services: cleanup: Expect file names to be UTF-8-encoded.
Fixes <https://bugs.gnu.org/26353>.
Reported by Danny Milosavljevic <dannym@scratchpost.org>.

* gnu/services.scm (cleanup-gexp): Add 'setenv' and 'setlocale' calls
before 'delete-file-recursively'.
* gnu/tests/base.scm (%cleanup-os, %test-cleanup): New variables.
(run-cleanup-test): New procedure.
2018-06-20 10:05:18 +02:00
Clément Lassieur c24b15472b
tests: Honor the return value of 'start-service'.
Since commit dc7b3e5633, 'start-service' returns
the Shepherd's representation of the service as a sexp, and '#f' if the
service fails to start.  Also, it doesn't throw an exception when the service
fails to start, so relying on an exception instead of relying on its return
value is a false positive.

* gnu/tests/base.scm (run-nss-mdns-test): Split tests so to check the return
value of 'start-service'.
(run-mcron-test, run-nss-mdns-test): Use 'test-assert' with the return value
of 'start-service'.
* gnu/tests/admin.scm (run-tailon-test): Idem.
* gnu/tests/dict.scm (run-dicod-test): Idem.
* gnu/tests/mail.scm (run-opensmtpd-test, run-exim-test, run-dovecot-test):
Idem.
* gnu/tests/messaging.scm (run-xmpp-test, run-bitlbee-test): Idem.
* gnu/tests/nfs.scm (run-nfs-test): Idem.
* gnu/tests/rsync.scm (run-rsync-test): Idem.
* gnu/tests/ssh.scm (run-ssh-test): Idem.
* gnu/tests/version-control.scm (run-cgit-test, run-git-http-test): Idem.
* gnu/tests/web.scm (run-php-fpm-test): Idem.
2018-06-13 09:11:45 +02:00
Ludovic Courtès ff913cf514
tests: ssh: Use 'with-extensions'.
* gnu/tests/ssh.scm (run-ssh-test)[test]: Wrap body in
'with-extensions'.  Remove %load-path manipulation code.
2018-06-01 15:21:28 +02:00
Rouby Pierre-Antoine 93b83eb31e
services: Add hpcguix-web.
* gnu/service/web.scm (<hpcguix-web-configuration>): New record-type.
  (%hpcguix-web-accounts): New variable.
  (%hpcguix-web-activation,hpcguix-web-shepherd-service,
  hpcguix-web-service-type): New procedures.
* gnu/tests/web.scm (run-hpcguix-web-server-test): New procedure.
  (%hpcguix-web-specs, %hpcguix-web-os, %test-hpcguix-web): New variable.
* doc/guix.texi (Web Services): Add 'hpcguix-web'.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2018-06-01 13:50:26 +02:00
Ludovic Courtès 7a4e2eaab3
marionette: Add 'wait-for-tcp-port'.
* gnu/build/marionette.scm (wait-for-tcp-port): New procedure.
* gnu/tests/dict.scm (run-dicod-test)["connect inside"]: Use it instead
of the inline loop.
2018-06-01 13:50:26 +02:00
Ludovic Courtès 9ceeca0880
system: Remove uses of the 'title' field of <file-system>.
* gnu/system/install.scm (installation-os): Remove uses of the 'title'
field of 'file-system'; use 'file-system-label' as appropriate.
* gnu/system/vm.scm (system-disk-image, system-qemu-image): Likewise.
* gnu/tests.scm (%simple-os): Likewise.
* gnu/tests/install.scm (%minimal-os, %minimal-extlinux-os)
(%minimal-os-on-vda, %separate-home-os, %separate-store-os)
(%raid-root-os, %encrypted-root-os, %btrfs-root-os): Likewise.
* gnu/build/shepherd.scm (default-mounts)[tmpfs]: Likewise.
* tests/guix-system.sh: Likewise.
* tests/system.scm (%root-fs): Likewise.
("operating-system-boot-mapped-devices, implicit dependency"): Likewise.
2018-05-28 13:24:19 +02:00
Danny Milosavljevic d94e81dbfc
services: Add modem-manager-service-type.
* gnu/services/networking.scm (modem-manager-service-type): New variable.
(<modem-manager-configuration>): New variable.
(modem-manager-configuration): New procedure.
(modem-manager-configuration?): New procedure.
* doc/guix.texi (Networking Services): Document it.
* gnu/tests/networking.scm: Import (gnu services base).
2018-04-30 03:47:16 +02:00
Chris Marusich f1104d9009
services: Add dhcpd-service-type and <dhcpd-configuration>.
* doc/guix.texi (Networking Services): Document it.
* gnu/services/networking.scm (dhcpd-service-type): Add it.
(dhcpd-configuration, dhcpd-configuration?): Add it.
(dhcpd-configuration-package): Add it.
(dhcpd-configuration-config-file): Add it.
(dhcpd-configuration-version): Add it.
(dhcpd-configuration-run-directory): Add it.
(dhcpd-configuration-lease-file): Add it.
(dhcpd-configuration-pid-file): Add it.
(dhcpd-configuration-interfaces): Add it.
* gnu/tests/networking.scm (minimal-dhcpd-v4-config-file)
(dhcpd-v4-configuration, %dhcpd-os, run-dhcpd-test, %test-dhcpd): New
variables.
2018-04-21 23:46:30 -07:00
Ludovic Courtès 67a51b6755
gnu: mcron: Update to 1.1.1.
Fixes <https://bugs.gnu.org/31113>.
Reported by George myglc2 Clemmer <myglc2@gmail.com>.

* gnu/packages/guile.scm (mcron): Update to 1.1.1.
[arguments]: Change timezone in 'set-timezone' phase.  Remove
'disable-schedule-test' and 'wrap-programs' phases.  Add 'adjust-tests'
phase.
* gnu/tests/base.scm (%mcron-os): Change JOB1 to use the 'next-seconds'
form.
2018-04-19 00:14:50 +02:00
Ludovic Courtès cfbf6de18c
gnu: mcron: Update to 1.1 and deprecate "mcron2".
* gnu/packages/guile.scm (mcron): Update to 1.1.
[native-inputs]: Add TZDATA-FOR-TESTS.
[arguments]: New field.
(mcron2): Define using 'deprecated-package'.
* gnu/services/mcron.scm: Replace 'mcron2' with 'mcron'.
* doc/guix.texi (Scheduled Job Execution): Likewise.
* gnu/tests/base.scm (%mcron-os): Remove comment about mcron2.
2018-03-19 23:19:49 +01:00
Christopher Baines 69f7cf2bf4
tests: databases: Add a system test for PostgreSQL.
* gnu/tests/databases.scm (%postgresql-os, %test-postgresql): New variables.
(run-postgresql-test): New procedure.
2018-03-10 16:20:55 +00:00
Oleg Pykhalov a9079b4880
tests: mail: Add test for dovecot.
* gnu/tests/mail.scm (%dovecot-os, %test-dovecot): New variables.
(run-dovecot-test): New procedure.
2018-03-09 17:24:45 +03:00
Ludovic Courtès bc499b113a
system: Add 'initrd-modules' field.
* gnu/system.scm (<operating-system>)[initrd-modules]: New field.
(operating-system-initrd-file): Pass #:linux-modules to 'make-initrd'.
* gnu/system/linux-initrd.scm (default-initrd-modules): New procedure.
(%base-initrd-modules): New macro.
(base-initrd): Add #:linux-modules and honor it.
* gnu/system/install.scm (embedded-installation-os): Use
'initrd-modules' instead of 'initrd'.
* gnu/tests/install.scm (%raid-root-os): Likewise.
* doc/guix.texi (operating-system Reference): Add 'initrd-modules'.
(Initial RAM Disk): Document it.  Adjust example to not use
 #:extra-modules.
2018-03-02 13:53:10 +01:00
Oleg Pykhalov e1cf4fd2d2
services: cgit: Add more configuration fields.
* gnu/services/version-control.scm (cgit-service-type): Move to separate file.
* gnu/services/cgit.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add this.
* gnu/tests/version-control.scm: Add this.
* doc/guix.texi (Cgit Service): Document this.
2018-02-28 04:40:56 +03:00
Ludovic Courtès 900be977ae
tests: Remove outdated comment.
* gnu/tests/base.scm (run-basic-test): Remove outdated comment.
2018-02-19 22:04:11 +01:00
Ludovic Courtès d466b1fc82
services: Missing services are automatically instantiated.
This simplifies OS configuration: users no longer need to be aware of
what a given service depends on.

See the discussion at
<https://lists.gnu.org/archive/html/guix-devel/2018-01/msg00114.html>.

* gnu/services.scm (missing-target-error): New procedure.
(service-back-edges): Use it.
(instantiate-missing-services): New procedure.
* gnu/system.scm (operating-system-services): Call
'instantiate-missing-services'.
* tests/services.scm ("instantiate-missing-services")
("instantiate-missing-services, no default value"): New tests.
* gnu/services/version-control.scm (cgit-service-type)[extensions]: Add
FCGIWRAP-SERVICE-TYPE.
* gnu/tests/version-control.scm (%cgit-os): Remove NGINX-SERVICE-TYPE
and FCGIWRAP-SERVICE-TYPE instances.
* doc/guix.texi (Log Rotation): Remove 'mcron-service-type' in example.
(Miscellaneous Services): Remove 'nginx-service-type' and
'fcgiwrap-service-type' in Cgit example.
2018-01-21 00:24:03 +01:00
Ludovic Courtès bc58201ec2
tests: Cgit test waits for /var/run/shepherd/socket.
Previously tests sometimes start before the shepherd was listening,
leading to test failures.

* gnu/tests/version-control.scm (run-cgit-test)[test]: Add "shepherd
socket ready" test.  Rename to two "service running" tests for clarity.
2018-01-21 00:24:03 +01:00
Christopher Baines d067e4badc
gnu: services: web: Add service for httpd.
* gnu/services/web.scm (<httpd-module>,
  <httpd-config-file>, <httpd-virtualhost>
  <httpd-configuration>): New record types.
  (%default-httpd-modules, %httpd-accounts,
  httpd-service-type): New variables.
  (httpd-shepherd-services, httpd-activation,
  httpd-process-extensions): New procedures.
* gnu/tests/web.scm (run-httpd-test): New procedure.
  (%httpd-os, %tests-httpd): New variables.
* doc/guix.texi (Web Services): Document the Apache HTTP Server.
2018-01-17 08:43:47 +00:00
Christopher Baines d9b530813f
gnu: tests: web: Generalise the nginx test.
So that it can also be used for other web servers.

* gnu/tests/web.scm (%index.html-contents): Change nginx to guix.
  (%make-http-root): Move the index.html file from /srv to /srv/http.
  (%nginx-servers): Remove the setting of root.
  (run-nginx-test, run-webserver-test): Rename run-nginx-test to
  run-webserver-test and generalise its behaviour
  (%test-nginx): Change to use run-webserver-test, rather than run-nginx-test.
2018-01-17 08:43:41 +00:00
Ludovic Courtès c1816361ad
services: bitlbee: Add test.
* gnu/tests/messaging.scm (run-bitlbee-test): New procedure.
(%test-bitlbee): New variable.
2018-01-15 23:29:34 +01:00
Marius Bakke 671dbdb9d5
tests: networking: Add tests for Open vSwitch.
* gnu/tests/networking.scm (openvswitch-configuration-service,
%openvswitch-os): New variables.
(setup-openvswitch, run-openvswitch-test): New procedures.
(%test-openvswitch): New public variable.
2017-12-29 14:07:38 +01:00
Ludovic Courtès a1ac7bf361
tests: Adjust php-fpm test to new nginx API.
Fixes <https://bugs.gnu.org/29769>.
Reported by Mark H Weaver <mhw@netris.org>.

This is a followup to 8b223ceac4.

* gnu/tests/web.scm (%php-fpm-nginx-server-blocks): Turn 'listen' into a
list.
2017-12-19 09:53:56 +01:00
Clément Lassieur 8b223ceac4
services: nginx: Replace 'http-port' and 'https-port' with 'listen'.
* doc/guix.texi (Web Services, Version Control Services): Update accordingly.
* gnu/services/certbot.scm (certbot-nginx-server-configurations): Likewise.
* gnu/services/version-control.scm (%cgit-configuration-nginx): Likewise.
* gnu/services/web.scm (<nginx-server-configuration>,
emit-nginx-server-config): Likewise.
* gnu/tests/version-control.scm (%cgit-configuration-nginx,
%git-nginx-configuration): Likewise.
* gnu/tests/web.scm (%nginx-servers, %php-fpm-nginx-server-blocks): Likewise.
2017-12-18 12:03:14 +01:00
nee 64bae7237c
gnu: services: Add php-fpm.
* gnu/services/web.scm (<php-fpm-configuration>,
  <php-fpm-process-manager-configuration>): New record types.
  (php-fpm-configuration?,
   php-fpm-process-manager-configuration?,
   php-fpm-service-type,
   nginx-php-location): New procedures.
* doc/guix.texi (Web-Services): Document php-fpm service.
* gnu/tests/web.scm: Add php-fpm system test.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2017-12-12 21:29:39 +00:00
Christopher Baines c48aa70a9a
services: web: Remove default certificate and key files for nginx.
If nginx is configured with a ssl-certificate file, and ssl-certificate-key,
it will fail to start unless these exist. To avoid this happening, change the
default to #f.

* gnu/services/web.scm (<nginx-server-configuration>)
  [ssl-certificate,ssl-certificate-key]: Set the defaults to #f.
* gnu/tests/web.scm (%nginx-servers): Remove redundant
  nginx-server-configuration fields.
* doc/guix.texi (Web Services): Update examples and documentation.
2017-12-11 20:36:43 +00:00
Tobias Geerinckx-Rice fdfdecdb7e
gnu, doc, tests: Use ‘bootloader-configuration’ everywhere.
* doc/guix.texi (Proceeding with the Installation): Replace the old-style
‘grub-configuration’ with the newer ‘bootloader-configuration’ syntax.
* gnu/system/examples/vm-image.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)
(%separate-store-os, %raid-root-os, %encrypted-root-os, %btrfs-root-os):
Likewise.
* gnu/tests/nfs.scm (%base-os): Likewise.
* tests/guix-system.scm (OS_BASE, make_user_config): Likewise.
* tests/system.scm (%os, %os-with-mapped-device): Likewise.
2017-12-06 15:02:24 +01:00
Ludovic Courtès 87dad874c9
tests: Add 'git-http' test.
* gnu/tests/version-control.scm (%git-nginx-configuration)
(%git-http-os, %test-git-http): New variables.
(run-git-http-test): New procedure.
2017-11-28 23:34:25 +01:00
Ludovic Courtès e755692bc1
tests: cgit: Add a file to the test repository.
* gnu/tests/version-control.scm (README-contents): New variable.
(%make-git-repository): Add a 'README' file to the repo.
(%test-repository-service): New variable.
(%cgit-os): Use it.
(run-cgit-test): Test /test/tree/README and /test/tree/does-not-exist.
2017-11-28 23:34:25 +01:00
Clément Lassieur 5c22f3726e
tests: messaging: Enable Prosody DIGEST-MD5 auth mechanism.
GNU Freetalk doesn't support SCRAM-SHA-1.

* gnu/tests/messaging.scm (%test-prosody): Override default
disable-sasl-mechanisms value.
2017-11-26 15:32:16 +01:00
Oleg Pykhalov 5724a14e71
tests: install: Increase target-size.
1200 MiB are too small for a btrfs-root-os, thus let increase it.

* gnu/tests/install.scm (run-install): Increase target-size to 2200 MiB.
(%btrfs-root-installation-script): Increase my-root partition size to 2G.
2017-11-15 00:48:09 +03:00
Marius Bakke 5d7141cd28
tests: ssh: Make sure we can run executables from PATH.
* gnu/tests/ssh.scm (run-ssh-test): Add tests for running commands in system
and user profile.
2017-11-01 20:29:32 +01:00
Hartmut Goebel 91496dfc9a
tests: install: Estimate the installation system disk size.
1500 MiB are too small for a current system, thus let
system-disk-image estimate the required size.

* gnu/tests/install.scm: (run-install): Pass "#:disk-image-size
  'guess" to system-disk-image.
2017-10-30 09:12:56 +01:00
Christopher Baines 02bc41c4ce
tests: databases: Add a simple test for MySQL.
Previously, the activation phase for this service caused some systems using it
to not boot. This test checks that it's possible to boot a system using it,
and at least start the service.

* gnu/tests/databases.scm (%mysql-os, %test-mysql): New variables.
  (run-mysql-test): New procedure.
2017-10-08 17:31:49 +01:00
Christopher Baines 5266ff719e
services: Add MongoDB.
* gnu/services/databases.scm (%default-mongodb-configuration-file,
  %mongodb-accounts, mongodb-service-type): New variables.
  (<mongodb-configuration>): New record type.
  (mongodb-activation, mongodb-shepherd-service): New procedures.
* gnu/tests/databases.scm (%test-mongodb): New variable.
* doc/guix.texi (Database Services): Add MongoDB documentation.
2017-10-06 21:24:30 +01:00
Oleg Pykhalov 032a2760ee
gnu: services: Add cgit.
* gnu/services/version-control.scm
(<cgit-configuration-file>, <cgit-configuration>): New record types.
(cgit-configuration-robots-string, cgit-activation,
cgit-configuration-nginx-config): New procedures.
(%cgit-configuration-nginx, cgit-service-type): New variables.
* gnu/tests/version-control.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* doc/guix.texi (Version Control): Document the cgit service.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-10-03 17:07:54 +02:00
Ludovic Courtès 945a8fc240
tests: install: Switch to modifying the gc-root-service-type.
Fixes <https://bugs.gnu.org/28600>.
Fixes a regression introduced in
4e854b1814.
Reported by Christopher Baines <mail@cbaines.net>.

* gnu/tests/install.scm (operating-system-with-gc-roots): Use
'simple-service' to extend GC-ROOT-SERVICE-TYPE instead of instantiating
it.
2017-09-26 10:43:10 +02:00
Ludovic Courtès 077f1e6384
tests: mcron: Adjust use of 'wait-for-file'.
Fixes a regression introduced in
8bd5231485, whereby returning #<eof> would
no longer work (since #<eof> would be in the cdr of the result, and thus
it would not get converted to a string.)

* gnu/tests/base.scm (run-mcron-test)["root's job with command"]: Pass
  #:read to 'wait-for-file'.
2017-09-26 10:09:53 +02:00
Oleg Pykhalov 9db7e9be59
gnu: Add rsync service.
* doc/guix.texi (Networking Services): Add rsync service documentation.
* gnu/services/rsync.scm (<rsync-configuration>): New file.
* gnu/tests/rsync.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add new files.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2017-09-23 21:07:27 +01:00
Ludovic Courtès 4e39604111
tests: Fix incorrect use of 'file-append'.
Fixes a regression introduced in fbc7b1f125.

* gnu/tests/install.scm (run-install)[install]: Don't use 'file-append'
with a string as its first argument; use a gexp with 'string-append' instead.
Use a gexp instead of a list for "-cdrom IMG".
2017-09-08 00:11:21 +02:00
Ludovic Courtès cd1ad27e6c
gnu: elogind: Use itself as the cgroup controller.
Fixes a regression introduced in
fa67d56541 whereby elogind would fail to
start with:

  Cannot determine cgroup we are running in: No data available
  Out of memory.

thereby preventing log-in altogether.

* gnu/packages/freedesktop.scm (elogind)[arguments]: Pass
"--with-cgroup-controller=elogind".
* gnu/tests/desktop.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
2017-09-08 00:11:21 +02:00
Ludovic Courtès 13877c3453
marionette: 'wait-for-file' can be passed a read procedure.
* gnu/build/marionette.scm (wait-for-file): Add #:read parameter and
honor it.
* gnu/tests/base.scm (run-basic-test)["login on tty1"]: Use
'wait-for-file' instead of inline code.
2017-09-08 00:11:21 +02:00
Christopher Baines fbc7b1f125
tests: Add test for installing from an ISO Image.
* gnu/tests/install.scm (%test-iso-image-installer): New variable.
  (run-install): Add #:installation-disk-image-file-system-type as a keyword
  argument.
2017-09-06 08:43:56 +01:00
Ludovic Courtès 7f090203d5
services: user-processes: Reap child processes.
Fixes <http://bugs.gnu.org/26931>.
Reported by Leo Famulari <leo@famulari.name>.

* gnu/services/base.scm (user-processes-service-type)[stop]: Add
'reap-children' loop.
* gnu/tests/base.scm (run-halt-test): New procedure.
(%test-halt): New variable.
2017-08-28 09:56:33 +02:00
Marius Bakke 72e2815d18
Merge branch 'core-updates' 2017-08-26 15:15:49 +02:00
Andy Wingo 045ebb3e58
gnu: bootloader: Deprecate "device" field in favor of "target".
* 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-23 22:23:19 +02:00
Christopher Baines c075c8fd0c
tests: Add 'libvirt-service-type' test.
* gnu/tests/virtualization.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
2017-08-23 12:48:11 +01:00
Marius Bakke 2718a9cd09
Merge branch 'master' into core-updates 2017-08-21 02:40:37 +02:00
Christopher Baines 6230e155af
gnu: Fix memcached service startup.
Memcached changes to the memcached user from root before writing the PID
file. This means that it must be able to write the PID file as the memcached
user.

To make this work, create the /var/run/memcached directory when the service
starts, make it owned by memcached, and change memcached to write the PID file
to /var/run/memcached/pid.

This wasn't picked up by the system test as the "service running" part was too
permissive, and only failed on an error. Instead, test the response from
calling start-service and check that the PID is a number.

* gnu/services/databases.scm (memcached-activation): New variable.
  (memcached-shepherd-service): Change PID file location.
  (memcached-service-type): Extend the activation-service-type.
* gnu/tests/databases.scm (run-memcached-test)[test]: Change the "service
  running" test to check the response from the shepherd.
2017-08-15 22:24:15 +01:00
Mark H Weaver 09ec5a0f0c
Merge branch 'master' into core-updates 2017-08-15 03:10:14 -04:00
Peter Mikkelsen 06465d2ba4
gnu: Add mpd service.
* doc/guix.texi: Add documentation.
* gnu/services/audio.scm (<mpd-configuration>): New record type.
  (mpd-service-type): New service type.
* gnu/tests/audio.scm: New file.
* gnu/local.mk: Add new files.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2017-08-13 07:36:32 +01:00
Marius Bakke aa9780daf9
Merge branch 'master' into core-updates 2017-08-01 23:42:28 +02:00
Christopher Baines 119fdd0d0e
services: Add memcached.
* gnu/services/databases.scm (memcached-service-type, %memcached-accounts):
  New variables.
  (<memcached-configuration>): New record type.
  (memcached-service-type): New procedures.
* gnu/tests/databases.scm: New file.
* doc/guix.texi (Database Services): Document the new memcached service.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add entry for tests/databases.scm.
2017-07-30 09:08:30 +01:00
Christopher Baines 730ed6ec8b
gnu: services: admin: Add tailon.
* gnu/services/admin.scm
  (<tailon-configuration>, <tailon-configuration-file>): New record types.
  (tailon-configuration-files-string, tailon-shepherd-service): New
  procedures.
  (%tailon-accounts, tailon-service-type: New variables.
* doc/guix.texi (Monitoring Services: Document the Tailon service.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add gnu/tests/admin.scm.
* gnu/tests/admin.scm: New file.
2017-07-29 12:45:03 +01:00
Leo Famulari 6c1a317e29
Merge branch 'master' into core-updates 2017-07-23 03:42:12 -04:00
Ludovic Courtès 8b113790fa
tests: Use 'virtual-machine' records instead of monadic procedures.
* gnu/tests/base.scm (%test-basic-os): Use 'let*' instead of 'mlet*' and
'virtual-machine' instead of 'system-qemu-image/shared-store-script'.
(run-mcron-test): Likewise.
(run-nss-mdns-test): Likewise.
* gnu/tests/dict.scm (run-dicod-test): Likewise.
* gnu/tests/mail.scm (run-opensmtpd-test): Likewise.
(run-exim-test): Likewise.
* gnu/tests/messaging.scm (run-xmpp-test): Likewise.
* gnu/tests/networking.scm (run-inetd-test): Likewise.
* gnu/tests/nfs.scm (run-nfs-test): Likewise.
* gnu/tests/ssh.scm (run-ssh-test): Likewise.
* gnu/tests/web.scm (run-nginx-test): Likewise.
2017-07-20 11:57:13 +02:00
Ludovic Courtès 47ce813f7d
tests: ssh: Use 'guile-ssh'.
* gnu/tests/ssh.scm (run-ssh-test): Use GUILE-SSH instead of
GUILE2.0-SSH.
2017-07-18 22:38:03 +02:00
宋文武 59132b8000
gnu: Rename (gnu packages qemu) to (gnu packages virtualization).
* gnu/packages/qemu.scm: Rename this ...
* gnu/packages/virtualization.scm: ... to this.
* gnu/local.mk (GNU_SYSTEM_MODULES),
gnu/packages/bootloaders.scm, gnu/packages/debug.scm,
gnu/packages/gnome.scm, gnu/system/vm.scm,
gnu/tests/install.scm: Adjust accordingly.
2017-07-15 19:17:37 +08:00
Mathieu Othacehe a48a20fb98
tests: Add extlinux gpt test.
* gnu/tests/install.scm (%test-installed-extlinux-os): New exported
  variable.
(%minimal-extlinux-os, %minimal-extlinux-os-source): New variables.
(%extlinux-gpt-installation-script): New variable.
(run-install)[packages]: New argument. The packages specified are
appended to the installation image.
2017-06-21 09:57:12 +02:00
Ludovic Courtès 5fa7cc5335
marionette: Factorize 'wait-for-file'.
* gnu/build/marionette.scm (wait-for-file): New procedure.
* gnu/tests/base.scm (run-mcron-test)[test](wait-for-file): Remove.
Pass second argument in 'wait-for-file' calls.
* gnu/tests/ssh.scm (run-ssh-test)[test](wait-for-file): Remove.
Pass second argument in 'wait-for-file' calls.
* gnu/tests/messaging.scm (run-xmpp-test)[test](guest-wait-for-file):
Remove.
Use 'wait-for-file' instead, with second argument.
2017-06-12 23:34:14 +02:00
Ludovic Courtès 41db5a7563
activation: Change permissions on /root to #o700.
Reported by Alex Griffin <a@ajgrf.com>.
Fixes <http://bugs.gnu.org/27135>.

* gnu/build/activation.scm (add-user): When UID is zero, add 'chmod'
call.
* gnu/tests/base.scm (run-basic-test)["permissions on /root"]: New test.
2017-05-30 18:08:37 +02:00
Marius Bakke fd3782d13b
Merge branch 'version-0.13.0' 2017-05-22 18:25:01 +02:00
Ludovic Courtès 9d0c24d1be
tests: ssh: Use 'guile2.0-ssh'.
Fixes a regression introduced in 4d8806c3d6.

* gnu/tests/ssh.scm (run-ssh-test): Use GUILE2.0-SSH instead of GUILE-SSH.
2017-05-21 11:56:29 +02:00
Ludovic Courtès 51fe9cd38d
services: user-homes: Do not create home directories marked as no-create.
Fixes a bug whereby GuixSD would create the /nonexistent directory, from
user 'nobody', even though it has 'create-home-directory?' set to #f.

* gnu/build/activation.scm (activate-users+groups): Add comment for
\#:create-home?.
(activate-user-home)[ensure-user-home]: Skip when CREATE-HOME? is #f or
SYSTEM? is #t.
* gnu/tests/base.scm (run-basic-test)["no extra home directories"]: New
tests.
2017-05-20 10:17:10 +02:00
Ludovic Courtès 41f76ae08a
services: user-homes: Do not create home directories marked as no-create.
Fixes a bug whereby GuixSD would create the /nonexistent directory, from
user 'nobody', even though it has 'create-home-directory?' set to #f.

* gnu/build/activation.scm (activate-users+groups): Add comment for
\#:create-home?.
(activate-user-home)[ensure-user-home]: Skip when CREATE-HOME? is #f or
SYSTEM? is #t.
* gnu/tests/base.scm (run-basic-test)["no extra home directories"]: New
tests.
2017-05-18 10:55:16 +02:00
Mathieu Othacehe b09a8da4a2
bootloader: Add extlinux support.
* gnu/bootloader.scm: New file.
* gnu/bootloader/extlinux.scm: New file.
* gnu/bootloader/grub.scm: New file.
* gnu/local.mk: Build new files.
* gnu/system.scm: Adapt to new bootloader api.
* gnu/scripts/system.scm: Adapt to new bootloader api.
* gnu.scm: Remove (gnu system grub) and replace by (gnu bootloader) and (gnu
bootloader grub) modules.
* gnu/system/grub.scm: Moved content to gnu/bootloader/grub.scm.
* gnu/system/vm: Replace (gnu system grub) module by (gnu bootloader).
* gnu/tests.scm: Ditto.
* gnu/tests/nfs.scm: Ditto.
2017-05-16 14:41:01 +02:00
Ludovic Courtès e2f9832f45
tests: "basic" test loads (guix …) modules from the right place.
This is a followup to 7561881f2a.

* gnu/tests/base.scm (run-basic-test)["/run/current-system is a GC
root"]: Remove 'set!' statements, add 'add-to-load-path' statement for
GUIX.
2017-05-13 00:03:46 +02:00
Ludovic Courtès d5094c8115
tests: Strengthen GC root test.
* gnu/tests/base.scm (run-basic-test)["/run/current-system is a GC
root"]: Check for a specific return value, 'success!.
2017-05-13 00:03:46 +02:00
Carlo Zancanaro 950026ac7f
tests: mail: Add test for exim
* gnu/tests/mail.scm (%exim-os, %test-exim): New variables.
(run-exim-test): New procedure.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-04-19 23:43:50 +02:00
Ludovic Courtès cbe0af11b2
tests: dicod: Bail out if we cannot connect within 20 seconds.
* gnu/tests/dict.scm (run-dicod-test)["connect inside"]: Bail out after
20 seconds of failure to connect.
2017-04-16 00:48:08 +02:00
Ludovic Courtès efe7d19a9e
services: 'service-parameters' becomes 'service-value'.
* gnu/services.scm (<service>)[parameters]: Rename to...
[value]: ... this.
Change calls to 'service-parameters' to 'service-value'.
* gnu/system.scm, gnu/tests/base.scm,
guix/scripts/system.scm, tests/services.scm: Likewise.
* doc/guix.texi (Service Reference): Adjust accordingly.
2017-04-16 00:48:07 +02:00
Danny Milosavljevic 99828febe0
tests: Remove unused import (gnu system grub).
* gnu/tests/web.scm: Remove unused import.
2017-04-15 15:32:25 +02:00
Ludovic Courtès 985a8599ed
tests: Add GNU dicod test.
* gnu/tests/dict.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
2017-04-01 00:45:18 +02:00
Ludovic Courtès 892d9089a8
tests: Introduce 'simple-operating-system' and use it.
* gnu/tests.scm (%simple-os): New macro.
(simple-operating-system): New macro.
* gnu/tests/base.scm (%simple-os): Define using 'simple-operating-system'.
(%mcron-os): Use 'simple-operating-system'.
* gnu/tests/mail.scm (%opensmtpd-os): Likewise.
* gnu/tests/messaging.scm (%base-os, os-with-service): Remove.
(run-xmpp-test): Use 'simple-operating-system'.
* gnu/tests/networking.scm (%inetd-os): Likewise.
* gnu/tests/ssh.scm (%base-os, os-with-service): Remove.
(run-ssh-test): Use 'simple-operating-system'.
* gnu/tests/web.scm (%nginx-os): Likewise.
2017-04-01 00:45:18 +02:00
Thomas Danckaert 9260b9d100
services: Add inetd-service-type.
* gnu/services/networking.scm (<inetd-configuration>, <inetd-entry>): New
record types.
(inetd-config-file, inetd-shepherd-service): New procedures.
(inetd-service-type): New variable.
* doc/guix.texi (Networking Services): Document it.
* gnu/tests/networking.scm: New file.
* gnu/local.mk: Add it.
2017-03-24 17:45:56 +01:00
Clément Lassieur 36f666c63d
tests: ssh: Add a test for SFTP.
* gnu/tests/ssh.scm (run-ssh-test): Introduce "SFTP file writing and reading".
Make 'sftp?' a keyword parameter.
(%test-openssh): Pass #:sftp? #t to 'run-ssh-test'.
2017-03-21 20:49:26 +01:00
Clément Lassieur cfaf4d1165
tests: ssh: Abstract session connection and authentication.
* gnu/tests/ssh.scm (run-ssh-test): Introduce make-session-for-test,
call-with-connected-session and call-with-connected-session/auth.
(run-ssh-test)["connect"]: Rename to "shell command".  Abstract its session
connection and authentication work into the above three functions.
2017-03-21 20:49:26 +01:00
Clément Lassieur 533bc51469
tests: Add 'prosody-service-type' test.
* gnu/tests/messaging.scm: New file.
* gnu/services/messaging.scm: New exported procedure.
  (<shepherd-service>)[provision]: Add 'xmpp-daemon'.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-02-10 23:39:45 +01:00
Ludovic Courtès 387e175492
services: Add 'special-files-service-type'.
* gnu/build/activation.scm (activate-/bin/sh): Remove.
(activate-special-files): New procedure.
* gnu/services.scm (activation-script): Remove call to
'activate-/bin/sh'.
(special-files-service-type): New variable.
(extra-special-file): New procedure.
* gnu/services/base.scm (%base-services): Add SPECIAL-FILES-SERVICE-TYPE
instance.
* gnu/tests/base.scm (run-basic-test)[special-files]: New variables.
["special files"]: New test.
2017-02-08 16:17:05 +01:00
Ludovic Courtès cf98d342b0
activation: Set the right owner for home directories.
This fixes a regression introduced in
ae763b5b0b whereby home directories and
skeletons would be root-owned.

* gnu/build/activation.scm (copy-account-skeletons): Make 'directory' a
keyword parameter.  Add #:uid and #:gid and honor them.
[set-owner]: New procedure.
(activate-user-home): Add call to 'getpw' and 'chown'.  Pass UID and GID
to 'copy-account-skeletons'.
* gnu/tests/base.scm (run-basic-test)["skeletons in home directories"]:
Test file ownership under HOME.
2017-02-04 02:13:43 +01:00
Ludovic Courtès ae763b5b0b
system: Create home directories once 'file-systems' is up.
Fixes <http://bugs.gnu.org/21108>.
Reported by Andy Patterson <ajpatter@uwaterloo.ca>
and Leo Famulari <leo@famulari.name>.

* gnu/build/activation.scm (activate-users+groups)[activate-user]: Pass
  #:create-home? #t iff CREATE-HOME? and SYSTEM?.
(activate-user-home): New procedure.
* gnu/system/shadow.scm (account-shepherd-service): New procedure.
(account-service-type)[extensions]: Add SHEPHERD-ROOT-SERVICE-TYPE
extension.
* gnu/tests/base.scm (run-basic-test)["home"]
["skeletons in home directories"]: New tests.
* gnu/tests/install.scm (%separate-home-os, %separate-home-os-source)
(%test-separate-home-os): New variables.
2017-02-01 12:36:41 +01:00
Ludovic Courtès 2986995b85
services: Create /var/log/wtmp upon activation.
This fixes a bug whereby /var/log/wtmp would never be created, and thus
accounting information would be lost.

* gnu/services.scm (activation-script): Create /var/log/wtmp.
* gnu/tests/base.scm (run-basic-test)["wtmp entry"]: New test.
2017-01-24 00:46:37 +01:00
Ludovic Courtès caa7816673
services: Create /var/run/utmpx upon activation.
This fixes a bug whereby /var/run/utmpx would never be created, and thus
accounting information would be missing.

* gnu/services.scm (activation-script): Create /var/run/utmpx.
* gnu/tests/base.scm (run-basic-test)["utmpx entry"]: New test.
2017-01-19 23:45:11 +01:00
Ludovic Courtès 11f3885bb5
tests: Add 'nginx-service-type' test.
* gnu/tests/web.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
2017-01-19 14:44:59 +01:00
Ludovic Courtès 384344198d
file-systems: 'file-system-needed-for-boot?' is #t for parents of the store.
Suggested by John Darrington <john@darrington.wattle.id.au>.

* gnu/system/file-systems.scm (%not-slash): New variable.
(file-prefix?): New procedure.
(file-system-needed-for-boot?): Use it to check whether FS holds the
store.
* tests/file-systems.scm ("file-system-needed-for-boot?"): New test.
* gnu/tests/install.scm (%separate-store-os)[file-systems]: Remove
'needed-for-boot?' field for "/gnu".
2017-01-16 23:27:23 +01:00
David Craven b1a505baf6
system: Add btrfs file system support.
* gnu/build/file-systems.scm (%btrfs-endianness, btrfs-superblock?,
  read-btrfs-superblock, btrfs-superblock-uuid,
  btrfs-superblock-volume-name, check-btrfs-file-system): New variables.
  (%paritition-label-readers, %partition-uuid-readers): Add btrfs
  readers.
* gnu/system/linux-initrd.scm (linux-modules): Add btrfs modules when a
  btrfs file-system is used.
* gnu/tests/install.scm (%btrfs-root-os %btrfs-root-os-source,
  %btrfs-root-installation-script, %test-btrfs-root-os): New system
  test.
* doc/guix.texi: Adjust accordingly.

Fixes <http://bugs.gnu.org/19280>.
2017-01-10 12:00:35 +01:00
John Darrington 7d73b2c6d0
gnu: Add system test for the rpcbind-daemon service.
* gnu/tests/nfs.scm: New file.
* gnu/local.mk: Add it.
2016-12-15 19:13:46 +01:00
Ludovic Courtès 130079ae27
tests: Create a copy-on-write image instead of copying eagerly.
* gnu/tests/install.scm (qemu-command/writable-image): Invoke 'qemu-img
-o backing_file' instead of calling 'copy-file'.
2016-11-30 17:35:20 +01:00
宋文武 a82f0b3617
tests: Add 'opensmtpd-service-type' test.
* gnu/tests/mail.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
2016-11-27 10:15:43 +08:00