提交 094f792e 编写于 作者: J Jonas Eriksson

virtual_nic_send_buffer: Fix building of udt

- Only try to install libraries to /usr/lib64 if the guest is x86_64:
  Some (usually 64-bit only) installations only have /usr/lib.

- Use && instead of ; to check for any errors in compilation, instead of
  discovering them when trying to run sendfile/recvfile

- Improve error output when building failed by saving and including the
  error message when raising an exception
Signed-off-by: NJonas Eriksson <jonas.eriksson@enea.com>
上级 ea85ad0a
......@@ -23,16 +23,18 @@ def run(test, params, env):
Linux guest env setup, install udt, set env and iptables
"""
lib_path = "/usr/lib64"
if '64' not in params.get("vm_arch_name", 'x86_64'):
if '64' not in params.get("vm_arch_name", 'x86_64') \
or session.get_cmd_status("test -d %s", lib_path):
lib_path = "/usr/lib"
cmd = r"git clone %s udt-git; " % params.get("udt_url")
cmd += r"cd udt-git/udt4; make; make install; "
cmd += r"cp -u src/*.so %s ; " % lib_path
cmd += r"cp -u app/sendfile app/recvfile /usr/bin/; "
cmd += r"iptables -I INPUT -p udp -j ACCEPT; "
cmd = r"git clone %s udt-git && " % params.get("udt_url")
cmd += r"cd udt-git/udt4 && make && make install && "
cmd += r"cp -u src/*.so %s && " % lib_path
cmd += r"cp -u app/sendfile app/recvfile /usr/bin/ && "
cmd += r"iptables -I INPUT -p udp -j ACCEPT && "
cmd += r"iptables -I OUTPUT -p udp -j ACCEPT "
if session.cmd_status(cmd):
raise error.TestError("Install udt on guest failed")
status, output = session.cmd_status_output(cmd)
if status:
raise error.TestError("Install udt on guest failed: '%s'" % output)
timeout = int(params.get("login_timeout", '360'))
transfer_timeout = int(params.get("transfer_timeout", '120'))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册