From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hugh Daschbach Newsgroups: gmane.emacs.bugs Subject: bug#44298: 28.0.50; D-Bus GetManagedObjects doesn't enumerate all paths. Date: Thu, 29 Oct 2020 20:03:51 -0700 Message-ID: <87o8kke7oo.fsf@ccss.com> References: <87wnz9eo66.fsf@ccss.com> <87d0113twf.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28197"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.5; emacs 27.1 Cc: Hugh Daschbach , 44298@debbugs.gnu.org, 44298+DONE@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 30 04:05:23 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kYKjC-0007DQ-UX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Oct 2020 04:05:23 +0100 Original-Received: from localhost ([::1]:59158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYKjB-0008Co-TJ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Oct 2020 23:05:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYKis-0008Bo-8Y for bug-gnu-emacs@gnu.org; Thu, 29 Oct 2020 23:05:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44159) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYKir-0000YZ-TY for bug-gnu-emacs@gnu.org; Thu, 29 Oct 2020 23:05:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kYKir-0008UI-MX for bug-gnu-emacs@gnu.org; Thu, 29 Oct 2020 23:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Hugh Daschbach Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Oct 2020 03:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44298 X-GNU-PR-Package: emacs Original-Received: via spool by 44298-submit@debbugs.gnu.org id=B44298.160402704332538 (code B ref 44298); Fri, 30 Oct 2020 03:05:01 +0000 Original-Received: (at 44298) by debbugs.gnu.org; 30 Oct 2020 03:04:03 +0000 Original-Received: from localhost ([127.0.0.1]:55705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYKhu-0008SV-UH for submit@debbugs.gnu.org; Thu, 29 Oct 2020 23:04:03 -0400 Original-Received: from mail1.ccss.com ([159.203.255.73]:60216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYKhs-0008Rw-Td; Thu, 29 Oct 2020 23:04:01 -0400 Original-Received: by mail1.ccss.com (Postfix, from userid 114) id 3DC48BF8A7; Thu, 29 Oct 2020 20:03:55 -0700 (PDT) Original-Received: from ccss.com (unknown [192.168.76.11]) by mail1.ccss.com (Postfix) with ESMTP id 66AC2BF473; Thu, 29 Oct 2020 20:03:54 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by ccss.com (Postfix) with ESMTP id 34BB11761252; Thu, 29 Oct 2020 20:03:54 -0700 (PDT) Original-Received: from ccss.com ([127.0.0.1]) by localhost (ccss.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rRLGZ8KrVoo3; Thu, 29 Oct 2020 20:03:52 -0700 (PDT) Original-Received: from klaatu (klaatu.lan [192.168.42.3]) (Authenticated sender: hugh) by ccss.com (Postfix) with ESMTPSA id 213D51760443; Thu, 29 Oct 2020 20:03:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ccss.com; s=mail; t=1604027032; bh=BqH3QElYyFfBVJ/oWAiwT+DaLSoQWcaU3CsM775RAZw=; h=References:From:To:Cc:Subject:In-reply-to:Date:From; b=axhfou9P3p6mIuyzobrPmO/CgdmVOadWN/63+YYV7CIym+tEtVNaL8N8E1UWPsqdJ 7OCgdwEKI5KmpZzNxz0HT5ZcNxvvgvNepotqCCFAIMKuqefsNu4lFwkRSoZtqRVHCF jXe9zEJQPOozofZGTwebFYFmpUYEmCMHTSt+wFfWYW5Vi8TN/TWkajetXzHeskzoxl MYB3DQ5F70Gsdt722L4hP2E45ou6RTkTDEvXYV8DxpT1uBjsHPM0ouA3/eqayOppAM 7BMHFR8NDjHdu2Nmt8D2WPjd9dODSdlF4YtGXO5h2tvZSshakok53PyDAYAeXHBc+e aUOaKYHNmxSwg== In-reply-to: <87d0113twf.fsf@gmx.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:192030 Archived-At: --=-=-= Content-Type: text/plain Michael Albinus writes: >> If a D-Bus interface is registered on more than one path, processing an >> incoming GetManagedObjects method call only reports a single path. > > Thanks for the report! I've pushed a fix to master, which should solve it. Michael, many thanks. That fixes the issue. I've extended the test to cover multiple interfaces and multiple paths. I've attached a patch if you're interested. I've tried to follow your advice on closing the bug. If I missed the mark, please feel free to close it yourself. Thanks again, Hugh --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Extend-GetManagedObjects-test.patch Content-Description: Extend GetManagedObjects test. >From 1b2e74b26ebd925539a07b909cfd600a66c4ab82 Mon Sep 17 00:00:00 2001 From: Hugh Daschbach Date: Thu, 29 Oct 2020 19:46:26 -0700 Subject: [PATCH] Extend GetManagedObjects test. * test/lisp/net/dbus-tests.el (dbus-test09-get-managed-objects): Expand test. --- test/lisp/net/dbus-tests.el | 128 +++++++++++++++++++++--------------- 1 file changed, 76 insertions(+), 52 deletions(-) diff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el index d630f80706e..6363ca2aebe 100644 --- a/test/lisp/net/dbus-tests.el +++ b/test/lisp/net/dbus-tests.el @@ -1890,78 +1890,102 @@ dbus-test08-register-monitor (ert-deftest dbus-test09-get-managed-objects () "Check `dbus-get-all-managed-objects'." - :tags '(:expensive-test) (skip-unless dbus--test-enabled-session-bus) (dbus-ignore-errors (dbus-unregister-service :session dbus--test-service)) (dbus-register-service :session dbus--test-service) (unwind-protect - (let ((path1 (concat dbus--test-path "/path1")) - (path2 (concat dbus--test-path "/path2")) - (path3 (concat dbus--test-path "/path3"))) + (let ((interfaces + `((,(concat dbus--test-interface ".I0") + ((,(concat dbus--test-path "/obj1") + (("I0Property1" . "Zero one one") + ("I0Property2" . "Zero one two") + ("I0Property3" . "Zero one three"))) + (,(concat dbus--test-path "/obj0/obj2") + (("I0Property1" . "Zero two one") + ("I0Property2" . "Zero two two") + ("I0Property3" . "Zero two three"))) + (,(concat dbus--test-path "/obj0/obj3") + (("I0Property1" . "Zero three one") + ("I0Property2" . "Zero three two") + ("I0Property3" . "Zero three three"))))) + (,(concat dbus--test-interface ".I1") + ((,(concat dbus--test-path "/obj0/obj2") + (("I1Property1" . "One one one") + ("I1Property2" . "One one two"))) + (,(concat dbus--test-path "/obj0/obj3") + (("I1Property1" . "One two one") + ("I1Property2" . "One two two")))))))) (should-not (dbus-get-all-managed-objects :session dbus--test-service dbus--test-path)) - (should - (equal - (dbus-register-property - :session dbus--test-service path1 dbus--test-interface - "Property1" :readwrite "Simple string one.") - `((:property :session ,dbus--test-interface "Property1") - (,dbus--test-service ,path1)))) - - (should - (equal - (dbus-register-property - :session dbus--test-service path2 dbus--test-interface - "Property1" :readwrite "Simple string two.") - `((:property :session ,dbus--test-interface "Property1") - (,dbus--test-service ,path2)))) - - (should - (equal - (dbus-register-property - :session dbus--test-service path3 dbus--test-interface - "Property1" :readwrite "Simple string three.") - `((:property :session ,dbus--test-interface "Property1") - (,dbus--test-service ,path3)))) - - (should - (equal - (dbus-get-property - :session dbus--test-service path1 dbus--test-interface - "Property1") - "Simple string one.")) - - (should - (equal - (dbus-get-property - :session dbus--test-service path2 dbus--test-interface - "Property1") - "Simple string two.")) - - (should - (equal - (dbus-get-property - :session dbus--test-service path3 dbus--test-interface - "Property1") - "Simple string three.")) + (dolist (interface interfaces) + (pcase-let ((`(,iname ,objs) interface)) + (dolist (obj objs) + (pcase-let ((`(,path ,props) obj)) + (dolist (prop props) + (should + (equal + (dbus-register-property + :session dbus--test-service path iname + (car prop) :readwrite (cdr prop)) + `((:property :session ,iname ,(car prop)) + (,dbus--test-service ,path))))))))) (let ((result (dbus-get-all-managed-objects :session dbus--test-service dbus--test-path))) (should (= 3 (length result))) - (should - (assoc-string path1 result)) + (dolist (interface interfaces) + (pcase-let ((`(,iname ,objs) interface)) + (dolist (obj objs) + (pcase-let ((`(,path ,props) obj)) + (let* ((object (cadr (assoc-string path result))) + (iface (cadr (assoc-string iname object)))) + (should object) + (should iface) + (dolist (prop props) + (should (equal (cdr (assoc-string (car prop) iface)) + (cdr prop)))))))))) + (let ((result (dbus-get-all-managed-objects + :session dbus--test-service (concat dbus--test-path "/obj0")))) (should - (assoc-string path2 result)) + (= 2 (length result))) + + (dolist (interface interfaces) + (pcase-let ((`(,iname ,objs) interface)) + (dolist (obj objs) + (pcase-let ((`(,path ,props) obj)) + (when (string-prefix-p (concat dbus--test-path "/obj0/") path) + (let* ((object (cadr (assoc-string path result))) + (iface (cadr (assoc-string iname object)))) + (should object) + (should iface) + (dolist (prop props) + (should (equal (cdr (assoc-string (car prop) iface)) + (cdr prop))))))))))) + (let ((result (dbus-get-all-managed-objects + :session dbus--test-service (concat dbus--test-path "/obj0/obj2")))) (should - (assoc-string path3 result)))) + (= 1 (length result))) + + (dolist (interface interfaces) + (pcase-let ((`(,iname ,objs) interface)) + (dolist (obj objs) + (pcase-let ((`(,path ,props) obj)) + (when (string-prefix-p (concat dbus--test-path "/obj0/obj2") path) + (let* ((object (cadr (assoc-string path result))) + (iface (cadr (assoc-string iname object)))) + (should object) + (should iface) + (dolist (prop props) + (should (equal (cdr (assoc-string (car prop) iface)) + (cdr prop)))))))))))) ;; Cleanup. (dbus-unregister-service :session dbus--test-service))) -- 2.28.0 --=-=-=--