Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions workload/htx_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,21 @@ def install_latest_htx_rpm(self):
htx_rpm for htx_rpm in matching_htx_versions
if distro_pattern in htx_rpm]
distro_specific_htx_versions.sort(reverse=True)
self.latest_htx_rpm = distro_specific_htx_versions[0]

if process.system('rpm -ivh --nodeps %s%s '
'--force' % (self.rpm_link, self.latest_htx_rpm),
htx_latest_rpm = distro_specific_htx_versions[0]
self.latest_htx_rpm = htx_latest_rpm
tmp_dir = "/tmp/" + htx_latest_rpm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the variable is slightly confusing, can you please rename it like

tmp_htx_rpm

cmd = "curl -k %s/%s -o %s" % (self.rpm_link, self.latest_htx_rpm,
tmp_dir)
if process.system(cmd,
shell=True, ignore_status=True):
self.cancel("rpm download failed")
cmd = "rpm -ivh %s" % (tmp_dir)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even have --nodeps in safer side

if process.system(cmd,
shell=True, ignore_status=True):
self.cancel("Installation of rpm failed")
self.cancel("rpm installation failed")
cmd = "rm -rf %s" % (tmp_dir)
# Remove the downloaded HTX rpm from /tmp directory
process.run(cmd)

def setUp(self):
"""
Expand Down Expand Up @@ -164,7 +173,8 @@ def setup_htx(self):
# Kill existing HTXD process if running
htxd_pid = process.getoutput("pgrep -f htxd")
if htxd_pid:
self.log.info("HTXD is already running with PID: %s. Killing it.", htxd_pid)
self.log.info(
"HTXD is already running with PID: %s. Killing it.", htxd_pid)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change ?

process.run("pkill -f htxd", ignore_status=True)
time.sleep(10)
process.run('/usr/lpp/htx/etc/scripts/htxd_run')
Expand Down
Loading