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: Wed, 28 Oct 2020 19:55:29 -0700 Message-ID: <87wnz9eo66.fsf@ccss.com> 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="20425"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.5; emacs 27.1 To: 44298@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 29 03:56:24 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 1kXy6x-0005Bg-Rk for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Oct 2020 03:56:24 +0100 Original-Received: from localhost ([::1]:35850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXy6w-0003Ly-OA for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 28 Oct 2020 22:56:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXy6c-0003Lo-Sq for bug-gnu-emacs@gnu.org; Wed, 28 Oct 2020 22:56:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39846) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXy6c-0006aa-JT for bug-gnu-emacs@gnu.org; Wed, 28 Oct 2020 22:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kXy6c-0005Ek-Gh for bug-gnu-emacs@gnu.org; Wed, 28 Oct 2020 22:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Hugh Daschbach Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Oct 2020 02:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44298 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160394014320098 (code B ref -1); Thu, 29 Oct 2020 02:56:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Oct 2020 02:55:43 +0000 Original-Received: from localhost ([127.0.0.1]:51392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXy6I-0005E6-Sn for submit@debbugs.gnu.org; Wed, 28 Oct 2020 22:55:43 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:52852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXy6H-0005Dz-J2 for submit@debbugs.gnu.org; Wed, 28 Oct 2020 22:55:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXy6H-0003LU-9j for bug-gnu-emacs@gnu.org; Wed, 28 Oct 2020 22:55:41 -0400 Original-Received: from mail1.ccss.com ([159.203.255.73]:52402) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXy6F-0006TN-9Q for bug-gnu-emacs@gnu.org; Wed, 28 Oct 2020 22:55:41 -0400 Original-Received: by mail1.ccss.com (Postfix, from userid 114) id 98705BF88E; Wed, 28 Oct 2020 19:55:37 -0700 (PDT) Original-Received: from ccss.com (unknown [192.168.76.11]) by mail1.ccss.com (Postfix) with ESMTP id D1D85BF651 for ; Wed, 28 Oct 2020 19:55:36 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by ccss.com (Postfix) with ESMTP id AD0D31761293 for ; Wed, 28 Oct 2020 19:55:36 -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 HmeOjfmnnzhh for ; Wed, 28 Oct 2020 19:55:30 -0700 (PDT) Original-Received: from klaatu (klaatu.lan [192.168.42.3]) (Authenticated sender: hugh) by ccss.com (Postfix) with ESMTPSA id 5F1D81760635 for ; Wed, 28 Oct 2020 19:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ccss.com; s=mail; t=1603940130; bh=0y/ZdCFTElSPfMyRAzPnk76vn0cHIr/UoRGkAdkaMjQ=; h=From:To:Subject:Date:From; b=SExhkWCzpsH7/PjwHfUWiDQrMSCH7jrdyUmitRW09cImvLojXWACdeHzwHjWjRfg0 hlE7bFrKGGskM9gzUHYvdgBdJr1k8Im27f48Z8cduTUvad++QKwCQYYwjoACt+RF68 tdNRm0cld/KRezZ766HKXSFxTxv2d+fMxM/K5iM5s8TUrR2TstzlK/DEP7nxcIqY96 ORIxNwK8ZO75SyI2sMPQznv/bSWFO7BNcEYQLkUOiDjlPDPDMd21hNDXWsAGyXFtXI M7gCO9PQttLb0u/PNlF1IVVTmFhrZim7uIzkPY1DinBe/SNv0DhFSY9/l7sBPT++jO PupsCQ4oA485w== Received-SPF: permerror client-ip=159.203.255.73; envelope-from=hugh@ccss.com; helo=mail1.ccss.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/28 22:55:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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:191931 Archived-At: --=-=-= Content-Type: text/plain If a D-Bus interface is registered on more than one path, processing an incoming GetManagedObjects method call only reports a single path. The attached patch adds a test case to demonstrate this issue. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-tests-for-D-Bus-GetManagedObjects-inquiry.patch Content-Description: New test for GetManagedObjects. >From 43a446ce12485d669daed978796dc032113d73e5 Mon Sep 17 00:00:00 2001 From: Hugh Daschbach Date: Wed, 28 Oct 2020 19:36:19 -0700 Subject: [PATCH] Add tests for D-Bus GetManagedObjects inquiry. * test/lisp/net/dbus-tests.el (dbus-test09-get-managed-objects): New test. --- test/lisp/net/dbus-tests.el | 82 +++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el index 2186d454aee..3bb2264defb 100644 --- a/test/lisp/net/dbus-tests.el +++ b/test/lisp/net/dbus-tests.el @@ -1889,6 +1889,88 @@ dbus-test08-register-monitor ;; Cleanup. (dbus-unregister-service :session dbus--test-service))) +(ert-deftest dbus-test09-get-managed-objects () + "Check `dbus-get-all-managed-objects'." + (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"))) + + (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-get-property + :session dbus--test-service path1 dbus--test-interface + "Property1") + "Simple string one.")) + + (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.")) + + (let ((result (dbus-get-all-managed-objects :session dbus--test-service dbus--test-path))) + (should + (= 3 (length result))) + + (should + (assoc-string path1 result)) + + (should + (assoc-string path2 result)) + + (should + (assoc-string path3 result)))) + + ;; Cleanup. + (dbus-unregister-service :session dbus--test-service))) + (defun dbus-test-all (&optional interactive) "Run all tests for \\[dbus]." (interactive "p") base-commit: bb3d13ac3586d3577605d3d8809d31c62a267c99 -- 2.28.0 --=-=-= Content-Type: text/plain Cheers, Hugh In GNU Emacs 28.0.50 (build 20, x86_64-pc-linux-gnu, X toolkit, cairo version 1.17.3, Xaw3d scroll bars) of 2020-10-11 built on klaatu Repository revision: 0f79544368c0dc343edcd97c3c7992aeab415b68 Repository branch: submission Windowing system distributor 'The X.Org Foundation', version 11.0.12009000 System Description: Artix Linux Configured using: 'configure --with-x-toolkit=lucid' Configured features: XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: ERT-Results Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs auth-source eieio eieio-core eieio-loaddefs password-cache json map text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils thingatpt edmacro kmacro cl-extra vc-git diff-mode easy-mmode bug-reference dbus-tests dbus cl-seq cl-macs pcase xml subr-x seq byte-opt gv bytecomp byte-compile cconv ert-x ert pp ewoc debug backtrace help-mode easymenu find-func cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 122955 5639) (symbols 48 10363 1) (strings 32 26544 1387) (string-bytes 1 832865) (vectors 16 15402) (vector-slots 8 202326 11404) (floats 8 68 231) (intervals 56 612 0) (buffers 992 14)) --=-=-=--