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 77357A2F6B for ; Wed, 9 Oct 2019 02:51:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 66BBB1C0AC; Wed, 9 Oct 2019 02:51:15 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id C29AC1C028 for ; Wed, 9 Oct 2019 02:51:13 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Oct 2019 17:51:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,273,1566889200"; d="scan'208";a="394858868" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga006.fm.intel.com with ESMTP; 08 Oct 2019 17:51:12 -0700 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 8 Oct 2019 17:51:12 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 8 Oct 2019 17:51:11 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.166]) by SHSMSX151.ccr.corp.intel.com ([10.239.6.50]) with mapi id 14.03.0439.000; Wed, 9 Oct 2019 08:51:09 +0800 From: "Chen, Zhaoyan" To: "Yao, BingX Y" , "dts@dpdk.org" CC: "Yao, BingX Y" , "Chen, Zhaoyan" Thread-Topic: [dts] [PATCH V1 2/3] add case suite fips_cryptodev Thread-Index: AQHVfZjz/nk+WKmNckKrzqVNHx9JCKdRfA5g Date: Wed, 9 Oct 2019 00:51:09 +0000 Message-ID: <9DEEADBC57E43F4DA73B571777FECECA41DD874F@SHSMSX104.ccr.corp.intel.com> References: <1570512569-17999-1-git-send-email-bingx.y.yao@intel.com> <1570512569-17999-2-git-send-email-bingx.y.yao@intel.com> In-Reply-To: <1570512569-17999-2-git-send-email-bingx.y.yao@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1 2/3] add case suite fips_cryptodev 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" Acked-by: Chen, Zhaoyan Regards, Zhaoyan Chen > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yaobing > Sent: Tuesday, October 8, 2019 1:29 PM > To: dts@dpdk.org > Cc: Yao, BingX Y > Subject: [dts] [PATCH V1 2/3] add case suite fips_cryptodev >=20 > add case suite fips_cryptodev >=20 > Signed-off-by: yaobing > --- > tests/TestSuite_fips_cryptodev.py | 190 ++++++++++++++++++++++++++++++ > 1 file changed, 190 insertions(+) > create mode 100644 tests/TestSuite_fips_cryptodev.py >=20 > diff --git a/tests/TestSuite_fips_cryptodev.py b/tests/TestSuite_fips_cry= ptodev.py > new file mode 100644 > index 0000000..1165ad8 > --- /dev/null > +++ b/tests/TestSuite_fips_cryptodev.py > @@ -0,0 +1,190 @@ > +# BSD LICENSE > +# > +# Copyright (c) <2019> Intel Corporation # All rights reserved. > +# > +# Redistribution and use in source and binary forms, with or without # > +modification, are permitted provided that the following conditions # > +are met: > +# > +# * Redistributions of source code must retain the above copyright > +# notice, this list of conditions and the following disclaimer. > +# * Redistributions in binary form must reproduce the above copyright > +# notice, this list of conditions and the following disclaimer in > +# the documentation and/or other materials provided with the > +# distribution. > +# * Neither the name of Intel Corporation nor the names of its > +# contributors may be used to endorse or promote products derived > +# from this software without specific prior written permission. > +# > +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND > CONTRIBUTORS # > +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # > +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS > FOR # > +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT > # > +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, > # > +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # > +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > # > +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON > ANY # > +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # > +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > # > +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + > + > +import utils > +from test_case import TestCase > +import cryptodev_common as cc > +import re > + > +class FipCryptodev(TestCase): > + > + def set_up_all(self): > + if not cc.is_build_skip(self): > + cc.build_dpdk_with_cryptodev(self) > + out =3D self.dut.build_dpdk_apps("./examples/fips_validation") > + self.verify("Error"not in out,"Compilation error") > + self.verify("No such"not in out,"Compilation error") > + self.vf_driver =3D self.get_suite_cfg()['vf_driver'] > + cc.bind_qat_device(self, "vfio-pci") > + self._app_path =3D "./examples/fips_validation/build/fips_valida= tion" > + self._default_fips_opts =3D { > + "req-file": None, > + "rsp-file": None, > + "cryptodev": None, > + "path-is-folder": "", > + "cryptodev-id": 0, > + "self-test":"", > + } > + self.FIP_path =3D "/root/FIPS" > + > + def set_up(self): > + pass > + > + def tear_down(self): > + self.dut.kill_all() > + > + def tear_down_all(self): > + cc.clear_dpdk_config(self) > + > + # Private functions > + def _get_fips_opt_str(self): > + return cc.get_opt_str(self, self._default_fips_opts,{}) > + > + def _run_fips(self, eal_opt_str, fips_opt_str): > + cmd_str =3D cc.get_dpdk_app_cmd_str(self._app_path, > + eal_opt_str, > + fips_opt_str) > + self.logger.info(cmd_str) > + try: > + out =3D self.dut.send_expect(cmd_str, "#", 600) > + except Exception, ex: > + self.logger.error(ex) > + raise ex > + return out > + > + def compare_resp_file(self,eal_opt_str,fips_opt_str): > + out =3D self._run_fips(eal_opt_str, fips_opt_str) > + check_out =3D out[out.index("Done"):] > + self.verify("Error" not in check_out," req file error") > + rep_list =3D re.findall(r"FIPS/(.*)/req/(.*).req", out) > + > + for alog_name, file_name in rep_list: > + out =3D self.dut.send_expect("diff %s/%s/resp/%s.rsp %s/%s/f= ax/%s.rsp | > grep -v '#' | grep -v '\---'" % ( > + self.FIP_path, alog_name, file_name, self.FIP_path, alog_nam= e, file_name), "#") > + lines =3D re.split('\r\n', out) > + self.verify(len(lines) <=3D 2, "%s.req file comparison > + failed!"%file_name) > + > + def test_fips_aesni_mb_aes(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str,fips_opt_str) > + > + def test_fips_aesni_mb_3des(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str,fips_opt_str) > + > + def test_fips_aesni_mb_hmac(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_aesni_mb_ccm(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_aesni_mb_cmac(self): > + eal_opt_str =3D cc.get_eal_opt_str(self) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_qat_gcm(self): > + eal_opt_str =3D cc.get_eal_opt_str(self,{"vdev":None}) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_qat_aes(self): > + eal_opt_str =3D cc.get_eal_opt_str(self,{"vdev":None}) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_qat_3des(self): > + eal_opt_str =3D cc.get_eal_opt_str(self,{"vdev":None}) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_qat_hmac(self): > + eal_opt_str =3D cc.get_eal_opt_str(self,{"vdev":None}) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_qat_ccm(self): > + eal_opt_str =3D cc.get_eal_opt_str(self,{"vdev":None}) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_qat_cmac(self): > + eal_opt_str =3D cc.get_eal_opt_str(self,{"vdev":None}) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_openssl_gcm(self): > + eal_opt_str =3D cc.get_eal_opt_str(self,{"vdev":"crypto_openssl_= pmd_1"}) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_openssl_aes(self): > + eal_opt_str =3D cc.get_eal_opt_str(self,{"vdev":"crypto_openssl_= pmd_1"}) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_openssl_3des(self): > + eal_opt_str =3D cc.get_eal_opt_str(self,{"vdev":"crypto_openssl_= pmd_1"}) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_openssl_hmac(self): > + eal_opt_str =3D cc.get_eal_opt_str(self,{"vdev":"crypto_openssl_= pmd_1"}) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_openssl_ccm(self): > + eal_opt_str =3D cc.get_eal_opt_str(self,{"vdev":"crypto_openssl_= pmd_1"}) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_aesni_gcm_gcm(self): > + eal_opt_str =3D cc.get_eal_opt_str(self,{"vdev":"crypto_aesni_gc= m_pmd_1"}) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_self_test(self): > + eal_opt_str =3D cc.get_eal_opt_str(self,{"l":None,"n":None,}) > + fips_opt_str =3D self._get_fips_opt_str() > + self.compare_resp_file(eal_opt_str, fips_opt_str) > + > + def test_fips_broken_test(self): > + eal_opt_str =3D cc.get_eal_opt_str(self,{"l":None,"n":None,}) > + fips_opt_str =3D cc.get_opt_str(self, self._default_fips_opts,{"= cryptodev-id":None, > "broken-test-id":15, "broken-test-dir":"dec"}) > + out =3D self._run_fips(eal_opt_str, fips_opt_str) > + self.verify("Failed init" in out, "test Failed!") > -- > 2.17.2