Skip to content

Commit

Permalink
Merge pull request avocado-framework-tests#2800 from PavamanSubramani…
Browse files Browse the repository at this point in the history
…yam/mofed_full_iso_link

Adding support for full iso path
  • Loading branch information
abdhaleegit authored Apr 19, 2024
2 parents 1c89f50 + e67d176 commit 8e2d9cd
Showing 1 changed file with 37 additions and 32 deletions.
69 changes: 37 additions & 32 deletions io/net/infiniband/mofed_install_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,36 +49,42 @@ def setUp(self):
self.uname = linux_modules.platform.uname()[2]
kernel_ver = "kernel-devel-%s" % self.uname

if detected_distro.name == "SuSE":
host_distro_pattern = "sles%ssp%s" % (
detected_distro.version, detected_distro.release)
patterns = [host_distro_pattern]
for pattern in patterns:
temp_string = process.getoutput(
"curl --silent %s" % (self.iso_location), verbose=False, shell=True, ignore_status=True)
matching_mofed_versions = re.findall(
r"(?<=\>)MLNX_OFED_LINUX-\w*[.]\w*[-]\w*[.]\w*[.]\w*[.]\w*[-]\w*[-]\w*[.]\w*", str(temp_string))
distro_specific_mofed_versions = [host_distro_pattern
for host_distro_pattern
in matching_mofed_versions
if pattern in host_distro_pattern]
distro_specific_mofed_versions.sort(reverse=True)
self.iso_name = distro_specific_mofed_versions[0]
elif detected_distro.name in ['rhel', 'fedora', 'redhat']:
host_distro_pattern = "%s%s.%s" % (
detected_distro.name, detected_distro.version, detected_distro.release)
patterns = [host_distro_pattern]
for pattern in patterns:
temp_string = process.getoutput(
"curl --silent %s" % (self.iso_location), verbose=False, shell=True, ignore_status=True)
matching_mofed_versions = re.findall(
r"(?<=\>)MLNX_OFED_LINUX-\w*[.]\w*[-]\w*[.]\w*[.]\w*[.]\w*[-]\w*[.]\w*[-]\w*[.]\w*", str(temp_string))
distro_specific_mofed_versions = [host_distro_pattern
for host_distro_pattern
in matching_mofed_versions
if pattern in host_distro_pattern]
distro_specific_mofed_versions.sort(reverse=True)
self.iso_name = distro_specific_mofed_versions[0]
if '.iso' in self.iso_location:
self.iso = self.fetch_asset(self.iso_location, expire='10d')
else:
if detected_distro.name == "SuSE":
host_distro_pattern = "sles%ssp%s" % (
detected_distro.version, detected_distro.release)
patterns = [host_distro_pattern]
for pattern in patterns:
temp_string = process.getoutput(
"curl --silent %s" % (self.iso_location), verbose=False, shell=True, ignore_status=True)
matching_mofed_versions = re.findall(
r"(?<=\>)MLNX_OFED_LINUX-\w*[.]\w*[-]\w*[.]\w*[.]\w*[.]\w*[-]\w*[-]\w*[.]\w*", str(temp_string))
distro_specific_mofed_versions = [host_distro_pattern
for host_distro_pattern
in matching_mofed_versions
if pattern in host_distro_pattern]
distro_specific_mofed_versions.sort(reverse=True)
self.iso_name = distro_specific_mofed_versions[0]
elif detected_distro.name in ['rhel', 'fedora', 'redhat']:
host_distro_pattern = "%s%s.%s" % (
detected_distro.name, detected_distro.version, detected_distro.release)
patterns = [host_distro_pattern]
for pattern in patterns:
temp_string = process.getoutput(
"curl --silent %s" % (self.iso_location), verbose=False, shell=True, ignore_status=True)
matching_mofed_versions = re.findall(
r"(?<=\>)MLNX_OFED_LINUX-\w*[.]\w*[-]\w*[.]\w*[.]\w*[.]\w*[-]\w*[.]\w*[-]\w*[.]\w*", str(temp_string))
distro_specific_mofed_versions = [host_distro_pattern
for host_distro_pattern
in matching_mofed_versions
if pattern in host_distro_pattern]
distro_specific_mofed_versions.sort(reverse=True)
self.iso_name = distro_specific_mofed_versions[0]

self.iso = "%s%s" % (self.iso_location, self.iso_name)
self.iso = self.fetch_asset(self.iso, expire='10d')

smm = SoftwareManager()
if detected_distro.name == "SuSE":
Expand All @@ -94,8 +100,7 @@ def setUp(self):
for pkg in pkgs:
if not smm.check_installed(pkg) and not smm.install(pkg):
self.cancel("Not able to install %s" % pkg)
self.iso = "%s%s" % (self.iso_location, self.iso_name)
self.iso = self.fetch_asset(self.iso, expire='10d')

cmd = "mount -o loop %s %s" % (self.iso, self.workdir)
process.run(cmd, shell=True)
self.pwd = os.getcwd()
Expand Down

0 comments on commit 8e2d9cd

Please sign in to comment.