Skip to content

Commit

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

Handling both http and https repository path
  • Loading branch information
abdhaleegit authored Aug 20, 2024
2 parents 74828d2 + cf55cca commit a413979
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions io/net/infiniband/mofed_install_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

import os
import re
import urllib.request
import ssl
from avocado import Test
from avocado.utils import process, distro
from avocado.utils.software_manager.manager import SoftwareManager
Expand Down Expand Up @@ -57,10 +59,13 @@ def setUp(self):
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)
scontext = ssl.SSLContext(ssl.PROTOCOL_TLS)
scontext.verify_mode = ssl.VerifyMode.CERT_NONE
response = urllib.request.urlopen(
self.iso_location, context=scontext)
temp_string = response.read()
matching_mofed_versions = re.findall(
r"(?<=\>)MLNX_OFED_LINUX-\w*[.]\w*[-]\w*[.]\w*[.]\w*[.]\w*[-]\w*[-]\w*[.]\w*", str(temp_string))
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
Expand All @@ -72,10 +77,10 @@ def setUp(self):
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)
response = urllib.request.urlopen(self.iso_location)
temp_string = response.read()
matching_mofed_versions = re.findall(
r"(?<=\>)MLNX_OFED_LINUX-\w*[.]\w*[-]\w*[.]\w*[.]\w*[.]\w*[-]\w*[.]\w*[-]\w*[.]\w*", str(temp_string))
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
Expand Down

0 comments on commit a413979

Please sign in to comment.