summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann2019-06-17 06:38:48 +0200
committerAlex Bennée2019-07-04 20:22:58 +0200
commitb08ba163aaae37003e515376d760b282a0111213 (patch)
tree906b435c4c9e413d491a6199fb496d6054a6c7f6
parenttests/vm: add source repos on ubuntu.i386 (diff)
downloadqemu-b08ba163aaae37003e515376d760b282a0111213.tar.gz
qemu-b08ba163aaae37003e515376d760b282a0111213.tar.xz
qemu-b08ba163aaae37003e515376d760b282a0111213.zip
tests/vm: send proxy environment variables over ssh
Packages are fetched via proxy that way, if configured on the host. That might be required to pass firewalls, and it allows to route package downloads through a caching proxy server. Needs AcceptEnv setup in sshd_config on the guest side to work. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Thomas Huth <thuth@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190617043858.8290-2-kraxel@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
-rwxr-xr-xtests/vm/basevm.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 64067c1075..75af3fbe6c 100755
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -39,6 +39,13 @@ class BaseVM(object):
GUEST_PASS = "qemupass"
ROOT_PASS = "qemupass"
+ envvars = [
+ "https_proxy",
+ "http_proxy",
+ "ftp_proxy",
+ "no_proxy",
+ ]
+
# The script to run in the guest that builds QEMU
BUILD_SCRIPT = ""
# The guest name, to be overridden by subclasses
@@ -107,6 +114,8 @@ class BaseVM(object):
"-o", "UserKnownHostsFile=" + os.devnull,
"-o", "ConnectTimeout=1",
"-p", self.ssh_port, "-i", self._ssh_key_file]
+ for var in self.envvars:
+ ssh_cmd += ['-o', "SendEnv=%s" % var ]
if interactive:
ssh_cmd += ['-t']
assert not isinstance(cmd, str)