test suite reviews and discussions
 help / color / mirror / Atom feed
From: yufengmx <yufengx.mo@intel.com>
To: dts@dpdk.org
Cc: yufengmx <yufengx.mo@intel.com>
Subject: [dts] [PATCH V1]userspace_ethtool: update automation testing script
Date: Wed,  4 Jan 2017 11:42:10 +0800	[thread overview]
Message-ID: <1483501330-25411-2-git-send-email-yufengx.mo@intel.com> (raw)
In-Reply-To: <1483501330-25411-1-git-send-email-yufengx.mo@intel.com>


fix relative path to absolute path for eeprom checking

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 tests/TestSuite_userspace_ethtool.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_userspace_ethtool.py b/tests/TestSuite_userspace_ethtool.py
index ced7e96..a03d7e0 100644
--- a/tests/TestSuite_userspace_ethtool.py
+++ b/tests/TestSuite_userspace_ethtool.py
@@ -129,23 +129,26 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
             return 1518
 
     def resize_linux_eeprom_file(self, dpdk_eeprom_file, linux_eeprom_file):
-        basePath = os.sep + "root" + self.dut.base_dir[1:] + os.sep
+        if self.dut.base_dir.startswith('~'):
+            basePath = "/root" + self.dut.base_dir[1:]
+        else:
+            basePath = self.dut.base_dir
         with open( basePath + os.sep + dpdk_eeprom_file, 'rb') as fpDpdk:
             dpdk_bytes = fpDpdk.read()
             dpdk_length = len(dpdk_bytes)
 
-        with open( basePath + linux_eeprom_file, 'rb') as fplinux:
+        with open( basePath + os.sep + linux_eeprom_file, 'rb') as fplinux:
             linux_bytes = fplinux.read()
             linux_length = len(linux_bytes)
         
         self.verify(dpdk_length <= linux_length, 
                     "linux ethtool haven't dump out enough data as dpdk ethtool")
 
-        with open( basePath + linux_eeprom_file, 'wb') as fplinux:
+        with open( basePath + os.sep + linux_eeprom_file, 'wb') as fplinux:
             fplinux.write(linux_bytes[:dpdk_length])
 
     def strip_md5(self, filename):
-        md5_info = self.dut.send_expect("md5sum %s" % filename, "# ")
+        md5_info = self.dut.send_expect("md5sum %s" % ( self.dut.base_dir + os.sep + filename), "# ", 30)
         md5_pattern = r"(\w+)  (\w+)"
         m = re.match(md5_pattern, md5_info)
         if m:
-- 
1.9.3

  reply	other threads:[~2017-01-04  3:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04  3:42 yufengmx
2017-01-04  3:42 ` yufengmx [this message]
2017-01-16  2:33   ` Liu, Yong
2017-01-16  2:39     ` Mo, YufengX
2017-01-16  3:08       ` Liu, Yong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1483501330-25411-2-git-send-email-yufengx.mo@intel.com \
    --to=yufengx.mo@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).