Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: client/tests/kvm/tests/nicdriver_unload.py

Issue 6883035: Merge remote branch 'autotest-upstream/master' into autotest-merge (Closed) Base URL: ssh://gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: client/tests/kvm/tests/nicdriver_unload.py
diff --git a/client/tests/kvm/tests/nicdriver_unload.py b/client/tests/kvm/tests/nicdriver_unload.py
index 15a73ce202321a1d292c1f03ed9ca619530c3755..de5fa8bc20975c0e92ed09378c7e6caaf867cd5d 100644
--- a/client/tests/kvm/tests/nicdriver_unload.py
+++ b/client/tests/kvm/tests/nicdriver_unload.py
@@ -26,9 +26,16 @@ def run_nicdriver_unload(test, params, env):
ethname = kvm_test_utils.get_linux_ifname(session_serial,
vm.get_mac_address(0))
- sys_path = "/sys/class/net/%s/device/driver" % (ethname)
- driver = os.path.basename(session_serial.cmd("readlink -e %s" %
- sys_path).strip())
+
+ # get ethernet driver from '/sys' directory.
+ # ethtool can do the same thing and doesn't care about os type.
+ # if we make sure all guests have ethtool, we can make a change here.
+ sys_path = params.get("sys_path") % (ethname)
+
+ # readlink in RHEL4.8 doesn't have '-e' param, should use '-f' in RHEL4.8.
+ readlink_cmd = params.get("readlink_command", "readlink -e")
+ driver = os.path.basename(session_serial.cmd("%s %s" % (readlink_cmd,
+ sys_path)).strip())
logging.info("driver is %s", driver)
try:
@@ -53,4 +60,3 @@ def run_nicdriver_unload(test, params, env):
else:
for thread in threads:
thread.join()
-

Powered by Google App Engine
This is Rietveld 408576698