From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 572C9A0548; Fri, 28 May 2021 09:48:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4E6BB40143; Fri, 28 May 2021 09:48:32 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 9AAD340040 for ; Fri, 28 May 2021 09:48:30 +0200 (CEST) IronPort-SDR: R0BOKXfLJ2Yt1iVKQRIUbWXMlcIUD3rXll4GRQs9Vn2zBO+uqvMZPJCnrqp/DO/b/l0dUz2esZ 2H5BlDpQcYvA== X-IronPort-AV: E=McAfee;i="6200,9189,9997"; a="266799660" X-IronPort-AV: E=Sophos;i="5.83,229,1616482800"; d="scan'208";a="266799660" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2021 00:48:28 -0700 IronPort-SDR: QOC5MUXi4nqNjaAGb0KR/AcxigHynwHYWdddCQYsznc4qiP3T+0LwquQ1bbXtnMbCOOhOtsFvl NhXF1ltC4MKw== X-IronPort-AV: E=Sophos;i="5.83,229,1616482800"; d="scan'208";a="477839100" Received: from unknown (HELO localhost.localdomain) ([10.240.183.80]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2021 00:48:27 -0700 From: Yu Jiang To: dts@dpdk.org Cc: Yu Jiang Date: Fri, 28 May 2021 15:53:12 +0800 Message-Id: <20210528075312.23366-3-yux.jiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210528075312.23366-1-yux.jiang@intel.com> References: <20210528075312.23366-1-yux.jiang@intel.com> Subject: [dts] [PATCH V1 2/2] tests/unit_tests_cryptodev_func: support vdev param X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" Based on dpdk commit 8bfdd8a7f0f1 ("test/crypto: refactor to use sub test suites"), unit test support vdev param. Signed-off-by: Yu Jiang --- conf/unit_tests_cryptodev_func.cfg | 32 +++++++++++++++++++++++++ tests/TestSuite_unit_tests_cryptodev_func.py | 36 +++++++++++++++++++++++++++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 conf/unit_tests_cryptodev_func.cfg diff --git a/conf/unit_tests_cryptodev_func.cfg b/conf/unit_tests_cryptodev_func.cfg new file mode 100644 index 0000000..0516293 --- /dev/null +++ b/conf/unit_tests_cryptodev_func.cfg @@ -0,0 +1,32 @@ +[suite] + +# vdev which is supported from 21.05rc3 commit id: 8bfdd8a7f0 test/crypto: refactor to use sub test suites +[test_cryptodev_aesni_gcm_autotest] +devtype="crypto_aesni_gcm" + +[test_cryptodev_aesni_mb_autotest] +devtype="crypto_aesni_mb" + +[test_cryptodev_null_autotest] +devtype="crypto_null" + +[test_cryptodev_openssl_autotest] +devtype="crypto_openssl" + +[test_cryptodev_qat_asym_autotest] +devtype="crypto_qat" + +[test_cryptodev_qat_autotest] +devtype="crypto_qat" + +[test_cryptodev_scheduler_autotest] +devtype="crypto_scheduler" + +[test_cryptodev_sw_kasumi_autotest] +devtype="crypto_kasumi" + +[test_cryptodev_sw_snow3g_autotest] +devtype="crypto_snow3g" + +[test_cryptodev_sw_zuc_autotest] +devtype="crypto_zuc" diff --git a/tests/TestSuite_unit_tests_cryptodev_func.py b/tests/TestSuite_unit_tests_cryptodev_func.py index 98425d4..1564c7f 100644 --- a/tests/TestSuite_unit_tests_cryptodev_func.py +++ b/tests/TestSuite_unit_tests_cryptodev_func.py @@ -53,6 +53,39 @@ class UnitTestsCryptodev(TestCase): def tear_down_all(self): cc.clear_dpdk_config(self) + def _get_crypto_device(self, num): + device = {} + if self.get_case_cfg()["devtype"] == "crypto_aesni_mb": + dev = "crypto_aesni_mb" + elif self.get_case_cfg()["devtype"] == "crypto_qat": + w = cc.get_qat_devices(self, cpm_num=1, num=num) +# device["a"] = ' -a '.join(w) + device["vdev"] = None + elif self.get_case_cfg()["devtype"] == "crypto_openssl": + dev = "crypto_openssl" + elif self.get_case_cfg()["devtype"] == "crypto_aesni_gcm": + dev = "crypto_aesni_gcm" + elif self.get_case_cfg()["devtype"] == "crypto_kasumi": + dev = "crypto_kasumi" + elif self.get_case_cfg()["devtype"] == "crypto_snow3g": + dev = "crypto_snow3g" + elif self.get_case_cfg()["devtype"] == "crypto_zuc": + dev = "crypto_zuc" + elif self.get_case_cfg()["devtype"] == "crypto_null": + dev = "crypto_null" + else: + return {} + + if not device: + vdev_list = [] + for i in range(num): + vdev = "{}{}".format(dev, i) + vdev_list.append(vdev) + # device["a"] = "0000:00:00.0" + device["vdev"] = ' --vdev '.join(vdev_list) + + return device + def test_cryptodev_qat_autotest(self): self.__run_unit_test("cryptodev_qat_autotest") @@ -105,7 +138,8 @@ class UnitTestsCryptodev(TestCase): self.__run_unit_test("cryptodev_scheduler_autotest") def __run_unit_test(self, testsuite, timeout=600): - eal_opt_str = cc.get_eal_opt_str(self) + devices = self._get_crypto_device(num=1) + eal_opt_str = cc.get_eal_opt_str(self, devices) w = cc.get_qat_devices(self, num=1) self.logger.info("STEP_TEST: " + testsuite) -- 2.7.4