@@ -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:
@@ -1009,6 +1009,9 @@ variants:
file_transfer:
tmp_dir = /tmp/
clean_cmd = rm -f
+ nicdriver_unload:
+ readlink_command = readlink -e
+ sys_path = "/sys/class/net/%s/device/driver"
variants:
- Fedora:
@@ -1602,6 +1605,9 @@ variants:
cdrom_cd1 = isos/linux/RHEL-4.8-i386-DVD.iso
md5sum_cd1 = b024f0af5079539d3ef51f71fed0b194
md5sum_1m_cd1 = 969c197402b9058f28a278c1f807d15b
+ nicdriver_unload:
+ readlink_command = readlink -f
+ sys_path = "/sys/class/net/%s/driver"
- 4.8.x86_64:
@@ -1617,6 +1623,9 @@ variants:
cdrom_cd1 = isos/linux/RHEL-4.8-x86_64-DVD.iso
md5sum_cd1 = 696bc877b0200cc942626673fcc3fc09
md5sum_1m_cd1 = b11ac0ef7fd345ad712966972db63886
+ nicdriver_unload:
+ readlink_command = readlink -f
+ sys_path = "/sys/class/net/%s/driver"
- 5.3.i386: