[PATCH v5 2/3] tests/vm: Let subclasses disable IPv6

Eduardo Habkost posted 3 patches 6 years ago
Maintainers: Fam Zheng <fam@euphon.net>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Kamil Rytarowski <kamil@netbsd.org>, "Alex Bennée" <alex.bennee@linaro.org>
[PATCH v5 2/3] tests/vm: Let subclasses disable IPv6
Posted by Eduardo Habkost 6 years ago
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>
---
 tests/vm/basevm.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index b5d1479bee..2929de23aa 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:
-- 
2.21.0


Re: [PATCH v5 2/3] tests/vm: Let subclasses disable IPv6
Posted by Philippe Mathieu-Daudé 6 years ago
On 10/18/19 8:17 PM, Eduardo Habkost wrote:
> 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>
> ---
>   tests/vm/basevm.py | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
> index b5d1479bee..2929de23aa 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:
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Re: [PATCH v5 2/3] tests/vm: Let subclasses disable IPv6
Posted by Thomas Huth 6 years ago
On 18/10/2019 20.17, Eduardo Habkost wrote:
> 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>
> ---
>  tests/vm/basevm.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
> index b5d1479bee..2929de23aa 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:
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>