debuggers.hg

view tools/xm-test/tests/info/02_info_compiledata_pos.py @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children
line source
1 #!/usr/bin/python
3 # Copyright (C) International Business Machines Corp., 2005
4 # Author: Dan Smith <danms@us.ibm.com>
6 import re;
8 from XmTestLib import *
10 status, output = traceCommand("xm info")
12 output = re.sub(" +", " ", output)
14 lines = output.split("\n")
16 map = {}
18 for line in lines:
19 pieces = line.split(" : ", 1)
21 if len(pieces) > 1:
22 map[pieces[0]] = pieces[1]
24 for field in ["cores_per_socket", "threads_per_core", "cpu_mhz",
25 "total_memory", "free_memory", "xen_major", "xen_minor",
26 "xen_pagesize"]:
27 val = map[field]
28 if not val.isdigit():
29 FAIL("Numeric field %s not all-numbers: %s" % (field, val))
31 # Check cc_compiler
32 if not re.match("gcc version", map["cc_compiler"]):
33 FAIL("Bad cc_compiler field: %s" % map["cc_compiler"])
35 # Check cc_compile_by
36 if not re.match("[A-z0-9_]+", map["cc_compile_by"]):
37 FAIL("Bad cc_compile_by field: %s" % map["cc_compile_by"])
39 # Check cc_compile_domain
40 # --- What should it look like?