After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 629053 - Socket error on python ldtp import when running from remote terminal
Socket error on python ldtp import when running from remote terminal
Status: RESOLVED FIXED
Product: LDTP
Classification: Other
Component: ldtp2
2.0.0
Other Solaris
: Normal normal
: ---
Assigned To: LDTP Development Mailing List
LDTP Development Mailing List
Depends on:
Blocks:
 
 
Reported: 2010-09-08 12:31 UTC by Brian Nitz
Modified: 2010-09-09 09:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Brian Nitz 2010-09-08 12:31:56 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):
  • File "<stdin>", line 1 in <module>
  • File "/usr/lib/python2.6/site-packages/ldtp/__init__.py", line 257 in <module>
    _populateNamespace(globals())
  • File "/usr/lib/python2.6/site-packages/ldtp/__init__.py", line 60 in _populateNamespace
    for method in client._client.system.listMethods():
  • File "/usr/lib/python2.6/xmlrpclib.py", line 1199 in __call__
    return self.__send(self.__name, args)
  • File "/usr/lib/python2.6/xmlrpclib.py", line 1489 in __request
    verbose=self.__verbose
  • File "/usr/lib/python2.6/site-packages/ldtp/client.py", line 73 in request
    self, host, handler, request_body, verbose=0)
  • File "/usr/lib/python2.6/xmlrpclib.py", line 1235 in request
    self.send_content(h, request_body)
  • File "/usr/lib/python2.6/xmlrpclib.py", line 1349 in send_content
    connection.endheaders()
  • File "/usr/lib/python2.6/httplib.py", line 892 in endheaders
    self._send_output()
  • File "/usr/lib/python2.6/httplib.py", line 764 in _send_output
    self.send(msg)
  • File "/usr/lib/python2.6/httplib.py", line 723 in send
    self.connect()
  • File "/usr/lib/python2.6/httplib.py", line 704 in connect
    self.timeout)
  • File "/usr/lib/python2.6/socket.py", line 514 in create_connection
    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.
Comment 1 Nagappan Alagappan 2010-09-08 21:18:06 UTC
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
Comment 2 Brian Nitz 2010-09-09 09:16:21 UTC
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