Go to the documentation of this file.00001
00002
00003 import subprocess, re, sys
00004
00005 def check_pinfo(info, search_key, expected_str):
00006 global ret
00007 tag = re.findall(search_key, info)
00008 if tag :
00009 tag = tag[-1]
00010 else:
00011 tag = "Could nof find " + search_key
00012
00013 print "%s\t\t\t\t\t\t" % (tag),
00014 if tag == expected_str :
00015 print "Ok"
00016 else:
00017 print "False"
00018 ret = False
00019
00020 def qnx_cpu_check() :
00021 global ret
00022
00023 info = subprocess.Popen(["pidin", "info"], stdout=subprocess.PIPE).communicate()[0]
00024
00025
00026
00027
00028
00029 ret = True
00030
00031 print " Check CPU Type .. ",
00032 check_pinfo(info, 'CPU:\S+', "CPU:X86")
00033
00034 print " Check Memory Size .. ",
00035 check_pinfo(info, '(?<=Mb\/)\S+', "3318Mb")
00036
00037 print " Check OS Release .. ",
00038 check_pinfo(info, 'Release:\S+', "Release:6.5.0")
00039
00040 print " Check Number of CPU .. ",
00041 check_pinfo(info, 'Processor\S+:', "Processor2:")
00042
00043 print re.sub('(^|\n)', '\n -', info)
00044
00045 return ret
00046
00047
00048