From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UGMKAfNf52J8MgAAbAwnHQ (envelope-from ) for ; Mon, 01 Aug 2022 07:09:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id sBEVAfNf52K0wwAA9RJhRA (envelope-from ) for ; Mon, 01 Aug 2022 07:09:07 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 946D93ED42 for ; Mon, 1 Aug 2022 07:09:06 +0200 (CEST) Received: from localhost ([::1]:39346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oINft-0002Qj-QE for larch@yhetil.org; Mon, 01 Aug 2022 01:09:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oINfq-0002Qb-Q2 for bug-guix@gnu.org; Mon, 01 Aug 2022 01:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oINfq-0005t9-HK for bug-guix@gnu.org; Mon, 01 Aug 2022 01:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oINfq-0000mc-D5 for bug-guix@gnu.org; Mon, 01 Aug 2022 01:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#56799: (gnu services configuration) usage of *unspecified* is problematic Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 01 Aug 2022 05:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56799 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 56799@debbugs.gnu.org Received: via spool by 56799-submit@debbugs.gnu.org id=B56799.16593305252985 (code B ref 56799); Mon, 01 Aug 2022 05:09:02 +0000 Received: (at 56799) by debbugs.gnu.org; 1 Aug 2022 05:08:45 +0000 Received: from localhost ([127.0.0.1]:39031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oINfY-0000m4-Q0 for submit@debbugs.gnu.org; Mon, 01 Aug 2022 01:08:45 -0400 Received: from mail-qt1-f176.google.com ([209.85.160.176]:33723) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oINfT-0000lo-FX for 56799@debbugs.gnu.org; Mon, 01 Aug 2022 01:08:43 -0400 Received: by mail-qt1-f176.google.com with SMTP id u12so7317124qtk.0 for <56799@debbugs.gnu.org>; Sun, 31 Jul 2022 22:08:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=4aQ+Z5zmAG1C1yz4EzVJ6tlsNd14d3BCsdn/lnBGuwU=; b=A5veN6VCRYaa6sovJlF2jD9ZKo74xUfTtJ0HqkggAHh29gPh0X6rQp27mk4byWfOTO BT6+zRxLPh9yL9JlYr+LkakGmpv1ex08dnjwQvd86Ur9ZAvrwx8G7AYlDs0lAl828Eo6 WzFW6baG5hDLVgZo0Fs6OGr1u0pqkgO3U7AnMB2VqWu19xXzdiPwsFJ+HmvMgZDXAfsF qIi/S4z+KpXWtY8bbATOoU03L9EOdJv8mtQENvQKG+4N66VfBj09hrTEGC5GOKepdEk5 pim5RMJJGqNdT6rAJbu7buBK8GeeXIEOM3JNuqqBIuk8FAzJLEvIzMIfBO12oZchTigy FU5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=4aQ+Z5zmAG1C1yz4EzVJ6tlsNd14d3BCsdn/lnBGuwU=; b=friUQtEft5vXIPvXK4MKwKCjpZV3RuHv8COkfmnhiErb2f+kXeKaCeDA8+nF5TeZhW qt7cPGs4A2O6oGnoMqYxprAc26Rh4cp76aW8DCaQp+uDlSsqkhOcR1M21IrY3XaVDYuM T02O5flYORBhf7hBKXnPoIyPTriNJopnSg9fnDOnTG05mrsqSFcIksudW3dv57/iW3Es HAqDARXs7BOkS5TYwtzCfHNu0LfOfxrjqxbJ7OTlfvL0yKO1QDEhE0nB3HXW+yQFY5RV WPekrM1pGpSB3dzU9FdUY+Y8Lf2omgwT3Y16Jqm50/4scS7TOy7LaE/+xhgok48U5crP sg7w== X-Gm-Message-State: AJIora9pXhy/Irgv3gy7ZUZLN5ZNyOZARCHo5C+GqatELFC8PbNyBLhe 7UXILHxWWkyW/4yWUcpAfpbIhNFfM1g= X-Google-Smtp-Source: AGRyM1vhoovfRcdIkVYyDHDVkjHZZJtKJthGO7atH4R7qqITxPPi+JPZx4BUQueiSejX7GKO2gG7lg== X-Received: by 2002:ac8:5949:0:b0:31e:f363:989 with SMTP id 9-20020ac85949000000b0031ef3630989mr12843121qtz.483.1659330513050; Sun, 31 Jul 2022 22:08:33 -0700 (PDT) Received: from hurd (dsl-158-240.b2b2c.ca. [66.158.158.240]) by smtp.gmail.com with ESMTPSA id x21-20020a05620a0b5500b006a793bde241sm7473635qkg.63.2022.07.31.22.08.32 for <56799@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Jul 2022 22:08:32 -0700 (PDT) From: Maxim Cournoyer References: <877d3y8hjj.fsf@gmail.com> <20220728044144.15693-1-maxim.cournoyer@gmail.com> Date: Mon, 01 Aug 2022 01:08:31 -0400 In-Reply-To: <20220728044144.15693-1-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Thu, 28 Jul 2022 00:41:44 -0400") Message-ID: <87mtco4kkw.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1659330546; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=4aQ+Z5zmAG1C1yz4EzVJ6tlsNd14d3BCsdn/lnBGuwU=; b=qWc6dnDpYkUXMnlPBGvV/lvmu0lW5RM8C+k5B8AbwXvQQSJyBNIhCVtISD8tj/EBqn6pUc 3aocAN68tIeH7D2wHFEJtk0CS/+j1y0/8jdalGa8/NIwp6Xdp0NX5TAUB1xDuH5zSA3Yc7 xq6UkPkoGCOab1TIGDrphIm+AYxfxFpRh0FJ+8Y4BCKaY4FcxLG8kdokqvMwoiTbt/+ZcB kbwdJTGvDJ64nZ3uNbj2f2MF5OPuGiTWfSH3hYjG3SutfppTS7GmMxr9UIelDDQE+7YX+S ZGwAgRjlSLRANGXF3OT/uhEj4rF7v1IJvxK7LrESbClloGeEvoUjxKBnckyAdg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659330546; a=rsa-sha256; cv=none; b=T/XlVYiAHsMXnzAvFlw0fUtZfUZCgVXjD4xrDAmLyHnor+7uzd7A7niVWre3YU8lfiN+X8 veyJr6oy6J3EVsqxU+bw7lGgm9no0jgdY4I/OPBr9HN8UMHhF1VRkpFX7LSkreRDK/WY1t 98ZO+dMJbw2n5oKFpIlSI2dIRtSZvybNkLmEJX+YpEtTjg5BvcHcWFt+pVDwNLXHiy67p+ 9gud0VOGkRnH8DdtWvrhaBTxZy/30JW+Gxzcv8fPe7Law7xc66YRFz5Lwn460Vz8ar8YFC i1I7bVQ1Psla084avrFqRtbW3z+YnrR+LWYF3aWcv+kvkxJpK9iVHNYMRsr2hw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=A5veN6VC; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 4.18 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=A5veN6VC; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 946D93ED42 X-Spam-Score: 4.18 X-Migadu-Scanner: scn0.migadu.com X-TUID: VdZhEC5DA6bd --=-=-= Content-Type: text/plain Hi, Maxim Cournoyer writes: > Fixes . > > * guix/gexp.scm (gexp->sexp)[*unspecified*]: Quote value when encountering it. Sadly, this doesn't fix the jami service when using a partially defined jami-account as part of the jami-configuration; the error is: --8<---------------cut here---------------start------------->8--- In procedure for-each: Wrong type argument: *unspecified* --8<---------------cut here---------------end--------------->8--- Here's what the generated shepherd-jami.scm file look like: --8<---------------cut here---------------start------------->8--- #:start (lambda args (define (delete-file-recursively/safe file) (let ((parent-directory (dirname file))) (if (eq? (quote symlink) (stat:type (stat parent-directory))) (error "abnormality detected; unexpected symlink found at" parent-directory) (delete-file-recursively file)))) (when #t (catch #t (lambda () (for-each (cut delete-file-recursively/safe <>) (quote ("/var/lib/jami/.cache/jami" "/var/lib/jami/.config/jami" "/var/lib/jami/.local/share/jami" "/var/lib/jami/accounts")))) (lambda args #t)) (let* ((accounts-dir "/var/lib/jami/accounts/") (pwd (getpwnam "jami")) (user (passwd:uid pwd)) (group (passwd:gid pwd))) (mkdir-p accounts-dir) (chown accounts-dir user group) (for-each (lambda (f) (let ((dest (string-append accounts-dir (basename f)))) (copy-file f dest) (chown dest user group))) (quote ("/gnu/store/14flr53fr0hs7mzfwn93kmyzrnb3fhjz-dummy-jami-account.gz"))))) (define daemon-pid ((make-forkexec-constructor/container (quote ("/gnu/store/z7qlqkb0qwnpcs5kbbf2z2js0k1xgkbv-libjami-20220726.1515.da8d1da/libexec/jamid" "--persistent" "--debug")) #:mappings (list (file-system-mapping (source "/dev/log") (target source)) (file-system-mapping (source "/var/lib/jami") (target source) (writable? #t)) (file-system-mapping (source "/var/run/jami") (target source) (writable? #t)) (file-system-mapping (source "/gnu/store/mjmpb4k2g21p7hyx9zq57p9xymbl16ac-nss-certs-3.71/etc/ssl/certs") (target "/etc/ssl/certs"))) #:user "jami" #:group "jami" #:environment-variables (list (string-append "DBUS_SESSION_BUS_ADDRESS=" "unix:path=/var/run/jami/bus") "SSL_CERT_DIR=/etc/ssl/certs")))) (setenv "DBUS_SESSION_BUS_ADDRESS" "unix:path=/var/run/jami/bus") (with-retries 20 1 (jami-service-available?)) (when #t (let* ((jami-account-archives (map (cut string-append "/var/lib/jami/accounts/" <>) (scandir "/var/lib/jami/accounts/" (lambda (f) (not (member f (quote ("." "..")))))))) (usernames (map-in-order (cut add-account <>) jami-account-archives))) (define (archive-name->username archive) (list-ref usernames (list-index (lambda (f) (string-suffix? (basename archive) f)) jami-account-archives))) (for-each (lambda (archive allowed-contacts moderators account-details) (let ((username (archive-name->username archive))) (when (not (unspecified? allowed-contacts)) (set-account-details (quote (("DHT.PublicInCalls" . "false"))) username) (for-each (cut remove-contact <> username) (username->contacts username)) (for-each (cut add-contact <> username) allowed-contacts)) (when (not (unspecified? moderators)) (set-all-moderators #f username) (for-each (cut set-moderator <> #f username) (username->moderators username)) (for-each (cut set-moderator <> #t username) moderators)) (set-account-details account-details username))) (quote ("/gnu/store/14flr53fr0hs7mzfwn93kmyzrnb3fhjz-dummy-jami-account.gz")) (quote (*unspecified*)) (quote (*unspecified*)) (quote ((("Account.rendezVous" . "true") ("Account.peerDiscovery" . "false") ("Account.hostname" . "bootstrap.me;fallback.another.host") ("RingNS.uri" . "https://my.name.server"))))))) daemon-pid) --8<---------------cut here---------------end--------------->8--- Can you spot where the problem is? Attached is the extended test I've used to test. You generate a VM with: --8<---------------cut here---------------start------------->8--- ./pre-inst-env guix system vm --no-graphics \ -e '(@@ (gnu tests telephony) %jami-os-provisioning-partial) --8<---------------cut here---------------end--------------->8--- To test with a more hands-on approach. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-telephony-Add-a-Jami-test-for-a-partially-define.patch >From 4ccaa9109c67174d428512b16a5c1ee77e66f491 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 1 Aug 2022 00:49:07 -0400 Subject: [PATCH] gnu: telephony: Add a Jami test for a partially defined jami-account. * 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. --- gnu/tests/telephony.scm | 49 +++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/gnu/tests/telephony.scm b/gnu/tests/telephony.scm index 16ee313f69..b505f26e8d 100644 --- a/gnu/tests/telephony.scm +++ b/gnu/tests/telephony.scm @@ -31,7 +31,8 @@ (define-module (gnu tests telephony) #:use-module (guix gexp) #:use-module (guix modules) #:export (%test-jami - %test-jami-provisioning)) + %test-jami-provisioning + %test-jami-provisioning-partial)) ;;; ;;; Jami daemon. @@ -67,7 +68,18 @@ (define %dummy-jami-account (jami-account "fallback.another.host")) (name-server-uri "https://my.name.server"))) -(define* (make-jami-os #:key provisioning?) +;;; Like %dummy-jami-account, but with allowed-contacts and moderators left +;;; unset (thus taking the value *unspecified*). +(define %dummy-jami-account-partial + (jami-account + (archive %dummy-jami-account-archive) + (rendezvous-point? #t) + (peer-discovery? #f) + (bootstrap-hostnames '("bootstrap.me" + "fallback.another.host")) + (name-server-uri "https://my.name.server"))) + +(define* (make-jami-os #:key provisioning? partial?) (operating-system (host-name "jami") (timezone "America/Montreal") @@ -87,7 +99,10 @@ (define* (make-jami-os #:key provisioning?) (if provisioning? (jami-configuration (debug? #t) - (accounts (list %dummy-jami-account))) + (accounts + (list (if partial? + %dummy-jami-account-partial + %dummy-jami-account)))) (jami-configuration (debug? #t)))) (service dbus-root-service-type) @@ -109,12 +124,18 @@ (define %jami-os (define %jami-os-provisioning (make-jami-os #:provisioning? #t)) -(define* (run-jami-test #:key provisioning?) - "Run tests in %JAMI-OS. When PROVISIONING? is true, test the -accounts provisioning feature of the service." +(define %jami-os-provisioning-partial + (make-jami-os #:provisioning? #t #:partial? #t)) + +(define* (run-jami-test #:key provisioning? partial?) + "Run tests in %JAMI-OS. When PROVISIONING? is true, test the accounts +provisioning feature of the service. When PARTIAL? is #t, some fields of the +jami account used as part of the jami configuration are left *unspecified*." (define os (marionette-operating-system (if provisioning? - %jami-os-provisioning + (if partial? + %jami-os-provisioning-partial + %jami-os-provisioning) %jami-os) #:imported-modules '((gnu services herd) (guix combinators)))) @@ -202,7 +223,7 @@ (define marionette "Account.username"))))))) marionette)) - (unless #$provisioning? (test-skip 1)) + (unless #$(and provisioning? (not partial?)) (test-skip 1)) (test-assert "jami accounts provisioning, allowed-contacts" (marionette-eval '(begin @@ -224,7 +245,7 @@ (define marionette (assert (lset= string-ci=? contacts '#$%allowed-contacts))))) marionette)) - (unless #$provisioning? (test-skip 1)) + (unless #$(and provisioning? (not partial?)) (test-skip 1)) (test-assert "jami accounts provisioning, moderators" (marionette-eval '(begin @@ -341,3 +362,13 @@ (define %test-jami-provisioning (name "jami-provisioning") (description "Provisioning test for the jami service.") (value (run-jami-test #:provisioning? #t)))) + +;;; Thi test verifies that values can be left unspecified +;;; without causing any issue (see: https://issues.guix.gnu.org/56799). +(define %test-jami-provisioning-partial + (system-test + (name "jami-provisioning-partial") + (description "Provisioning test for the jami service, when some of the +'maybe' fields aren't provided (such that their value end up being +*unspecified*.") + (value (run-jami-test #:provisioning? #t #:partial? #t)))) -- 2.36.1 --=-=-= Content-Type: text/plain Thanks, Maxim --=-=-=--