Last change
on this file since 34 was
34,
checked in by hartmans, 18 years ago
|
Add xen and xen-common
|
-
Property svn:mime-type set to
text/script
|
File size:
1.0 KB
|
Line | |
---|
1 | #!/usr/bin/python |
---|
2 | |
---|
3 | # Copyright (C) International Business Machines Corp., 2005 |
---|
4 | # Author: Dan Smith <danms@us.ibm.com> |
---|
5 | |
---|
6 | import re; |
---|
7 | |
---|
8 | from XmTestLib import * |
---|
9 | |
---|
10 | status, output = traceCommand("xm info") |
---|
11 | |
---|
12 | output = re.sub(" +", " ", output) |
---|
13 | |
---|
14 | lines = output.split("\n") |
---|
15 | |
---|
16 | map = {} |
---|
17 | |
---|
18 | for line in lines: |
---|
19 | pieces = line.split(" : ", 1) |
---|
20 | |
---|
21 | if len(pieces) < 2: |
---|
22 | FAIL("Found invalid line: [%s]" % line) |
---|
23 | else: |
---|
24 | map[pieces[0]] = pieces[1] |
---|
25 | |
---|
26 | for field in ["cores_per_socket", "threads_per_core", "cpu_mhz", |
---|
27 | "total_memory", "free_memory", "xen_major", "xen_minor", |
---|
28 | "xen_pagesize"]: |
---|
29 | val = map[field] |
---|
30 | if not val.isdigit(): |
---|
31 | FAIL("Numeric field %s not all-numbers: %s" % (field, val)) |
---|
32 | |
---|
33 | # Check cc_compiler |
---|
34 | if not re.match("gcc version", map["cc_compiler"]): |
---|
35 | FAIL("Bad cc_compiler field: %s" % map["cc_compiler"]) |
---|
36 | |
---|
37 | # Check cc_compile_by |
---|
38 | if not re.match("[A-z0-9_]+", map["cc_compile_by"]): |
---|
39 | FAIL("Bad cc_compile_by field: %s" % map["cc_compile_by"]) |
---|
40 | |
---|
41 | # Check cc_compile_domain |
---|
42 | # --- What should it look like? |
---|
43 | |
---|
44 | |
---|
Note: See
TracBrowser
for help on using the repository browser.