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 E973CA0525; Fri, 21 Feb 2020 08:35:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 959A91BF9A; Fri, 21 Feb 2020 08:35:11 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id B283123D for ; Fri, 21 Feb 2020 08:35:09 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2020 23:35:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,467,1574150400"; d="scan'208";a="269897277" Received: from unknown (HELO dpdk-wenjielx-dtspatch135.sh.intel.com) ([10.240.176.135]) by fmsmga002.fm.intel.com with ESMTP; 20 Feb 2020 23:35:06 -0800 From: hanyingya To: dts@dpdk.org Cc: hanyingya Date: Fri, 21 Feb 2020 15:40:35 +0800 Message-Id: <1582270835-100754-1-git-send-email-yingyax.han@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1]tests/nic_single_core:Save standardized test results 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" Rich results in json format and remove redundant verification code. Signed-off-by: hanyingya --- tests/TestSuite_nic_single_core_perf.py | 54 +++++++++++-------------- 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/tests/TestSuite_nic_single_core_perf.py b/tests/TestSuite_nic_single_core_perf.py index 5781bc4..5fafe5f 100644 --- a/tests/TestSuite_nic_single_core_perf.py +++ b/tests/TestSuite_nic_single_core_perf.py @@ -197,20 +197,7 @@ class TestNicSingleCorePerf(TestCase): self.verify(self.nb_ports >= 1, "At least 1 port is required to test") self.perf_test(self.nb_ports) self.handle_results() - - # check the gap between expected throughput and actual throughput - try: - for frame_size in list(self.test_parameters.keys()): - for nb_desc in self.test_parameters[frame_size]: - cur_gap = (self.expected_throughput[frame_size][nb_desc] - self.throughput[frame_size][nb_desc]) - self.verify(cur_gap < self.gap, "Beyond Gap, Possible regression") - except Exception as e: - self.logger.error(e) - self.handle_expected() - raise VerifyFailure( - "Possible regression, Check your configuration please") - else: - self.handle_expected() + self.handle_expected() def handle_expected(self): """ @@ -336,27 +323,32 @@ class TestNicSingleCorePerf(TestCase): if self.save_result_flag is True ''' json_obj = dict() - json_obj['nic_type'] = self.nic - json_obj['results'] = list() + case_name = self.running_case + json_obj[case_name] = list() + status_result = [] for frame_size in list(self.test_parameters.keys()): for nb_desc in self.test_parameters[frame_size]: row_in = self.test_result[frame_size][nb_desc] - row_dict = dict() - row_dict['parameters'] = dict() - row_dict['parameters']['frame_size'] = dict( - value=row_in['Frame Size'], unit='bytes') - row_dict['parameters']['txd/rxd'] = dict( - value=row_in['TXD/RXD'], unit='descriptors') - delta = (float(row_in['Throughput'].split()[0]) - - float(row_in['Expected Throughput'].split()[0])) - if delta >= -self.gap: - result = 'PASS' + row_dict0 = dict() + row_dict0['performance'] = list() + row_dict0['parameters'] = list() + result_throughput = float(row_in['Throughput'].split()[0]) + expected_throughput = float(row_in['Expected Throughput'].split()[0]) + # delta value and accepted tolerance in percentage + delta = result_throughput - expected_throughput + if delta > -self.gap: + row_dict0['status'] = 'PASS' else: - result = 'FAIL' - row_dict['throughput'] = dict( - delta=delta, unit=row_in['Throughput'].split()[1], - result=result) - json_obj['results'].append(row_dict) + row_dict0['status'] = 'FAIL' + row_dict1 = dict(name="Throughput", value=result_throughput, unit="Mpps", delta=delta) + row_dict2 = dict(name="Txd/Rxd", value=row_in["TXD/RXD"], unit="descriptor") + row_dict3 = dict(name="frame_size", value=row_in["Frame Size"], unit="bytes") + row_dict0['performance'].append(row_dict1) + row_dict0['parameters'].append(row_dict2) + row_dict0['parameters'].append(row_dict3) + json_obj[case_name].append(row_dict0) + status_result.append(row_dict0['status']) + self.verify("FAIL" not in status_result, "Excessive gap between test results and expectations") with open(os.path.join(rst.path2Result, '{0:s}_single_core_perf.json'.format( self.nic)), 'w') as fp: -- 2.17.2