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 73214A0613 for ; Wed, 25 Sep 2019 07:07:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5CD742BE2; Wed, 25 Sep 2019 07:07:13 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 67C702BAB for ; Wed, 25 Sep 2019 07:07:10 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2019 22:07:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,546,1559545200"; d="scan'208";a="191231263" Received: from dpdk-moyufen06.sh.intel.com ([10.67.116.222]) by orsmga003.jf.intel.com with ESMTP; 24 Sep 2019 22:07:09 -0700 From: yufengmx To: dts@dpdk.org, wenjiex.a.li@intel.com Cc: xueqin.lin@intel.com, yufengmx Date: Wed, 25 Sep 2019 13:07:41 +0800 Message-Id: <20190925050741.44855-2-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190925050741.44855-1-yufengx.mo@intel.com> References: <20190925050741.44855-1-yufengx.mo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V1 1/1] tests/flow_classify: fix check condition logic error 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" fix check condition logic error. missed use local directory check method, change os.path.exists to is_existed_on_crb. Signed-off-by: yufengmx --- tests/TestSuite_flow_classify.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/TestSuite_flow_classify.py b/tests/TestSuite_flow_classify.py index ffa6136..c51b0a2 100644 --- a/tests/TestSuite_flow_classify.py +++ b/tests/TestSuite_flow_classify.py @@ -46,6 +46,16 @@ from settings import HEADER_SIZE class TestFlowClassify(TestCase): + def is_existed_on_crb(self, check_path, crb='dut'): + alt_session = self.dut.alt_session \ + if crb == 'dut' else \ + self.tester.alt_session + alt_session.send_expect("ls %s > /dev/null 2>&1" % check_path, "# ") + cmd = "echo $?" + output = alt_session.send_expect(cmd, "# ") + ret = True if output and output.strip() == "0" else False + return ret + def get_cores_mask(self, config='all'): sockets = [self.dut.get_numa_id(index) for index in self.dut_ports] socket_count = Counter(sockets) @@ -291,7 +301,7 @@ class TestFlowClassify(TestCase): 'examples', 'flow_classify', 'ipv4_rules_file.txt']) - if not os.path.exists(rule_config): + if not self.is_existed_on_crb(rule_config): raise VerifyFailure("rules file doesn't existed") core = "1S/1C/1T" option = r" -c {0} -n 4 --file-prefix=test -- --rule_ipv4={1}".format( @@ -390,7 +400,7 @@ class TestFlowClassify(TestCase): elif flow_type == 'single_stream': if rule_priority is None and captured_pkts != 0: msg = "invalid stream hasn't been filtered out" - elif rule_priority is None and captured_pkts != total_packets: + elif rule_priority and captured_pkts != total_packets: msg = "expect {0} ".format(total_packets) + \ "captured {0}".format(captured_pkts) else: -- 2.21.0