⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 02_info_compiledata_pos.py

📁 xen虚拟机源代码安装包
💻 PY
字号:
#!/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) > 1:        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_compilerif not re.match("gcc version", map["cc_compiler"]):    FAIL("Bad cc_compiler field: %s" % map["cc_compiler"])# Check cc_compile_byif 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?

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -