<div dir="ltr"><br><br><div class="gmail_quote">On Wed, Mar 11, 2015 at 4:14 PM Cleber Rosa <<a href="mailto:crosa@redhat.com">crosa@redhat.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello all,<br>
<br>
Here follows my report from the experimentation with Avocado on Windows.<br>
<br>
Environment:<br>
<br>
============<br>
<br>
* Microsoft Windows XP SP2 32bits<br>
<br>
* Python 2.7.9<br>
<br>
* Avocado:<br>
<br>
   - Initially at commit 4b3669f37d4b5f05b97d90b121b595<u></u>35d82be9c3<br>
<br>
   - Then a number of workarounds were applied on branch "windows_port" (<a href="http://github.com/clebergnu/avocado/tree/windows_port" target="_blank">http://github.com/clebergnu/<u></u>avocado/tree/windows_port</a>)<br>
<br>
   - Then branch "windows_port" was rebase on top of d9efd4ea03f89bf3a8d6a0f1d41669<u></u>ed0940b4e5.<br>
<br>
The following series of steps were used to verify how much of avocado can run on Microsoft Windows and how much effort could actually go into making it fully supported.<br>
<br>
Requirements:<br>
<br>
=============<br>
<br>
Since pip is builtin on Python 2.7.9, it was used to (try to) install all dependencies. First try was avocado's selftest requirements:<br>
<br>
$ python -m pip install -r requirements-selftests.txt<br>
<br>
nose>=1.3.0: OK<br>
<br>
Sphinx>=1.3b1: OK<br>
<br>
flexmock>=0.9.7: OK<br>
<br>
inspektor>=0.1.12: OK<br>
<br>
Now from requirements.txt:<br>
<br>
$ python -m pip install fabric>=1.7.0<br>
<br>
Installation seemed OK. It was possible to import fabric module from Python. Pycrypto C module "Crypto.Random.OSRNG.<u></u>winrandom" could not be built as it depends on MS Visual C++ 9.0. The easier (but manual) solution was to download a prebuilt version of pycrypto from:<br>
<br>
<a href="http://www.voidspace.org.uk/downloads/pycrypto26/pycrypto-2.6.win32-py2.7.exe" target="_blank">http://www.voidspace.org.uk/<u></u>downloads/pycrypto26/pycrypto-<u></u>2.6.win32-py2.7.exe</a><br>
<br>
This, together with failure to install some depencies on Linux with pip alone, further supports the idea of a custom installation script.<br>
<br>
$ python -m pip install libvirt-python<br>
<br>
This was attempted, but failure was certain. libvirt (the client part) is known to work on Windows, but for avocado's need we'd need to compile the python binding also, which was *not* attempted. This BLOCKS the "vm" plugin.<br>
<br>
$ python -m pip install pyliblzma<br>
<br>
Fails with "ValueError: close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr". So, pyliblzma should be optional. A patch that does just that has just been merged on master (<u></u>491effcd1492328f77365b40e22a18<u></u>467f866841).<br>
<br>
Other less problematic modules:<br>
<br>
PyYAML>=3.11: OK (C extension skipped)<br>
<br>
pystache>=0.5.3: OK<br>
<br>
requests>=1.2.3: OK<br>
<br>
Workarounds:<br>
<br>
============<br>
<br>
After this point, a number of code workarounds were performed. These are available for reference at:<br>
<br>
<a href="http://github.com/clebergnu/avocado/tree/windows_port" target="_blank">http://github.com/clebergnu/<u></u>avocado/tree/windows_port</a><br>
<br>
Example of changes include modules (non plugins) make use of Unix specific modules (fcntl) or even definitions (signal.SIGKILL).<br>
<br>
One workaround that has not made into the branch above, was a patch to argpase.py itself (failure to locate function named argpase.identity()), that manifested within the test runner itself at places such as multiprocessing.Process(), subprocess.Popen() and at various pickling times.<br>
<br>
Configuration:<br>
<br>
==============<br>
<br>
Avocado failed to find a proper configuration file. The quick and dirt workaround was to copy:<br>
<br>
$ cp -ruv etc C:\Python27\Lib\site-packages<br>
<br>
Functional tests:<br>
<br>
=================<br>
<br>
Since Avocado itself could still not run properly, functional tests were eliminated completely from the source tree.<br>
<br>
Unittests:<br>
<br>
==========<br>
<br>
Running unittests was tried at this stage, resulting in:<br>
<br>
Ran 93 tests in 2.703s<br>
FAILED (SKIP=2, errors=14, failures=15)<br>
<br>
Avocado Rest Client CLI App<br>
<br>
===========================<br>
<br>
avocado-rest-client behaved without major surprises (once the configuration was forced, there seems to be an issue here).<br>
<br>
Please refer to the attached image avocado-rest-client.jpg.<br>
<br>
Avocado CLI App<br>
<br>
===============<br>
<br>
Avocado itself failed to locate and run a test. The errors related to processes and pickling seem to be the major causes.<br>
<br>
Please refer to the other attached images.</blockquote><div><br></div><div>I was re-reading your e-mail and pondering about it - the issue you saw seems to be related to PYTHONPATH. Of course, that's just a hunch, but I wish I had time to play with it :) </div></div></div>