Hi Andres,<br><br><div class="gmail_quote">On Fri, Oct 26, 2012 at 12:44 PM, Andres Riancho <span dir="ltr"><<a href="mailto:andres.riancho@gmail.com" target="_blank">andres.riancho@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Nagappan,<br>
<br>
On Wed, Oct 24, 2012 at 10:54 PM, Nagappan Alagappan <<a href="mailto:nagappan@gmail.com">nagappan@gmail.com</a>> wrote:<br>
> Hi Andres,<br>
><br>
> On Wed, Oct 24, 2012 at 6:31 PM, Andres Riancho <<a href="mailto:andres.riancho@gmail.com">andres.riancho@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Nagappan,<br>
>><br>
>> Thanks for the quick reply, please read inline:<br>
>><br>
>> On Wed, Oct 24, 2012 at 4:04 PM, Nagappan Alagappan <<a href="mailto:nagappan@gmail.com">nagappan@gmail.com</a>><br>
>> wrote:<br>
>> > Hi Andres,<br>
>> ><br>
>> > Unfortunately the underlying libraries doesn't work based on DISPLAY.<br>
>><br>
>> That sucks :(<br>
><br>
><br>
> I mean to say a11y libraries, anyways you got what I try to convey :-)<br>
><br>
>><br>
>><br>
>> > You can use either of the approach [1]<br>
>><br>
>> Executing scripts remotely is not what I need, since I want to<br>
>> have the code under test and the LDTP test in the same workstation,<br>
>> ideally developers should be able to run these LDTP tests in their<br>
>> workstations before a commit.<br>
>><br>
>> > or [2].<br>
>><br>
>> Hudson X11 is similar to what I've read in Mago's wiki, the<br>
>> a11yservice.py // a11yclient.py are basically a way to send commands<br>
>> from one context to the other. The client is run in the Hudson context<br>
>> and in which context does the service run? xinit?<br>
><br>
><br>
> I created this for Mago project. Hudson runs as root user (atleast in<br>
> Ubuntu). So, I need to create 2 different scripts, a11yservice.py will run<br>
> as regular user and a11yclient.py will run as Hudson user.<br>
<br>
Before we continue, thanks for your detailed and quick responses! Now<br>
to the next set of questions :)<br>
<br>
Why are these two lines not run via a11yclient?<br>
<br>
# Enable accessibility on the "hudson" user<br>
gconftool-2 --set --type bool /desktop/gnome/interface/accessibility true<br></blockquote><div><br></div><div>If accessibility is not enabled, then we need to enable it, this command have changed as the underlying libraries changed from CORBA to DBUS. It should be gsettings. If accessibility is enabled and the following screensaver-saver is disabled (manually), then you can ignore this and the following step. Screensaver suspends the accessibility daemon activity, to run our test continuously, we need to disable screensaver.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
# Accessibility test will hang, if screensaver started during the test<br>
gconftool-2 --type bool --set<br>
/apps/gnome-screensaver/idle_activation_enabled false<br>
<br>
Are they still effective if you run them with the Hudson/root user?<br></blockquote><div><br></div><div>With Hudson user, yes its effective.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
>><br>
>> Do you see any possibility to run LDTP tests in xvfb? Is the a11y<br>
>> service/client the way?<br>
><br>
> If a11yservice.py gets started when the Xvfb session starts, then you can<br>
> run the test as you expect, by invoking your script with a11yclient.py.<br>
<br>
If the tests are invoked like this:<br>
/usr/bin/a11yclient.py 'xterm -e "cd mago;PYTHONPATH=. ./bin/mago<br>
--noa11y -a gedit"'<br>
<br>
Or in my case with something similar to:<br>
/usr/bin/a11yclient.py 'xterm -e "...;nosetests core/ui/gui/tests/"'<br>
<br>
All I'll get from nosetests (which is the test runner I use in my<br>
project) is the stderr and stdout, correct? In other words, if I want<br>
to debug the unittest or do anything else it will be completely<br>
unaccessible because of the a11yclient / xterm combination; correct?<br></blockquote><div><br></div><div>Yes, you are correct. Its not recommended to rely stdout / stderr with subprocess, as it consumes memory, maybe I would suggest to write some log file, while running the test.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Instead of using the .desktop shortcut, have you tried to start the<br>
a11y server in xinitrc.hudson? Does it work?<br></blockquote><div><br></div><div>I haven't tried that. Please let me know your results.</div><div><br></div><div>Thanks</div><div>Nagappan</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> Hope this helps.<br>
><br>
> Thanks<br>
> Nagappan<br>
><br>
>><br>
>><br>
>> Regards,<br>
>><br>
>> > Thanks<br>
>> > Nagappan<br>
>> ><br>
>> > [1] - <a href="http://ldtp.freedesktop.org/wiki/Executing_scripts_remotely" target="_blank">http://ldtp.freedesktop.org/wiki/Executing_scripts_remotely</a><br>
>> > [2] -<br>
>> > <a href="http://bazaar.launchpad.net/~nagappan/hudson-x11-guitest/head/files" target="_blank">http://bazaar.launchpad.net/~nagappan/hudson-x11-guitest/head/files</a><br>
>> ><br>
>> > On Wed, Oct 24, 2012 at 7:59 AM, Andres Riancho<br>
>> > <<a href="mailto:andres.riancho@gmail.com">andres.riancho@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> List,<br>
>> >><br>
>> >> Sorry if this is a FAQ but I was unable to make it work. I want to<br>
>> >> run LDTP in Xvfb and I don't seem to find how to do it. I've read some<br>
>> >> documents [0][1] and tested extensively but found myself in a<br>
>> >> dead-end. This is what I'm doing:<br>
>> >><br>
>> >> Console #1, start Xvfb:<br>
>> >> /usr/bin/Xvfb :2 -screen 0 1024x768x24 -fbdir /tmp<br>
>> >><br>
>> >> Console #2, start helloworld.py application in :2:<br>
>> >> DISPLAY=:2 python helloworld.py<br>
>> >><br>
>> >> Console #3, start VNC server on :2 to verify that helloworld.py is<br>
>> >> running:<br>
>> >> x11vnc -display :2 -shared -forever<br>
>> >><br>
>> >> Connect to the VNC server and find that the window is there. Without<br>
>> >> window decoration, but it is there.<br>
>> >><br>
>> >> Console #4, run sniff.py [2] on display :2:<br>
>> >> DISPLAY=:2 python sniff.py hello<br>
>> >><br>
>> >> Expected result from the last command would be something that contains<br>
>> >> "frmhelloworld.py"; instead I see the list of windows that are in my<br>
>> >> working X (:0). In other words, getwindowlist [3] seems to be ignoring<br>
>> >> the DISPLAY environment variable. I've also tested this:<br>
>> >><br>
>> >> export DISPLAY=localhost:2<br>
>> >> python sniff.py hello<br>
>> >><br>
>> >> And I still get the same result. If, after the export I run "gedit",<br>
>> >> the text editor will appear on my Xvfb (which I'm watching using VNC).<br>
>> >><br>
>> >> So, the question would be... how do I tell LDTP to "connect" / "run"<br>
>> >> in a different display? Is there any updated documentation on<br>
>> >> LDTP+Xvfb?<br>
>> >><br>
>> >> Thanks,<br>
>> >><br>
>> >> [0]<br>
>> >><br>
>> >> <a href="http://ldtp.freedesktop.org/wiki/Howto_run_ldtp_inside_Xvfb_which_runs_in_xinit_session" target="_blank">http://ldtp.freedesktop.org/wiki/Howto_run_ldtp_inside_Xvfb_which_runs_in_xinit_session</a><br>
>> >> [1] <a href="http://mago.ubuntu.com/Documentation/RunningOnHudson" target="_blank">http://mago.ubuntu.com/Documentation/RunningOnHudson</a><br>
>> >> [2]<br>
>> >><br>
>> >> <a href="https://sourceforge.net/apps/trac/w3af/browser/branches/threading2/core/ui/gtkUi/tests/ldtp_wrapper/sniff.py?rev=6006" target="_blank">https://sourceforge.net/apps/trac/w3af/browser/branches/threading2/core/ui/gtkUi/tests/ldtp_wrapper/sniff.py?rev=6006</a><br>
>> >> [3] from ldtp import getwindowlist<br>
>> >><br>
>> >> Regards,<br>
>> >> --<br>
>> >> Andrés Riancho<br>
>> >> Project Leader at w3af - <a href="http://w3af.org/" target="_blank">http://w3af.org/</a><br>
>> >> Web Application Attack and Audit Framework<br>
>> >> Twitter: @w3af<br>
>> >> GPG: 0x93C344F3<br>
>> >> _______________________________________________<br>
>> >> LDTP-dev mailing list<br>
>> >> <a href="mailto:LDTP-dev@lists.freedesktop.org">LDTP-dev@lists.freedesktop.org</a><br>
>> >> <a href="http://lists.freedesktop.org/mailman/listinfo/ldtp-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/ldtp-dev</a><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Cross platform GUI testing<br>
>> > Linux Desktop (GUI Application) Testing Project -<br>
>> > <a href="http://ldtp.freedesktop.org" target="_blank">http://ldtp.freedesktop.org</a><br>
>> > Cobra - Windows GUI Automation tool - <a href="https://github.com/ldtp/cobra" target="_blank">https://github.com/ldtp/cobra</a><br>
>> > ATOMac - Mac GUI Automation tool - <a href="https://github.com/pyatom/pyatom" target="_blank">https://github.com/pyatom/pyatom</a><br>
>> > <a href="http://nagappanal.blogspot.com" target="_blank">http://nagappanal.blogspot.com</a><br>
>> ><br>
>><br>
>><br>
>><br>
>> --<br>
>> Andrés Riancho<br>
>> Project Leader at w3af - <a href="http://w3af.org/" target="_blank">http://w3af.org/</a><br>
>> Web Application Attack and Audit Framework<br>
>> Twitter: @w3af<br>
>> GPG: 0x93C344F3<br>
><br>
><br>
><br>
<span class="HOEnZb"><font color="#888888">><br>
> --<br>
> Cross platform GUI testing<br>
> Linux Desktop (GUI Application) Testing Project -<br>
> <a href="http://ldtp.freedesktop.org" target="_blank">http://ldtp.freedesktop.org</a><br>
> Cobra - Windows GUI Automation tool - <a href="https://github.com/ldtp/cobra" target="_blank">https://github.com/ldtp/cobra</a><br>
> ATOMac - Mac GUI Automation tool - <a href="https://github.com/pyatom/pyatom" target="_blank">https://github.com/pyatom/pyatom</a><br>
> <a href="http://nagappanal.blogspot.com" target="_blank">http://nagappanal.blogspot.com</a><br>
><br>
<br>
<br>
<br>
--<br>
Andrés Riancho<br>
Project Leader at w3af - <a href="http://w3af.org/" target="_blank">http://w3af.org/</a><br>
Web Application Attack and Audit Framework<br>
Twitter: @w3af<br>
GPG: 0x93C344F3<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Cross platform GUI testing</div>Linux Desktop (GUI Application) Testing Project - <a href="http://ldtp.freedesktop.org" target="_blank">http://ldtp.freedesktop.org</a><br>
Cobra - Windows GUI Automation tool - <a href="https://github.com/ldtp/cobra" target="_blank">https://github.com/ldtp/cobra</a><div>ATOMac - Mac GUI Automation tool - <a href="https://github.com/pyatom/pyatom" target="_blank">https://github.com/pyatom/pyatom</a></div>
<div><a href="http://nagappanal.blogspot.com" target="_blank">http://nagappanal.blogspot.com</a></div><br>