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 211A0A00E6 for ; Fri, 12 Jul 2019 12:34:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CF5481B9E7; Fri, 12 Jul 2019 12:34:08 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id AFDE41B9CD for ; Fri, 12 Jul 2019 12:34:06 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jul 2019 03:34:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,482,1557212400"; d="scan'208";a="193714681" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.240.176.135]) by fmsmga002.fm.intel.com with ESMTP; 12 Jul 2019 03:34:04 -0700 From: "xiao,qimai" To: dts@dpdk.org Cc: "xiao,qimai" Date: Fri, 12 Jul 2019 18:38:46 +0800 Message-Id: <1562927926-60852-1-git-send-email-qimaix.xiao@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1] tests/TestSuite_inline_ipsec:update this case to test dpdk19.08_rc1 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" dpdk 19.08_rc1 add new parameter --mtu to ipsec-secgw, update this case to adapt it. Signed-off-by: xiao,qimai --- tests/TestSuite_inline_ipsec.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tests/TestSuite_inline_ipsec.py b/tests/TestSuite_inline_ipsec.py index 57552c2..4f078c9 100644 --- a/tests/TestSuite_inline_ipsec.py +++ b/tests/TestSuite_inline_ipsec.py @@ -43,7 +43,7 @@ import random from scapy.all import ESP, IP, Ether, sendp, SecurityAssociation from test_case import TestCase -ETHER_STANDARD_MTU = 1518 +ETHER_STANDARD_MTU = 1300 ETHER_JUMBO_FRAME_MTU = 9000 @@ -86,7 +86,7 @@ class TestInlineIpsec(TestCase): self.path = "./examples/ipsec-secgw/build/ipsec-secgw" # add print code in IPSEC app - sedcmd = r"""sed -i -e 's/if (nb_rx > 0)/if (nb_rx > 0) {/g' -e '/\/\* dequeue and process completed crypto-ops \*\//i\\t\t\t}' -e '/process_pkts(qconf, pkts, nb_rx, portid);/i\\t\t\t\tprintf("[debug]receive %hhu packet in rxqueueid=%hhu\\n",nb_rx, queueid);' examples/ipsec-secgw/ipsec-secgw.c""" + sedcmd = r"""sed -i -e 's/if (nb_rx > 0)/if (nb_rx > 0) {/g' -e '/\/\* dequeue and process completed crypto-ops \*\//i\\t\t\t}' -e '/process_pkts(qconf, pkts, nb_rx, portid);/i\\t\t\t\tprintf("[debug]receive %llu packet in rxqueueid=%llu\\n",(unsigned long long)nb_rx, (unsigned long long)queueid);' examples/ipsec-secgw/ipsec-secgw.c""" self.dut.send_expect(sedcmd, "#", 60) # build sample app @@ -201,18 +201,22 @@ class TestInlineIpsec(TestCase): self.tester.destroy_session(session_send) return payload, p.src, p.dst - def Ipsec_Encryption(self, config, file_name, txItf, rxItf, paysize=32, jumboframe=1518, do_encrypt=False, + def Ipsec_Encryption(self, config, file_name, txItf, rxItf, paysize=32, jumboframe=None, do_encrypt=False, verify=True, send_spi=5, receive_spi=1005, count=1, inner_dst='192.168.105.10', sa_src='172.16.1.5', sa_dst='172.16.2.5'): """ verify Ipsec receive package """ - cmd = self.path + " -l 20,21 -w %s -w %s --vdev 'crypto_null' --log-level 8 --socket-mem 1024,1024 -- -p 0xf -P -u 0x2 -j %s --config='%s' -f %s" % ( + if jumboframe is not None: + cmd = self.path + " -l 20,21 -w %s -w %s --vdev 'crypto_null' --log-level 8 --socket-mem 1024,1024 -- -p 0xf -P -u 0x2 -j 9200 --mtu %s --config='%s' -f %s" % ( self.portpci_0, self.portpci_1, jumboframe, config, file_name) + else: + cmd = self.path + " -l 20,21 -w %s -w %s --vdev 'crypto_null' --log-level 8 --socket-mem 1024,1024 -- -p 0xf -P -u 0x2 --config='%s' -f %s" % ( + self.portpci_0, self.portpci_1, config, file_name) + self.dut.send_expect(cmd, "IPSEC", 60) - session_receive = self.tester.create_session( - name='receive_encryption_package') + session_receive = self.tester.create_session(name='receive_encryption_package') sa_gcm = r"sa_gcm=SecurityAssociation(ESP,spi=%s,crypt_algo='AES-GCM',crypt_key='\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3d\xde\xad\xbe\xef',auth_algo='NULL',auth_key=None,tunnel_header=IP(src='172.16.1.5',dst='172.16.2.5'))" % receive_spi session_receive.send_expect("scapy", ">>>", 10) @@ -271,7 +275,7 @@ class TestInlineIpsec(TestCase): test Ipsec Encryption Jumboframe """ config = '(0,0,21),(1,0,21)' - paysize = random.randint(ETHER_STANDARD_MTU, ETHER_JUMBO_FRAME_MTU) + paysize = random.randint(ETHER_STANDARD_MTU+300, ETHER_JUMBO_FRAME_MTU) self.Ipsec_Encryption(config, '/root/dpdk/enc.cfg', self.txItf, self.rxItf, paysize, ETHER_JUMBO_FRAME_MTU) self.dut.send_expect("^C", "#", 5) @@ -303,7 +307,7 @@ class TestInlineIpsec(TestCase): test IPSec Decryption Jumboframe """ config = '(0,0,21),(1,0,21)' - paysize = random.randint(ETHER_STANDARD_MTU, ETHER_JUMBO_FRAME_MTU) + paysize = random.randint(ETHER_STANDARD_MTU+300, ETHER_JUMBO_FRAME_MTU) self.Ipsec_Encryption(config, '/root/dpdk/dec.cfg', self.rxItf, self.txItf, paysize, ETHER_JUMBO_FRAME_MTU, do_encrypt=True, count=2) self.dut.send_expect("^C", "#", 5) @@ -338,8 +342,8 @@ class TestInlineIpsec(TestCase): """ test Ipsec Encryption Decryption """ - cmd = self.path + " -l 20,21 -w %s -w %s --vdev 'crypto_null' --log-level 8 --socket-mem 1024,1 -- -p 0xf -P -u 0x2 -j %s --config='%s' -f %s" % ( - self.portpci_0, self.portpci_1, '1518', '(0,0,21),(1,0,21)', '/root/dpdk/enc_dec.cfg') + cmd = self.path + " -l 20,21 -w %s -w %s --vdev 'crypto_null' --log-level 8 --socket-mem 1024,1 -- -p 0xf -P -u 0x2 --config='%s' -f %s" % ( + self.portpci_0, self.portpci_1, '(0,0,21),(1,0,21)', '/root/dpdk/enc_dec.cfg') self.dut.send_expect(cmd, "IPSEC", 60) session_receive = self.tester.create_session( name='receive_encryption_package') -- 2.17.1