[PATCH] rteval: Fix the unit test in osinfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 rteval/sysinfo/osinfo.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rteval/sysinfo/osinfo.py b/rteval/sysinfo/osinfo.py
index 7b7bfe9ce4ec..ead5e3939cfa 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]:
-- 
2.40.1




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux