* gnu/tests/telephony.scm (%jami-account-content-sexp): New variable. Compute
its value with `read` instead of using `include`.
* gnu/tests/data/jami-dummy-account.dat (%jami-account-content-sexp): Remove
variable. Make the file contain just the S-expression.
Change-Id: I8d37aaf7b739f5f39715bfb8a9b8c9536385fd09
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
* gnu/tests/telephony.scm (run-jami-test): Pass #:timeout to
‘wait-for-service’. Double number passed to ‘with-retries’.
Change-Id: Ib3c81a770c2d52b2eb40e4f28abc8e33f5c71fc8
This fixes a regression introduced with commit a09c7da ("tests: Fork and exec
a new Guile for the marionette REPL.") and only partially fixed with the
follow-up commit f518882 (" tests: Add missing module imports for
marionette-evaluated code.").
* gnu/tests/telephony.scm (run-jami-test): Remove extraneous module imports.
Move the setting of the DBUS_SESSION_BUS_ADDRESS environment variable inside
the first marionette-eval'd setup test.
["service can be stopped"]: Add missing (gnu build dbus-service) module.
This missing imports became apparent with commit
a09c7da8f8, which runs the marionette
service in a fresh Guile process with fewer imports.
* gnu/tests/databases.scm (run-postgresql-test, run-timescaledb-test)
(run-mysql-test): Add missing module imports for code passed to
'marionette-eval'.
* gnu/tests/docker.scm (run-docker-test, run-docker-system-test): Likewise.
* gnu/tests/mail.scm (run-dovecot-test, run-getmail-test): Likewise.
* gnu/tests/monitoring.scm (run-zabbix-server-test): Likewise.
* gnu/tests/pam.scm (run-test-pam-limits): Likewise.
* gnu/tests/reconfigure.scm (run-switch-to-system-test)
(run-install-bootloader-test): Likewise.
* gnu/tests/security-token.scm (run-pcscd-test): Likewise.
* gnu/tests/install.scm (gui-test-program): Likewise.
* gnu/tests/telephony.scm (run-jami-test): Add modules to
the #:imported-modules argument of 'marionette-operating-system'.
[test]: Remove them from 'with-imported-modules'; remove
'with-extensions'. Add "d-bus tooling loaded" test to set up %load-path
and %load-compiled-path so the marionette process can find
guile-ac-d-bus and guile-packrat.
* gnu/tests/telephony.scm (make-jami-os): Add libjami:debug, gdb, guile,
guile-ac-d-bus, guile-readline, guile-fibers, screen and strace.
(run-jami-test)<jami service actions, ban/unban contacts>: Add (ice-9 match),
for lambda-match (worked without it but needed when manually testing).
* gnu/tests/telephony.scm (%dummy-jami-account-partial): New variable.
(make-jami-os): Add a PARTIAL? argument and use it to select the jami-account
variant to use.
(%jami-os-provisioning-partial): New variable.
(run-jami-test): Add a PARTIAL? argument, and use it to select operating
system variant. Skip allowed-contacts and moderators test when PARTIAL? is
true.
(%test-jami-provisioning-partial): New test.
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'.
* gnu/services/telephony.scm (jami-configuration)[jamid]: Rename libring to
libjami.
* gnu/services/telephony.scm
(jami-configuration->command-line-arguments): Adjust daemon file name.
* gnu/services/telephony.scm (jami-service-type): Adjust doc.
* gnu/tests/telephony.scm (run-jami-test): Check for 'jamid' process, not
'dring'.
* doc/guix.texi (Telephony Services): Adjust doc for the jami-qt to jami and
libring to libjami packages renaming.
This reverts commit 4673f81793, which reverted
commit 69dcc24c9f with the fix detailed below.
Thanks to Christopher Baines for reporting the failure and proposing a fix.
* guix/self.scm (compiled-guix) [*system-test-modules*]: Add the test data
files via the 'extra-files' argument.
* gnu/local.mk (dist_patch_DATA): Move the tests/data/jami-dummy-account.dat
file to...
* gnu/local.mk (MODULES_NOT_COMPILED): ... here.
* gnu/services/telephony.scm (string-or-computed-file?)
(string-list?, account-fingerprint-list?): New procedures.
(maybe-string-list, maybe-account-fingerprint-list)
(maybe-boolean, maybe-string, jami-account-list): New configuration field
types.
(serialize-string-list, serialize-boolean, serialize-string)
(jami-account, jami-account->alist, jami-configuration)
(jami-account-list?, jami-account-list-maybe): New procedures.
(%jami-accounts): New variable.
(jami-configuration->command-line-arguments): New procedure.
(jami-dbus-session-activation, jami-shepherd-services): New procedures.
(jami-service-type): New variable.
* gnu/build/jami-service.scm: New file.
* gnu/tests/data/jami-dummy-account.dat: Likewise.
* gnu/tests/telephony.scm: Likewise.
* gnu/local.mk (GNU_SYSTEM_MODULES): Register them.
* Makefile.am (SCM_TESTS): Register the test file.
(dist_patch_DATA): Register the new data file.
* doc/guix.texi (Telephony Services): Document it.