[libvirt PATCH 22/29] cpu-parse: Move call to cpu-cpuid.py to new script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 tests/cputestdata/cpu-gather.py | 10 ++++++++++
 tests/cputestdata/cpu-parse.sh  | 10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/cputestdata/cpu-gather.py b/tests/cputestdata/cpu-gather.py
index 2c3f39ab35..373f179c8d 100755
--- a/tests/cputestdata/cpu-gather.py
+++ b/tests/cputestdata/cpu-gather.py
@@ -282,6 +282,16 @@ def parse(args):
     output_xml(data, filename_xml)
     output_json(data, filename_json)
 
+    if not os.path.isfile(filename_json):
+        return
+    if os.path.getsize(filename_json) == 0:
+        return
+
+    output = subprocess.check_output(
+        ["./cpu-cpuid.py", "diff", filename_json],
+        universal_newlines=True)
+    print(output)
+
     os.environ["CPU_GATHER_PY"] = "true"
     os.environ["model"] = data["name"]
     os.environ["fname"] = filename
diff --git a/tests/cputestdata/cpu-parse.sh b/tests/cputestdata/cpu-parse.sh
index aeb6e4e07f..eea15ded2e 100755
--- a/tests/cputestdata/cpu-parse.sh
+++ b/tests/cputestdata/cpu-parse.sh
@@ -6,13 +6,3 @@ if [ -z "${CPU_GATHER_PY}" ]; then
 fi
 
 data=`cat`
-
-if [[ -s $fname.json ]]; then
-    if ! grep -q model-expansion $fname.json; then
-        echo "Missing query-cpu-model-expansion reply in $name.json" >&2
-        exit 1
-    fi
-    $(dirname $0)/cpu-cpuid.py diff $fname.json
-else
-    rm $fname.json
-fi
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux