rteval: Fix the unit test in osinfo
PATCH 1/1 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 <[email protected]>
--- rteval/sysinfo/osinfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rteval/sysinfo/osinfo.py +1 -1
@@ -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]:
Signature · 1 line
2.40.1