guix/gnu/tests
Maxim Cournoyer 85b4dabd94
services: jami: Modernize to adjust to Shepherd 0.9+ changes.
This partially fixes <https://issues.guix.gnu.org/54786>, allowing the 'jami'
and 'jami-provisioning' system tests to pass again.

In version 0.9.0, Shepherd constructors are now run concurrently, via
cooperative scheduling (Guile Fibers).  The Jami service previously relied on
blocking sleeps while polling for D-Bus services to become ready after forking
a process; this wouldn't work anymore since while blocking the service process
wouldn't be given the chance to finish starting.  The new reliance on Fibers
in Shepherd's fork+exec-command in the helper 'send-dbus' procedure also meant
that it wouldn't work outside of Shepherd anymore.  Finally, the
'start-service' Shepherd procedure used in the test suite would cause the Jami
daemon to be spawned multiple times (a bug introduced in Shepherd 0.9.0).

To fix/simplify these problems, this change does the following:

1. Use the Guile AC/D-Bus library for D-Bus communication, which simplify
things, such as avoiding the need to fork 'dbus-send' processes.

2. The non-blocking 'sleep' version of Fiber is used for the 'with-retries'
waiting syntax.

3. A 'dbus' package variant is used to adjust the session bus configuration,
tailoring it for the use case at hand.

4. Avoid start-service in the tests, preferring 'jami-service-available?' for
now.

* gnu/build/jami-service.scm (parse-dbus-reply, strip-quotes)
(deserialize-item, serialize-boolean, dbus-dict->alist)
(dbus-array->list, parse-account-ids, parse-account-details)
(parse-contacts): Delete procedures.
(%send-dbus-binary, %send-dbus-bus, %send-dbus-user, %send-dbus-group)
(%send-dbus-debug): Delete parameters.
(jami-service-running?): New procedure.
(send-dbus/configuration-manager): Rename to...
(call-configuration-manager-method): ... this.  Turn METHOD into a positional
argument.  Turn ARGUMENTS into an optional argument.  Invoke
`call-dbus-method' instead of `send-dbus', adjusting callers accordingly.
(get-account-ids, id->account-details, id->account-details)
(id->volatile-account-details, username->id, add-account remove-account)
(username->contacts, remove-contact, add-contact, set-account-details)
(set-all-moderators, username->all-moderators?, username->moderators)
(set-moderator): Adjust accordingly.
(with-retries, send-dbus, dbus-available-services)
(dbus-service-available?): Move to ...
* gnu/build/dbus-service.scm: ... this new module.
(send-dbus): Rewrite to use the Guile AC/D-Bus library.
(%dbus-query-timeout, sleep*): New variables.
(%current-dbus-connection): New parameter.
(initialize-dbus-connection!, argument->signature-type)
(call-dbus-method): New procedures.
(dbus-available-services): Adjust accordingly.
* gnu/local.mk (GNU_SYSTEM_MODULES): Register new module.
* gnu/packages/glib.scm (dbus-for-jami): New variable.
* gnu/services/telephony.scm: (jami-configuration)[dbus]: Default to
dbus-for-jami.
(jami-dbus-session-activation): Write a D-Bus daemon configuration file at
'/var/run/jami/session-local.conf'.
(jami-shepherd-services): Add the closure of guile-ac-d-bus and guile-fibers
as extensions.  Adjust imported modules.  Remove no longer used parameters.
<jami-dbus-session>: Use a PID file, avoiding the need for the manual
synchronization.
<jami>:  Set DBUS_SESSION_BUS_ADDRESS environment variable.  Poll using
'jami-service-available?' instead of 'dbus-service-available?'.
* gnu/tests/telephony.scm (run-jami-test): Add needed Guile extensions.  Set
DBUS_SESSION_BUS_ADDRESS environment variable.  Adjust all tests to use
'jami-service-available?' to determine if the service is started rather than
the now problematic Shepherd's 'start-service'.
2022-06-10 23:52:33 -04:00
..
data
audio.scm
base.scm tests: install: Adjust the timeouts on two failing tests. 2022-03-19 11:08:30 -04:00
ci.scm
cups.scm
databases.scm tests: Add system test for TimescaleDB. 2022-01-29 16:09:03 +01:00
desktop.scm
dict.scm
docker.scm
file-sharing.scm
ganeti.scm
guix.scm services: guix: Add nar-herder-service-type. 2022-01-31 18:28:16 +00:00
install.scm tests: Add "encrypted-home-os" installation test. 2022-04-08 18:14:35 +02:00
ldap.scm
linux-modules.scm
mail.scm
messaging.scm services: bitlbee: Use 'make-inetd-constructor'. 2022-05-01 21:30:35 +02:00
monitoring.scm
networking.scm
nfs.scm
package-management.scm tests: nix: Remove tab characters. 2022-02-21 13:38:47 +01:00
reconfigure.scm
rsync.scm
security-token.scm
singularity.scm
ssh.scm services: openssh: Listen on both IPv4 and IPv6. 2022-05-22 21:56:40 +02:00
telephony.scm services: jami: Modernize to adjust to Shepherd 0.9+ changes. 2022-06-10 23:52:33 -04:00
version-control.scm tests: Avoid starting services to check whether they're running. 2022-04-29 18:07:17 +02:00
virtualization.scm tests: childhurd: Make sure "guix build -d" works. 2022-06-05 23:35:30 +02:00
web.scm tests: Fix tailon test. 2022-05-01 12:53:53 +02:00