aboutsummaryrefslogtreecommitdiff
path: root/tests/vm
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2019-10-18 15:17:04 -0300
committerAlex Bennée <alex.bennee@linaro.org>2019-10-25 19:24:21 +0100
commit5b7904811210997ad6bd4bcd678cfe7a46b9eb29 (patch)
treea1d3b8cb510956dbaf9a97383934a79dcb88aab6 /tests/vm
parentfc84471ae2867823f56b1ad1705de324c2d8b725 (diff)
downloadqemu-5b7904811210997ad6bd4bcd678cfe7a46b9eb29.zip
qemu-5b7904811210997ad6bd4bcd678cfe7a46b9eb29.tar.gz
qemu-5b7904811210997ad6bd4bcd678cfe7a46b9eb29.tar.bz2
tests/vm: Let subclasses disable IPv6
The mechanism will be used to work around issues related to IPv6 on the netbsd image builder. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20191018181705.17957-3-ehabkost@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Diffstat (limited to 'tests/vm')
-rwxr-xr-xtests/vm/basevm.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index b5d1479..2929de2 100755
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -57,6 +57,8 @@ class BaseVM(object):
arch = "#arch"
# command to halt the guest, can be overridden by subclasses
poweroff = "poweroff"
+ # enable IPv6 networking
+ ipv6 = True
def __init__(self, debug=False, vcpus=None):
self._guest = None
self._tmpdir = os.path.realpath(tempfile.mkdtemp(prefix="vm-test-",
@@ -81,7 +83,8 @@ class BaseVM(object):
self._args = [ \
"-nodefaults", "-m", "4G",
"-cpu", "max",
- "-netdev", "user,id=vnet,hostfwd=:127.0.0.1:0-:22",
+ "-netdev", "user,id=vnet,hostfwd=:127.0.0.1:0-:22" +
+ (",ipv6=no" if not self.ipv6 else ""),
"-device", "virtio-net-pci,netdev=vnet",
"-vnc", "127.0.0.1:0,to=20"]
if vcpus and vcpus > 1: