提交 78b148c3 编写于 作者: J Jiri Denemark

cputest: Adapt scripts to split cpu_map

The tests/cputestdata/cpu-parse.sh script has been broken since the
cpu_map.xml file was split into several XMLs.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 cb6a4636
...@@ -301,15 +301,13 @@ def parseFeature(data): ...@@ -301,15 +301,13 @@ def parseFeature(data):
def parseMap(): def parseMap():
path = os.path.dirname(sys.argv[0]) path = os.path.dirname(sys.argv[0])
path = os.path.join(path, "..", "..", "src", "cpu", "cpu_map.xml") path = os.path.join(path, "..", "..", "src", "cpu_map", "x86_features.xml")
with open(path, "r") as f: with open(path, "r") as f:
data = xmltodict.parse(f) data = xmltodict.parse(f)
cpuMap = {} cpuMap = {}
for arch in data["cpus"]["arch"]: for feature in data["cpus"]["feature"]:
if arch["@name"] == "x86": cpuMap[feature["@name"]] = parseFeature(feature["cpuid"])
for feature in arch["feature"]:
cpuMap[feature["@name"]] = parseFeature(feature["cpuid"])
return cpuMap return cpuMap
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册