aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Kacur <jkacur@redhat.com>2023-05-26 14:34:39 -0400
committerJohn Kacur <jkacur@redhat.com>2023-05-26 14:41:33 -0400
commitdbd2b595ba75dc1b2bc047cd3ac6047f16460e08 (patch)
tree68ea435805885f12990a03372f98d4a73243ee3f
parent4ab5a1ba824e6e37c1b440640819444e1f512aeb (diff)
downloadrteval-dbd2b595ba75dc1b2bc047cd3ac6047f16460e08.tar.gz
rteval: Fix the unit test in osinfo
Fix the unit test in osinfo The unit test will fail if /var/log/dmesg doesn't exist. However, the copy_dmesg method in the OSInfo Class will just return if the file doesn't exist. Fix the unit test by mimicing this behaviour by continuing if the /var/log/dmesg doesn't exist. Signed-off-by: John Kacur <jkacur@redhat.com>
-rw-r--r--rteval/sysinfo/osinfo.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/rteval/sysinfo/osinfo.py b/rteval/sysinfo/osinfo.py
index 7b7bfe9..ead5e39 100644
--- a/rteval/sysinfo/osinfo.py
+++ b/rteval/sysinfo/osinfo.py
@@ -122,7 +122,7 @@ def unit_test(rootdir):
print("Testing OSInfo::copy_dmesg('/tmp'): ", end=' ')
osi.copy_dmesg('/tmp')
- if os.path.isfile("/tmp/dmesg"):
+ if os.path.isfile("/tmp/dmesg") and os.path.isfile("/var/log/dmesg"):
md5orig = subprocess.check_output(("md5sum", "/var/log/dmesg"))
md5copy = subprocess.check_output(("md5sum", "/tmp/dmesg"))
if md5orig.split(" ")[0] == md5copy.split(" ")[0]: