* [dts] [PATCH V1] tests/vhost_event_idx_interrupt: add verify of qemu version
@ 2019-07-08 22:05 lihong
2019-07-09 5:29 ` Ma, LihongX
2019-07-10 2:07 ` Tu, Lijuan
0 siblings, 2 replies; 3+ messages in thread
From: lihong @ 2019-07-08 22:05 UTC (permalink / raw)
To: dts; +Cc: lihong
in this suite, the qemu will start as server mode, and qemu supports
server mode starting with version 2.7
Signed-off-by: lihong <lihongx.ma@intel.com>
---
tests/TestSuite_vhost_event_idx_interrupt.py | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/tests/TestSuite_vhost_event_idx_interrupt.py b/tests/TestSuite_vhost_event_idx_interrupt.py
index 4df5a42..24cd066 100644
--- a/tests/TestSuite_vhost_event_idx_interrupt.py
+++ b/tests/TestSuite_vhost_event_idx_interrupt.py
@@ -36,6 +36,7 @@ Vhost event idx interrupt need test with l3fwd-power sample
import utils
import time
+import re
from virt_common import VM
from test_case import TestCase
@@ -136,6 +137,26 @@ class TestVhostEventIdxInterrupt(TestCase):
if vm_config.params[i].keys()[0] == 'cpu':
vm_config.params[i]['cpu'][0]['number'] = self.queues
+ def check_qemu_version(self, vm_config):
+ """
+ in this suite, the qemu version should greater 2.7
+ """
+ self.vm_qemu_version = vm_config.qemu_emulator
+ params_number = len(vm_config.params)
+ for i in range(params_number):
+ if vm_config.params[i].keys()[0] == 'qemu':
+ self.vm_qemu_version = vm_config.params[i]['qemu'][0]['path']
+
+ out = self.dut.send_expect("%s --version" % self.vm_qemu_version, "#")
+ result = re.search("QEMU\s*emulator\s*version\s*(\d*.\d*)", out)
+ self.verify(result is not None,
+ 'the qemu path may be not right: %s' % self.vm_qemu_version)
+ version = result.group(1)
+ index = version.find('.')
+ self.verify(int(version[:index])>2 or (int(version[:index])==2 and int(version[index+1:])>=7),
+ 'This qemu version should greater than 2.7 ' + \
+ 'in this suite, please config it in vhost_sample.cfg file')
+
def start_vms(self, vm_num=1):
"""
start qemus
@@ -156,6 +177,7 @@ class TestVhostEventIdxInterrupt(TestCase):
vm_params['opt_settings'] = opt_args
vm_info.set_vm_device(**vm_params)
self.set_vm_cpu_number(vm_info)
+ self.check_qemu_version(vm_info)
vm_dut = None
try:
vm_dut = vm_info.start(load_config=False)
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [PATCH V1] tests/vhost_event_idx_interrupt: add verify of qemu version
2019-07-08 22:05 [dts] [PATCH V1] tests/vhost_event_idx_interrupt: add verify of qemu version lihong
@ 2019-07-09 5:29 ` Ma, LihongX
2019-07-10 2:07 ` Tu, Lijuan
1 sibling, 0 replies; 3+ messages in thread
From: Ma, LihongX @ 2019-07-09 5:29 UTC (permalink / raw)
To: dts
Tested-by: lihong<lihongx.ma@intel.com>
-----Original Message-----
From: Ma, LihongX
Sent: Tuesday, July 9, 2019 6:06 AM
To: dts@dpdk.org
Cc: Ma, LihongX <lihongx.ma@intel.com>
Subject: [dts][PATCH V1] tests/vhost_event_idx_interrupt: add verify of qemu version
in this suite, the qemu will start as server mode, and qemu supports server mode starting with version 2.7
Signed-off-by: lihong <lihongx.ma@intel.com>
---
tests/TestSuite_vhost_event_idx_interrupt.py | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/tests/TestSuite_vhost_event_idx_interrupt.py b/tests/TestSuite_vhost_event_idx_interrupt.py
index 4df5a42..24cd066 100644
--- a/tests/TestSuite_vhost_event_idx_interrupt.py
+++ b/tests/TestSuite_vhost_event_idx_interrupt.py
@@ -36,6 +36,7 @@ Vhost event idx interrupt need test with l3fwd-power sample
import utils
import time
+import re
from virt_common import VM
from test_case import TestCase
@@ -136,6 +137,26 @@ class TestVhostEventIdxInterrupt(TestCase):
if vm_config.params[i].keys()[0] == 'cpu':
vm_config.params[i]['cpu'][0]['number'] = self.queues
+ def check_qemu_version(self, vm_config):
+ """
+ in this suite, the qemu version should greater 2.7
+ """
+ self.vm_qemu_version = vm_config.qemu_emulator
+ params_number = len(vm_config.params)
+ for i in range(params_number):
+ if vm_config.params[i].keys()[0] == 'qemu':
+ self.vm_qemu_version =
+ vm_config.params[i]['qemu'][0]['path']
+
+ out = self.dut.send_expect("%s --version" % self.vm_qemu_version, "#")
+ result = re.search("QEMU\s*emulator\s*version\s*(\d*.\d*)", out)
+ self.verify(result is not None,
+ 'the qemu path may be not right: %s' % self.vm_qemu_version)
+ version = result.group(1)
+ index = version.find('.')
+ self.verify(int(version[:index])>2 or (int(version[:index])==2 and int(version[index+1:])>=7),
+ 'This qemu version should greater than 2.7 ' + \
+ 'in this suite, please config it in
+ vhost_sample.cfg file')
+
def start_vms(self, vm_num=1):
"""
start qemus
@@ -156,6 +177,7 @@ class TestVhostEventIdxInterrupt(TestCase):
vm_params['opt_settings'] = opt_args
vm_info.set_vm_device(**vm_params)
self.set_vm_cpu_number(vm_info)
+ self.check_qemu_version(vm_info)
vm_dut = None
try:
vm_dut = vm_info.start(load_config=False)
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [PATCH V1] tests/vhost_event_idx_interrupt: add verify of qemu version
2019-07-08 22:05 [dts] [PATCH V1] tests/vhost_event_idx_interrupt: add verify of qemu version lihong
2019-07-09 5:29 ` Ma, LihongX
@ 2019-07-10 2:07 ` Tu, Lijuan
1 sibling, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2019-07-10 2:07 UTC (permalink / raw)
To: Ma, LihongX, dts; +Cc: Ma, LihongX
Applied, thanks
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong
> Sent: Tuesday, July 9, 2019 6:06 AM
> To: dts@dpdk.org
> Cc: Ma, LihongX <lihongx.ma@intel.com>
> Subject: [dts] [PATCH V1] tests/vhost_event_idx_interrupt: add verify of
> qemu version
>
> in this suite, the qemu will start as server mode, and qemu supports server
> mode starting with version 2.7
>
> Signed-off-by: lihong <lihongx.ma@intel.com>
> ---
> tests/TestSuite_vhost_event_idx_interrupt.py | 22
> ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/tests/TestSuite_vhost_event_idx_interrupt.py
> b/tests/TestSuite_vhost_event_idx_interrupt.py
> index 4df5a42..24cd066 100644
> --- a/tests/TestSuite_vhost_event_idx_interrupt.py
> +++ b/tests/TestSuite_vhost_event_idx_interrupt.py
> @@ -36,6 +36,7 @@ Vhost event idx interrupt need test with l3fwd-power
> sample
>
> import utils
> import time
> +import re
> from virt_common import VM
> from test_case import TestCase
>
> @@ -136,6 +137,26 @@ class TestVhostEventIdxInterrupt(TestCase):
> if vm_config.params[i].keys()[0] == 'cpu':
> vm_config.params[i]['cpu'][0]['number'] = self.queues
>
> + def check_qemu_version(self, vm_config):
> + """
> + in this suite, the qemu version should greater 2.7
> + """
> + self.vm_qemu_version = vm_config.qemu_emulator
> + params_number = len(vm_config.params)
> + for i in range(params_number):
> + if vm_config.params[i].keys()[0] == 'qemu':
> + self.vm_qemu_version =
> + vm_config.params[i]['qemu'][0]['path']
> +
> + out = self.dut.send_expect("%s --version" % self.vm_qemu_version, "#")
> + result = re.search("QEMU\s*emulator\s*version\s*(\d*.\d*)", out)
> + self.verify(result is not None,
> + 'the qemu path may be not right: %s' % self.vm_qemu_version)
> + version = result.group(1)
> + index = version.find('.')
> + self.verify(int(version[:index])>2 or (int(version[:index])==2 and
> int(version[index+1:])>=7),
> + 'This qemu version should greater than 2.7 ' + \
> + 'in this suite, please config it in
> + vhost_sample.cfg file')
> +
> def start_vms(self, vm_num=1):
> """
> start qemus
> @@ -156,6 +177,7 @@ class TestVhostEventIdxInterrupt(TestCase):
> vm_params['opt_settings'] = opt_args
> vm_info.set_vm_device(**vm_params)
> self.set_vm_cpu_number(vm_info)
> + self.check_qemu_version(vm_info)
> vm_dut = None
> try:
> vm_dut = vm_info.start(load_config=False)
> --
> 2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-10 2:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-08 22:05 [dts] [PATCH V1] tests/vhost_event_idx_interrupt: add verify of qemu version lihong
2019-07-09 5:29 ` Ma, LihongX
2019-07-10 2:07 ` Tu, Lijuan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).