remote.copy_files_{to,from}: Check for valid client

If the copy methods are called with an unsupported client, they will
silently ignore the request which leads to hard-to-debug errors when the
files are not properly copied to the target. This patch makes them throw
an error instead.

Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com>
Add new helper: remote_build

Being able to build test binaries from test cases is a neccessity, but
it incurrs lots of complexity in said test case. To avoid this
complexity, and to make it possible to implement build avoidance, split
this functionality into a separate class.

Notable requirements/changes:
- To separate binaries built with different CFLAGS, Builder creates
  separate directories for each make_flags combination on target
- Test applications built with this class require a Makefile. To pass
  specific compiler flags from the configuration, let the user specify
  arguments to the make process via the make_flags parameter, e.g.
  Builder( ... make_flags="CFLAGS='-g -O3'")
- Symlinks in the source directories are not copied to the target. There
  does not seem to be a need for this, and it made the implementation
  simpler.

Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com>
Merge pull request #1594 from zqad/utils_build

remote_build
libvirt_vm: Make destroy() support lxc.

If the vm is lxc container, we destroy it with virsh command
rather than send a shutdown into it.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_vm: Fix wrong option --uri with -c.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
backend: change the order of config files to include.

In tests-shared.cfg, we will include the other config files. And
we should keep the user configuration at the last in the file list
to make the configuration from user override the default configuration.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_vm: Override wait_for_login() method in libvirt_vm.

Override the wait_for_login method of virt_vm to support other
guest in libvirt.

If connect_uri is lxc related, we call wait_for_serial_login()
directly, without attampting login it via network.

Other connect_uri, call virt_vm.wait_for_login().

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
env_process: Set two environment variable for current connect_uri.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
utils_env: Add a suffix for vm in env.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
utils_env: Return uri specificed vms in get_all_vms().

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_vm: make normalize_connect_uri return exact uri rather than None when input is default.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_vm: Fix for vm.connect_uri when it is default.

Default is not always qemu.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_vm: send ^] to serial_console when vm is lxc to close console.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>