From 4b3acf7f8a66928bd1aa3cf10879d925cdeadbb9 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 26 Jun 2018 09:48:50 +0200 Subject: [PATCH 81/89] qemu-iotests: Rewrite 212 for blockdev-create job RH-Author: Kevin Wolf Message-id: <20180626094856.6924-68-kwolf@redhat.com> Patchwork-id: 81100 O-Subject: [RHV-7.6 qemu-kvm-rhev PATCH v2 67/73] qemu-iotests: Rewrite 212 for blockdev-create job Bugzilla: 1513543 RH-Acked-by: Jeffrey Cody RH-Acked-by: Max Reitz RH-Acked-by: Fam Zheng This rewrites the test case 212 to work with the new x-blockdev-create job rather than the old synchronous version of the command. All of the test cases stay the same as before, but in order to be able to implement proper job handling, the test case is rewritten in Python. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz (cherry picked from commit 2d7abfbeb75fbe624a8b3a2ff253dbf5674ccb65) Signed-off-by: Kevin Wolf Signed-off-by: Miroslav Rezanina --- tests/qemu-iotests/212 | 483 +++++++++++++++++---------------------------- tests/qemu-iotests/212.out | 191 +++++++++++------- tests/qemu-iotests/group | 2 +- 3 files changed, 295 insertions(+), 381 deletions(-) diff --git a/tests/qemu-iotests/212 b/tests/qemu-iotests/212 index e5a1ba7..03cf41d 100755 --- a/tests/qemu-iotests/212 +++ b/tests/qemu-iotests/212 @@ -1,9 +1,11 @@ -#!/bin/bash +#!/usr/bin/env python # # Test parallels and file image creation # # Copyright (C) 2018 Red Hat, Inc. # +# Creator/Owner: Kevin Wolf +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -18,309 +20,176 @@ # along with this program. If not, see . # -# creator -owner=kwolf@redhat.com - -seq=`basename $0` -echo "QA output created by $seq" - -here=`pwd` -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common.rc -. ./common.filter - -_supported_fmt parallels -_supported_proto file -_supported_os Linux - -function do_run_qemu() -{ - echo Testing: "$@" - $QEMU -nographic -qmp stdio -serial none "$@" - echo -} - -function run_qemu() -{ - do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp \ - | _filter_qemu | _filter_imgfmt \ - | _filter_actual_image_size -} - -echo -echo "=== Successful image creation (defaults) ===" -echo - -size=$((128 * 1024 * 1024)) - -run_qemu <