[dts] [PATCH V1] tests/crypto_perf_cryptodev_perf, cryptodev_common: optimize cryptodev test script

Jiang, YuX yux.jiang at intel.com
Wed Jul 1 04:25:37 CEST 2020


Tested-by: Jiang, YuX <yux.jiang at intel.com>

-----Original Message-----
From: Jiang, YuX 
Sent: Wednesday, July 1, 2020 9:59 AM
To: dts at dpdk.org
Cc: Jiang, YuX <yux.jiang at intel.com>
Subject: [dts][PATCH V1] tests/crypto_perf_cryptodev_perf,cryptodev_common: optimize cryptodev test script

From: "Jiang,yu" <yux.jiang at intel.com>

optimize case's result which cryptodev perf does not support.

Signed-off-by: Jiang,yu <yux.jiang at intel.com>
---
 tests/TestSuite_crypto_perf_cryptodev_perf.py | 8 +++++---
 tests/cryptodev_common.py                     | 4 ++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/TestSuite_crypto_perf_cryptodev_perf.py b/tests/TestSuite_crypto_perf_cryptodev_perf.py
index fc8f502..e1780f5 100644
--- a/tests/TestSuite_crypto_perf_cryptodev_perf.py
+++ b/tests/TestSuite_crypto_perf_cryptodev_perf.py
@@ -230,13 +230,13 @@ class PerfTestsCryptodev(TestCase):
 
     def _run_crypto_perf(self):
         if cc.is_test_skip(self):
-            return
+            return "skip"
 
         self.c_num, self.t_num = self._get_core_and_thread_num()
         devices = self._get_crypto_device(self.t_num)
         if not devices:
             self.logger.info("can not get device or unsupported, skip.")
-            return
+            return "skip"
 
         eal_opt_str = cc.get_eal_opt_str(self, devices)
         crypto_perf_opt_str = self._get_crypto_perf_opt_str() @@ -391,7 +391,9 @@ class PerfTestsCryptodev(TestCase):
 
     def _run_crypto_perf_throughput(self):
         results = self._run_crypto_perf()
-
+        if results == "skip":
+            return
+        self.verify(results, "test results is none, Test Failed")
         stats_results = self._stat_results_by_buf_size(results)
         json_result = []
 
diff --git a/tests/cryptodev_common.py b/tests/cryptodev_common.py index 832b3bf..23c7cd9 100644
--- a/tests/cryptodev_common.py
+++ b/tests/cryptodev_common.py
@@ -138,7 +138,7 @@ def get_qat_devices(test_case, cpm_num=None, num=1):
         cpm_num = len(test_case.dev.keys())
     n, dev_list = 0, []
     if cpm_num > len(test_case.dev.keys()):
-        self.logger.warning("QAT card only {} cpm, but {} required".format(
+        test_case.logger.warning("QAT card only {} cpm, but {} 
+ required".format(
             len(test_case.dev), cpm_num))
         return []
     for i in range(num):
@@ -148,7 +148,7 @@ def get_qat_devices(test_case, cpm_num=None, num=1):
             if i < len(test_case.dev[cpm]):
                 dev_list.append(test_case.dev[cpm][i])
             else:
-                self.logger.warning("not enough vf in cpm: {}".format(cpm))
+                test_case.logger.warning("not enough vf in cpm: 
+ {}".format(cpm))
             n += 1
     return dev_list
 
--
2.7.4

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PerfTestsCryptodev.log
Type: application/octet-stream
Size: 1453075 bytes
Desc: PerfTestsCryptodev.log
URL: <http://mails.dpdk.org/archives/dts/attachments/20200701/860df4c9/attachment.obj>


More information about the dts mailing list