From 0b683f805f4a853c5a5df75d37ebfe9c3b2c94ba Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Tue, 15 Dec 2020 17:25:08 +0100 Subject: [PATCH] cpu-parse: Move call to cpu-cpuid.py to new script Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- 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