]> Git Repo - qemu.git/commitdiff
tests/vm: send proxy environment variables over ssh
authorGerd Hoffmann <[email protected]>
Mon, 17 Jun 2019 04:38:48 +0000 (06:38 +0200)
committerAlex Bennée <[email protected]>
Thu, 4 Jul 2019 18:22:58 +0000 (19:22 +0100)
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 <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Tested-by: Thomas Huth <[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20190617043858[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
tests/vm/basevm.py

index 64067c1075fe2dd120a4a2a60eb01d6b83034494..75af3fbe6c45d3ac8d8a28c4772fc48c77a53f7d 100755 (executable)
@@ -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)
This page took 0.0243 seconds and 4 git commands to generate.