Files
xen/tools/xm-test/tests/info/02_info_compiledata_pos.py
T
kaf24@firebug.cl.cam.ac.uk 3d8026009b Add XENVER_pagesize hypercall.
Make xen pagesize available through xm info and sysfs.
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
2006-06-27 10:44:33 +01:00

45 lines
1.0 KiB
Python

#!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Dan Smith <danms@us.ibm.com>
import re;
from XmTestLib import *
status, output = traceCommand("xm info")
output = re.sub(" +", " ", output)
lines = output.split("\n")
map = {}
for line in lines:
pieces = line.split(" : ", 1)
if len(pieces) < 2:
FAIL("Found invalid line: [%s]" % line)
else:
map[pieces[0]] = pieces[1]
for field in ["cores_per_socket", "threads_per_core", "cpu_mhz",
"total_memory", "free_memory", "xen_major", "xen_minor",
"xen_pagesize"]:
val = map[field]
if not val.isdigit():
FAIL("Numeric field %s not all-numbers: %s" % (field, val))
# Check cc_compiler
if not re.match("gcc version", map["cc_compiler"]):
FAIL("Bad cc_compiler field: %s" % map["cc_compiler"])
# Check cc_compile_by
if not re.match("[A-z0-9_]+", map["cc_compile_by"]):
FAIL("Bad cc_compile_by field: %s" % map["cc_compile_by"])
# Check cc_compile_domain
# --- What should it look like?