public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1 0/1] test: Fix pbap-client to work with system bus obexd
@ 2026-03-20 15:19 Sarveshwar Bajaj
  2026-03-20 15:19 ` [PATCH BlueZ v1 1/1] " Sarveshwar Bajaj
  0 siblings, 1 reply; 6+ messages in thread
From: Sarveshwar Bajaj @ 2026-03-20 15:19 UTC (permalink / raw)
  To: luiz.von.dentz, linux-bluetooth; +Cc: vinit.mehta, devyani.godbole

This series updates bluez test utilities to support systems where
obexd runs on the system bus via the --system-bus option. The existing
pbap-client script used the session bus, causing D-Bus NoReply failures
when creating PBAP sessions. 
This patch switches to dbus.SystemBus(), updates the main loop to 
GLib.MainLoop, and removes deprecated GObject fallback code. These 
changes restore PBAP functionality when using system-bus obexd. 

Validated on i.MX8MP with a Samsung S25 Ultra.

Sarveshwar Bajaj (1):
  test: Fix pbap-client to work with system bus obexd

 test/pbap-client | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH BlueZ v1 1/1] test: Fix pbap-client to work with system bus obexd
  2026-03-20 15:19 [PATCH BlueZ v1 0/1] test: Fix pbap-client to work with system bus obexd Sarveshwar Bajaj
@ 2026-03-20 15:19 ` Sarveshwar Bajaj
  2026-03-20 16:41   ` bluez.test.bot
  2026-03-20 18:05   ` [PATCH BlueZ v1 1/1] " Luiz Augusto von Dentz
  0 siblings, 2 replies; 6+ messages in thread
From: Sarveshwar Bajaj @ 2026-03-20 15:19 UTC (permalink / raw)
  To: luiz.von.dentz, linux-bluetooth; +Cc: vinit.mehta, devyani.godbole

commit 765356e80262 ("obexd: Unregister profiles when the user is
inactive") added support for running obexd on the system bus with
--system-bus flag. However, test/pbap-client was not updated to
match this change.

As a result, pbap-client fails when obexd runs on the system bus and
prints a NoReply error due to connecting over the session bus instead
of the system bus.

Fix by switching dbus.SessionBus() to dbus.SystemBus() and replacing
deprecated GObject.MainLoop with GLib.MainLoop and removing the legacy
GObject import fallback.

Tested with obexd running with --system-bus and with a paired Bluetooth
device.
---
 test/pbap-client | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/test/pbap-client b/test/pbap-client
index 6dada4a11..4ff301059 100755
--- a/test/pbap-client
+++ b/test/pbap-client
@@ -8,10 +8,7 @@ import sys
 import dbus
 import dbus.service
 import dbus.mainloop.glib
-try:
-  from gi.repository import GObject
-except ImportError:
-  import gobject as GObject
+from gi.repository import GLib
 
 BUS_NAME='org.bluez.obex'
 PATH = '/org/bluez/obex'
@@ -31,7 +28,7 @@ class PbapClient:
 		self.transfers = 0
 		self.props = dict()
 		self.flush_func = None
-		bus = dbus.SessionBus()
+		bus = dbus.SystemBus()
 		obj = bus.get_object(BUS_NAME, session_path)
 		self.session = dbus.Interface(obj, SESSION_INTERFACE)
 		self.pbap = dbus.Interface(obj, PHONEBOOK_ACCESS_INTERFACE)
@@ -114,9 +111,8 @@ class PbapClient:
 if  __name__ == '__main__':
 
 	dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-
-	bus = dbus.SessionBus()
-	mainloop = GObject.MainLoop()
+	bus = dbus.SystemBus()
+	mainloop = GLib.MainLoop()
 
 	client = dbus.Interface(bus.get_object(BUS_NAME, PATH),
 							CLIENT_INTERFACE)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: test: Fix pbap-client to work with system bus obexd
  2026-03-20 15:19 ` [PATCH BlueZ v1 1/1] " Sarveshwar Bajaj
@ 2026-03-20 16:41   ` bluez.test.bot
  2026-03-20 18:05   ` [PATCH BlueZ v1 1/1] " Luiz Augusto von Dentz
  1 sibling, 0 replies; 6+ messages in thread
From: bluez.test.bot @ 2026-03-20 16:41 UTC (permalink / raw)
  To: linux-bluetooth, sarveshwar.bajaj

[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1069971

---Test result---

Test Summary:
CheckPatch                    PENDING   0.35 seconds
GitLint                       PENDING   0.35 seconds
BuildEll                      PASS      20.77 seconds
BluezMake                     PASS      621.85 seconds
MakeCheck                     PASS      18.92 seconds
MakeDistcheck                 PASS      243.73 seconds
CheckValgrind                 PASS      290.02 seconds
CheckSmatch                   PASS      352.54 seconds
bluezmakeextell               PASS      179.64 seconds
IncrementalBuild              PENDING   0.36 seconds
ScanBuild                     PASS      992.43 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



https://github.com/bluez/bluez/pull/1978/checks

---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH BlueZ v1 1/1] test: Fix pbap-client to work with system bus obexd
  2026-03-20 15:19 ` [PATCH BlueZ v1 1/1] " Sarveshwar Bajaj
  2026-03-20 16:41   ` bluez.test.bot
@ 2026-03-20 18:05   ` Luiz Augusto von Dentz
  2026-03-23 12:35     ` [EXT] " Sarveshwar Bajaj
  1 sibling, 1 reply; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2026-03-20 18:05 UTC (permalink / raw)
  To: Sarveshwar Bajaj
  Cc: luiz.von.dentz, linux-bluetooth, vinit.mehta, devyani.godbole

Hi Sarveshwar,

On Fri, Mar 20, 2026 at 11:37 AM Sarveshwar Bajaj
<sarveshwar.bajaj@nxp.com> wrote:
>
> commit 765356e80262 ("obexd: Unregister profiles when the user is
> inactive") added support for running obexd on the system bus with
> --system-bus flag. However, test/pbap-client was not updated to
> match this change.
>
> As a result, pbap-client fails when obexd runs on the system bus and
> prints a NoReply error due to connecting over the session bus instead
> of the system bus.
>
> Fix by switching dbus.SessionBus() to dbus.SystemBus() and replacing
> deprecated GObject.MainLoop with GLib.MainLoop and removing the legacy
> GObject import fallback.
>
> Tested with obexd running with --system-bus and with a paired Bluetooth
> device.
> ---
>  test/pbap-client | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/test/pbap-client b/test/pbap-client
> index 6dada4a11..4ff301059 100755
> --- a/test/pbap-client
> +++ b/test/pbap-client
> @@ -8,10 +8,7 @@ import sys
>  import dbus
>  import dbus.service
>  import dbus.mainloop.glib
> -try:
> -  from gi.repository import GObject
> -except ImportError:
> -  import gobject as GObject
> +from gi.repository import GLib
>
>  BUS_NAME='org.bluez.obex'
>  PATH = '/org/bluez/obex'
> @@ -31,7 +28,7 @@ class PbapClient:
>                 self.transfers = 0
>                 self.props = dict()
>                 self.flush_func = None
> -               bus = dbus.SessionBus()
> +               bus = dbus.SystemBus()

Are these tests supposed to work only over system bus though? Perhaps
we should attempt to detect it somehow, or actually deprecate
pbap-client since obexctl can problably do the same thing with a
script or something.

>                 obj = bus.get_object(BUS_NAME, session_path)
>                 self.session = dbus.Interface(obj, SESSION_INTERFACE)
>                 self.pbap = dbus.Interface(obj, PHONEBOOK_ACCESS_INTERFACE)
> @@ -114,9 +111,8 @@ class PbapClient:
>  if  __name__ == '__main__':
>
>         dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
> -
> -       bus = dbus.SessionBus()
> -       mainloop = GObject.MainLoop()
> +       bus = dbus.SystemBus()
> +       mainloop = GLib.MainLoop()
>
>         client = dbus.Interface(bus.get_object(BUS_NAME, PATH),
>                                                         CLIENT_INTERFACE)
> --
> 2.34.1
>
>


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [EXT] Re: [PATCH BlueZ v1 1/1] test: Fix pbap-client to work with system bus obexd
  2026-03-20 18:05   ` [PATCH BlueZ v1 1/1] " Luiz Augusto von Dentz
@ 2026-03-23 12:35     ` Sarveshwar Bajaj
  2026-03-24  8:41       ` Bastien Nocera
  0 siblings, 1 reply; 6+ messages in thread
From: Sarveshwar Bajaj @ 2026-03-23 12:35 UTC (permalink / raw)
  To: Luiz Augusto von Dentz
  Cc: luiz.von.dentz@intel.com, linux-bluetooth@vger.kernel.org,
	Vinit Mehta, Devyani Godbole

Hi @Luiz,

Thanks for the feedback.

After commit 765356e80262 (“obexd: Unregister profiles when the user is inactive”), obexd operates exclusively on the system bus, and session bus mode is no longer supported. Because of this, pbap client test script must also use the system bus to function correctly with modern bluez.

While obexctl is indeed preferred tool for PBAP, the same operations can be performed through:
obexctl
[obexctl]# connect <device> pbap
[obexctl]# select int pb
[obexctl]# ls
[obexctl]# cp <source file> <destination file>

Given that several scripts under test/ overlap with obexctl functionality, it may be worth reviewing whether these scripts should be kept as D Bus examples, marked as deprecated or removed altogether.



-----Original Message-----
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com> 
Sent: 20 March 2026 23:36
To: Sarveshwar Bajaj <sarveshwar.bajaj@nxp.com>
Cc: luiz.von.dentz@intel.com; linux-bluetooth@vger.kernel.org; Vinit Mehta <vinit.mehta@nxp.com>; Devyani Godbole <devyani.godbole@nxp.com>
Subject: [EXT] Re: [PATCH BlueZ v1 1/1] test: Fix pbap-client to work with system bus obexd

Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button


Hi Sarveshwar,

On Fri, Mar 20, 2026 at 11:37 AM Sarveshwar Bajaj <sarveshwar.bajaj@nxp.com> wrote:
>
> commit 765356e80262 ("obexd: Unregister profiles when the user is
> inactive") added support for running obexd on the system bus with 
> --system-bus flag. However, test/pbap-client was not updated to match 
> this change.
>
> As a result, pbap-client fails when obexd runs on the system bus and 
> prints a NoReply error due to connecting over the session bus instead 
> of the system bus.
>
> Fix by switching dbus.SessionBus() to dbus.SystemBus() and replacing 
> deprecated GObject.MainLoop with GLib.MainLoop and removing the legacy 
> GObject import fallback.
>
> Tested with obexd running with --system-bus and with a paired 
> Bluetooth device.
> ---
>  test/pbap-client | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/test/pbap-client b/test/pbap-client index 
> 6dada4a11..4ff301059 100755
> --- a/test/pbap-client
> +++ b/test/pbap-client
> @@ -8,10 +8,7 @@ import sys
>  import dbus
>  import dbus.service
>  import dbus.mainloop.glib
> -try:
> -  from gi.repository import GObject
> -except ImportError:
> -  import gobject as GObject
> +from gi.repository import GLib
>
>  BUS_NAME='org.bluez.obex'
>  PATH = '/org/bluez/obex'
> @@ -31,7 +28,7 @@ class PbapClient:
>                 self.transfers = 0
>                 self.props = dict()
>                 self.flush_func = None
> -               bus = dbus.SessionBus()
> +               bus = dbus.SystemBus()

Are these tests supposed to work only over system bus though? Perhaps we should attempt to detect it somehow, or actually deprecate pbap-client since obexctl can problably do the same thing with a script or something.

>                 obj = bus.get_object(BUS_NAME, session_path)
>                 self.session = dbus.Interface(obj, SESSION_INTERFACE)
>                 self.pbap = dbus.Interface(obj, 
> PHONEBOOK_ACCESS_INTERFACE) @@ -114,9 +111,8 @@ class PbapClient:
>  if  __name__ == '__main__':
>
>         dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
> -
> -       bus = dbus.SessionBus()
> -       mainloop = GObject.MainLoop()
> +       bus = dbus.SystemBus()
> +       mainloop = GLib.MainLoop()
>
>         client = dbus.Interface(bus.get_object(BUS_NAME, PATH),
>                                                         
> CLIENT_INTERFACE)
> --
> 2.34.1
>
>


--
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [EXT] Re: [PATCH BlueZ v1 1/1] test: Fix pbap-client to work with system bus obexd
  2026-03-23 12:35     ` [EXT] " Sarveshwar Bajaj
@ 2026-03-24  8:41       ` Bastien Nocera
  0 siblings, 0 replies; 6+ messages in thread
From: Bastien Nocera @ 2026-03-24  8:41 UTC (permalink / raw)
  To: Sarveshwar Bajaj, Luiz Augusto von Dentz
  Cc: luiz.von.dentz@intel.com, linux-bluetooth@vger.kernel.org,
	Vinit Mehta, Devyani Godbole

On Mon, 2026-03-23 at 12:35 +0000, Sarveshwar Bajaj wrote:
> Hi @Luiz,
> 
> Thanks for the feedback.
> 
> After commit 765356e80262 (“obexd: Unregister profiles when the user
> is inactive”), obexd operates exclusively on the system bus, and
> session bus mode is no longer supported. Because of this, pbap client
> test script must also use the system bus to function correctly with
> modern bluez.

That's not what that commit does, and I don't see anything that would
cause obexd to not be able to run on the session bus, bug
notwithstanding.

Cheers

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-24  8:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-20 15:19 [PATCH BlueZ v1 0/1] test: Fix pbap-client to work with system bus obexd Sarveshwar Bajaj
2026-03-20 15:19 ` [PATCH BlueZ v1 1/1] " Sarveshwar Bajaj
2026-03-20 16:41   ` bluez.test.bot
2026-03-20 18:05   ` [PATCH BlueZ v1 1/1] " Luiz Augusto von Dentz
2026-03-23 12:35     ` [EXT] " Sarveshwar Bajaj
2026-03-24  8:41       ` Bastien Nocera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox