blueman icon indicating copy to clipboard operation
blueman copied to clipboard

Tests

Open cschramm opened this issue 11 years ago • 6 comments

Long way to go, but sooo needed...

cschramm avatar Apr 19 '14 17:04 cschramm

I'd really love to add some regression tests (or even complete test sets for single plugins) when fixing some stuff, but the fundamental thing we need to get started with this is some way to simulate bluetooth devices. Maybe there's some way to fake them, maybe even some official BlueZ tool. Otherwise we'll need to mock the org.bluez bus, but that will avoid testing the actual interaction of course...

Any ideas?

cschramm avatar Aug 17 '15 06:08 cschramm

disclaimer, I never done anything with tests, but I always found the topic interesting.

I found this very interesting. A follow up I have not watched yet is this one.

Basically they suggest to rewrite the functions so they can operate without needing external input like real bluetooth devices.

infirit avatar Aug 17 '15 09:08 infirit

@cschramm

I think you could use python-dbusmock for testing, it already has bluez4 and 5 templates

http://www.piware.de/2012/11/python-dbusmock-templates/

leigh123linux avatar Aug 19 '15 10:08 leigh123linux

Looks promising. Project home is here. Not sure if the BlueZ templates are complete and up-to-date, but we could send some PRs if we need something else. :smiley:

cschramm avatar Aug 19 '15 10:08 cschramm

OK, I experimented with dbusmock a little bit and created the tests branch. I'm experiencing strange issues with the dbus socket. Could someone please try running PYTHONPATH=. python blueman/test/plugins/applet/SerialManagerTest.py on the branch to see if he gets "Connection refused" errors from the applet child process as well? It looks like dbus-python creates an abstract socket which dbus fails to connect to. I can connect to the socket from another python process though...

cschramm avatar Nov 10 '15 07:11 cschramm

I do see Connection Refused and also noticed blueman-applet fails to start with maximum recursion depth exceeded.

edit: I have an ebuild for python-dbusmock.

infirit avatar Nov 10 '15 12:11 infirit