From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id ADA31A00E6 for ; Tue, 9 Jul 2019 07:28:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8A2C12E81; Tue, 9 Jul 2019 07:28:18 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id A4D3A160 for ; Tue, 9 Jul 2019 07:28:16 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jul 2019 22:28:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,469,1557212400"; d="scan'208";a="159350708" Received: from ubuntu.sh.intel.com ([10.67.119.68]) by orsmga008.jf.intel.com with ESMTP; 08 Jul 2019 22:28:14 -0700 From: lihong To: dts@dpdk.org Cc: lihong Date: Tue, 9 Jul 2019 06:05:53 +0800 Message-Id: <1562623553-24007-1-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH V1] tests/vhost_event_idx_interrupt: add verify of qemu version X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" in this suite, the qemu will start as server mode, and qemu supports server mode starting with version 2.7 Signed-off-by: lihong --- 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