From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 96C8CA00E6 for ; Fri, 17 May 2019 09:14:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6639E375B; Fri, 17 May 2019 09:14:12 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 7113C2BD8 for ; Fri, 17 May 2019 09:14:10 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 May 2019 00:14:09 -0700 X-ExtLoop1: 1 Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.240.176.135]) by fmsmga001.fm.intel.com with ESMTP; 17 May 2019 00:14:08 -0700 From: Peng Yuan To: dts@dpdk.org Cc: Peng Yuan Date: Fri, 17 May 2019 15:18:30 +0800 Message-Id: <1558077510-53389-1-git-send-email-yuan.peng@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH]tests: correct parameters setting 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" Correct proto and ttl settings. Signed-off-by: Peng Yuan diff --git a/tests/TestSuite_generic_flow_api.py b/tests/TestSuite_generic_flow_api.py index af27477..d11c97d 100644 --- a/tests/TestSuite_generic_flow_api.py +++ b/tests/TestSuite_generic_flow_api.py @@ -61,9 +61,12 @@ MAX_VLAN = 4095 MAX_QUEUE = 15 MAX_VFQUEUE = 3 MAX_PORT = 65535 -MAX_PROTO = 133 MAX_TTL = 255 MAX_TOS = 255 +TCP_PROTO = 6 +UDP_PROTO = 17 +SCTP_PROTO = 132 +RESERVED_PROTO = 255 class TestGeneric_flow_api(TestCase): @@ -422,17 +425,14 @@ class TestGeneric_flow_api(TestCase): pkt += ", src='%s'" % sip if 'proto' in flows: if "udp" in flows: - proto = 17 - extrapacket['proto'] = '17' + proto = UDP_PROTO elif "tcp" in flows: - proto = 6 - extrapacket['proto'] = '6' + proto = TCP_PROTO elif "sctp" in flows: - proto = 132 - extrapacket['proto'] = '132' + proto = SCTP_PROTO else: - proto = self.generate_random_int(0, MAX_PROTO) - extrapacket['proto'] = str(proto) + proto = RESERVED_PROTO + extrapacket['proto'] = str(proto) flow_str += "proto is %d " % proto if 'sip' in flows or 'dip' in flows: pkt += ", proto=%d" % proto @@ -445,7 +445,7 @@ class TestGeneric_flow_api(TestCase): pkt += ", tos=%d" % tos extrapacket['tos'] = tos if 'ttl' in flows: - ttl = self.generate_random_int(0, MAX_TTL) + ttl = self.generate_random_int(1, MAX_TTL) flow_str += "ttl is %d " % ttl pkt += ", ttl=%d" % ttl extrapacket['ttl'] = ttl @@ -464,17 +464,14 @@ class TestGeneric_flow_api(TestCase): pkt += "/IPv6(src='%s', dst='%s'" % (sip, dip) if 'proto' in flows: if "udp" in flows: - proto = 17 - extrapacket['proto'] = '17' + proto = UDP_PROTO elif "tcp" in flows: - proto = 6 - extrapacket['proto'] = '6' + proto = TCP_PROTO elif "sctp" in flows: - proto = 132 - extrapacket['proto'] = '132' + proto = SCTP_PROTO else: - proto = self.generate_random_int(0, MAX_PROTO) - extrapacket['proto'] = str(proto) + proto = RESERVED_PROTO + extrapacket['proto'] = str(proto) flow_str += "proto is %d " % proto pkt += ", nh=%d" % proto if 'tc' in flows: @@ -483,13 +480,13 @@ class TestGeneric_flow_api(TestCase): pkt += ", tc=%d" % tc extrapacket['tos'] = str(tc) if 'hop' in flows: - hop = self.generate_random_int(0, 255) + hop = self.generate_random_int(1, 255) flow_str += "hop is %d " % hop pkt += ", hlim=%d" % hop extrapacket['ttl'] = str(hop) if 'sctp' in flows: - pkt += ", nh=132" - extrapacket['proto'] = '132' + pkt += ", nh=%d" % SCTP_PROTO + extrapacket['proto'] = str(SCTP_PROTO) pkt += ")" elif flow_type == "tcp": flow_str += "/ tcp " -- 2.14.3