avocado-framework / avocado-vt

Avocado VT Plugin
https://avocado-vt.readthedocs.org/
Other
84 stars 243 forks source link

Failed to execute qemu binary #644

Open etrunko opened 8 years ago

etrunko commented 8 years ago

This happens because of hardcoding LD_LIBRARY_PATH in function get_qemu_binary(), defined in utils_misc.py. This used to work before release 39, but something changed and now an exception is thrown:

Reproduced traceback from: /usr/lib/python2.7/site-packages/avocado_vt/test.py:420
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/avocado_vt/test.py", line 196, in runTest
    self._runTest()
  File "/usr/lib/python2.7/site-packages/avocado_vt/test.py", line 327, in _runTest
    params = env_process.preprocess(self, params, env)
  File "/usr/lib/python2.7/site-packages/virttest/error_context.py", line 135, in new_fn
    return fn(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/virttest/env_process.py", line 693, in preprocess
    verbose=False)
  File "/usr/lib/python2.7/site-packages/avocado/utils/process.py", line 1126, in system_output
    sudo=sudo)
  File "/usr/lib/python2.7/site-packages/avocado/utils/process.py", line 1030, in run
    cmd_result = sp.run(timeout=timeout)
  File "/usr/lib/python2.7/site-packages/avocado/utils/process.py", line 558, in run
    self._init_subprocess()
  File "/usr/lib/python2.7/site-packages/avocado/utils/process.py", line 348, in _init_subprocess
    raise exc
OSError: File 'LD_LIBRARY_PATH=/usr/share/avocado-plugins-vt/backends/qemu/install_root/lib' not found

I don't know avocado deeply enough to say if it is possible to specify the environment variables of a command via configuration, but definitely, hardcoding it in that function seems wrong. I would like to contribute with the fix for this issue, but I would need some pointers of what and how to do it.

I talked to @clebergnu about this problem and he provided a workaround for this problem.

Here is the job.log file.

PandaWei commented 8 years ago

Indeed, hardcoding is unreasonable.

We allow users to specify the path of qemu binary in shared/cfg/base.cfg now. How about add items for qemu library.

Absolute paths and/or names of binaries (default path is /usr/bin)

qemu_binary = qemu qemu_img_binary = qemu-img qemu_io_binary = qemu-io

etrunko commented 8 years ago

I also needed to patch utils_misc file, here is the updated patch

PandaWei commented 8 years ago

You can open a PR including your patch

etrunko commented 8 years ago

This patch is a workaround only, a quick hack to make things work as before. Cleber helped me with this one, and I am pretty sure it is not the right way to do it.

On Wed, Nov 9, 2016 at 12:01 AM, Wei Jiangang notifications@github.com wrote:

You can open a PR including your patch

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/avocado-framework/avocado-vt/issues/644#issuecomment-259316493, or mute the thread https://github.com/notifications/unsubscribe-auth/AAzATzVcInWCdoFr5KpR9QXP4GJjNwqAks5q8SlugaJpZM4Jbn3U .

Eduardo de Barros Lima ◤✠◢ eblima@gmail.com