Skip to content

Commit

Permalink
ras/smtstate: Improve check for release number
Browse files Browse the repository at this point in the history
smtstate test fails on release number check due to incorrect
comparison. This prevents the test to run on releases with
two digits.

Use eval function to convert into integer before check.

Signed-off-by: Sachin Sant <[email protected]>
  • Loading branch information
sacsant committed Feb 26, 2024
1 parent 97abe3b commit 27d7ca7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ras/smtstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ def setUp(self):
if "is not SMT capable" in smt_op:
self.cancel("Machine is not SMT capable, skipping the test")
distro_name = self.detected_distro.name
distro_ver = self.detected_distro.version
distro_rel = self.detected_distro.release
distro_ver = eval(self.detected_distro.version)
distro_rel = eval(self.detected_distro.release)
if distro_name == "rhel":
if (distro_ver == "7" or
(distro_ver == "8" and distro_rel < "4")):
if (distro_ver == 7 or
(distro_ver == 8 and distro_rel < 4)):
self.cancel("smtstate tool is supported only after RHEL8.4")
elif distro_name == "SuSE":
if (distro_ver == "12" or (distro_ver == "15" and distro_rel < 3)):
if (distro_ver == 12 or (distro_ver == 15 and distro_rel < 3)):
self.cancel("smtstate tool is supported only after SLES15 SP3")
else:
self.cancel("Test case is supported only on RHEL and SLES")
Expand Down

0 comments on commit 27d7ca7

Please sign in to comment.