GNOME Bugzilla – Bug 629053
Socket error on python ldtp import when running from remote terminal
Last modified: 2010-09-09 09:16:21 UTC
Steps to reproduce: 1) Install ldtp2 on testhost 2) Enable accessibility on testhost 3) login to testhost desktop 4) ssh from anotherhost to testhost (you can try ssh -X, set your DISPLAY, xhost+...), in all cases, ldtp cannot be run remotely because of socket connect errors: bash-4.0$ python Python 2.6.4 (r264:75706, Aug 16 2010, 16:36:38) [C] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> import ldtp ** (-c:1191): WARNING **: Trying to register gtype 'WnckWindowState' as enum when in fact it is of type 'GFlags' ** (-c:1191): WARNING **: Trying to register gtype 'WnckWindowActions' as enum when in fact it is of type 'GFlags' ** (-c:1191): WARNING **: Trying to register gtype 'WnckWindowMoveResizeMask' as enum when in fact it is of type 'GFlags' Traceback (most recent call last): + Trace 223590 * File "<string>", line 1 in <module> * File "/usr/lib/python2.6/site-packages/ldtpd/__init__.py", line 56 in main pyatspi.setCacheLevel(pyatspi.CACHE_PROPERTIES) * File "/usr/lib/python2.6/vendor-packages/pyatspi/accessible.py", line 91 in setCacheLevel r.registerEventListener(_updateCache, *constants.CACHE_EVENTS) * File "/usr/lib/python2.6/vendor-packages/pyatspi/registry.py", line 331 in __getattribute__ raise RuntimeError('Could not find or activate registry') RuntimeError: Could not find or activate registry Traceback (most recent call last):
+ Trace 223594
_populateNamespace(globals())
for method in client._client.system.listMethods():
return self.__send(self.__name, args)
verbose=self.__verbose
self, host, handler, request_body, verbose=0)
self.send_content(h, request_body)
connection.endheaders()
self._send_output()
self.send(msg)
self.connect()
self.timeout)
raise error, msg socket.error: [Errno 146] Connection refused >>> quit Use quit() or Ctrl-D (i.e. EOF) to exit >>>
5) Now open a terminal on testhost python import ldtp {you'll see a few warnings about Gflags type but it works) 6) Now go back to another host and retry step 4. You'll see that import ldtp does work now that it has been "initialized" by a terminal running on the desktop of testhost. I previously logged this as https://bugzilla.gnome.org/show_bug.cgi?id=629041 and prematurely closed it when I didn't realize the conditions under which a remote terminal import of ldtp does work. You may wish to punt this to pyatspi. A similar problem occurs when trying to access the pyatspi.Registry() via a remote terminal.
As you could have noticed, pyatspi is throwing runtime exception: RuntimeError: Could not find or activate registry Try 'accerciser' with the above scenario. If that works, LDTP should work. There is alternate mechanism too: I haven't tried yet with LDTPv2, you can report back any issue you find :-) 1. Run 'ldtp' in terminal or service as regular user in system under test 2. From remote system (where you want to start the test) export LDTP_SERVER_ADDR=<IP address or host name> export LDTP_SERVER_PORT=4118 # Default server port is 4118, so no need to specify, unless you change the server port number Thanks
Great this works, thank you. You can close this bug, but I think this underlying pyatspi issue should stay open unless you know of a similar workaround: https://bugzilla.gnome.org/show_bug.cgi?id=629056