Blame SOURCES/kvm-qemu-iotests-Rewrite-207-for-blockdev-create-job.patch

357786
From 6253a26a4ec481dd306e3bf8dc5991687d00d50b Mon Sep 17 00:00:00 2001
357786
From: Kevin Wolf <kwolf@redhat.com>
357786
Date: Tue, 26 Jun 2018 09:48:47 +0200
357786
Subject: [PATCH 78/89] qemu-iotests: Rewrite 207 for blockdev-create job
357786
357786
RH-Author: Kevin Wolf <kwolf@redhat.com>
357786
Message-id: <20180626094856.6924-65-kwolf@redhat.com>
357786
Patchwork-id: 81083
357786
O-Subject: [RHV-7.6 qemu-kvm-rhev PATCH v2 64/73] qemu-iotests: Rewrite 207 for blockdev-create job
357786
Bugzilla: 1513543
357786
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
357786
RH-Acked-by: Max Reitz <mreitz@redhat.com>
357786
RH-Acked-by: Fam Zheng <famz@redhat.com>
357786
357786
This rewrites the test case 207 to work with the new x-blockdev-create
357786
job rather than the old synchronous version of the command.
357786
357786
Most of the test cases stay the same as before (the exception being some
357786
improved 'size' options that allow distinguishing which command created
357786
the image), but in order to be able to implement proper job handling,
357786
the test case is rewritten in Python.
357786
357786
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
357786
Reviewed-by: Max Reitz <mreitz@redhat.com>
357786
(cherry picked from commit 00af19359e8d77e53a09de9a5d3ed6f6e149e0d2)
357786
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
357786
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
357786
---
357786
 tests/qemu-iotests/207     | 440 ++++++++++++++++++++-------------------------
357786
 tests/qemu-iotests/207.out | 107 +++++------
357786
 tests/qemu-iotests/group   |   6 +-
357786
 3 files changed, 257 insertions(+), 296 deletions(-)
357786
357786
diff --git a/tests/qemu-iotests/207 b/tests/qemu-iotests/207
357786
index f5c7785..b595c92 100755
357786
--- a/tests/qemu-iotests/207
357786
+++ b/tests/qemu-iotests/207
357786
@@ -1,9 +1,11 @@
357786
-#!/bin/bash
357786
+#!/usr/bin/env python
357786
 #
357786
 # Test ssh image creation
357786
 #
357786
 # Copyright (C) 2018 Red Hat, Inc.
357786
 #
357786
+# Creator/Owner: Kevin Wolf <kwolf@redhat.com>
357786
+#
357786
 # This program is free software; you can redistribute it and/or modify
357786
 # it under the terms of the GNU General Public License as published by
357786
 # the Free Software Foundation; either version 2 of the License, or
357786
@@ -18,244 +20,198 @@
357786
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
357786
 #
357786
 
357786
-# creator
357786
-owner=kwolf@redhat.com
357786
-
357786
-seq=`basename $0`
357786
-echo "QA output created by $seq"
357786
-
357786
-here=`pwd`
357786
-status=1	# failure is the default!
357786
-
357786
-# get standard environment, filters and checks
357786
-. ./common.rc
357786
-. ./common.filter
357786
-
357786
-_supported_fmt raw
357786
-_supported_proto ssh
357786
-_supported_os Linux
357786
-
357786
-function do_run_qemu()
357786
-{
357786
-    echo Testing: "$@"
357786
-    $QEMU -nographic -qmp stdio -serial none "$@"
357786
-    echo
357786
-}
357786
-
357786
-function run_qemu()
357786
-{
357786
-    do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp \
357786
-                          | _filter_qemu | _filter_imgfmt \
357786
-                          | _filter_actual_image_size
357786
-}
357786
-
357786
-echo
357786
-echo "=== Successful image creation (defaults) ==="
357786
-echo
357786
-
357786
-run_qemu <
357786
-{ "execute": "qmp_capabilities" }
357786
-{ "execute": "x-blockdev-create",
357786
-  "arguments": {
357786
-      "driver": "ssh",
357786
-      "location": {
357786
-          "path": "$TEST_IMG_FILE",
357786
-          "server": {
357786
-              "host": "127.0.0.1",
357786
-              "port": "22"
357786
-          }
357786
-      },
357786
-      "size": 4194304
357786
-  }
357786
-}
357786
-{ "execute": "quit" }
357786
-EOF
357786
-
357786
-_img_info | _filter_img_info
357786
-echo
357786
-TEST_IMG=$TEST_IMG_FILE _img_info | _filter_img_info
357786
-
357786
-echo
357786
-echo "=== Test host-key-check options ==="
357786
-echo
357786
-
357786
-run_qemu <
357786
-{ "execute": "qmp_capabilities" }
357786
-{ "execute": "x-blockdev-create",
357786
-  "arguments": {
357786
-      "driver": "ssh",
357786
-      "location": {
357786
-          "path": "$TEST_IMG_FILE",
357786
-          "server": {
357786
-              "host": "127.0.0.1",
357786
-              "port": "22"
357786
-          },
357786
-          "host-key-check": {
357786
-              "mode": "none"
357786
-          }
357786
-      },
357786
-      "size": 8388608
357786
-  }
357786
-}
357786
-{ "execute": "quit" }
357786
-EOF
357786
-
357786
-_img_info | _filter_img_info
357786
-
357786
-run_qemu <
357786
-{ "execute": "qmp_capabilities" }
357786
-{ "execute": "x-blockdev-create",
357786
-  "arguments": {
357786
-      "driver": "ssh",
357786
-      "location": {
357786
-          "path": "$TEST_IMG_FILE",
357786
-          "server": {
357786
-              "host": "127.0.0.1",
357786
-              "port": "22"
357786
-          },
357786
-          "host-key-check": {
357786
-              "mode": "known_hosts"
357786
-          }
357786
-      },
357786
-      "size": 4194304
357786
-  }
357786
-}
357786
-{ "execute": "quit" }
357786
-EOF
357786
-
357786
-_img_info | _filter_img_info
357786
-
357786
-
357786
-key=$(ssh-keyscan -t rsa 127.0.0.1 2>/dev/null | grep -v "\\^#" |
357786
-      cut -d" " -f3 | base64 -d | md5sum -b | cut -d" " -f1)
357786
-
357786
-run_qemu <
357786
-{ "execute": "qmp_capabilities" }
357786
-{ "execute": "x-blockdev-create",
357786
-  "arguments": {
357786
-      "driver": "ssh",
357786
-      "location": {
357786
-          "path": "$TEST_IMG_FILE",
357786
-          "server": {
357786
-              "host": "127.0.0.1",
357786
-              "port": "22"
357786
-          },
357786
-          "host-key-check": {
357786
-              "mode": "hash",
357786
-              "type": "md5",
357786
-              "hash": "wrong"
357786
-          }
357786
-      },
357786
-      "size": 8388608
357786
-  }
357786
-}
357786
-{ "execute": "x-blockdev-create",
357786
-  "arguments": {
357786
-      "driver": "ssh",
357786
-      "location": {
357786
-          "path": "$TEST_IMG_FILE",
357786
-          "server": {
357786
-              "host": "127.0.0.1",
357786
-              "port": "22"
357786
-          },
357786
-          "host-key-check": {
357786
-              "mode": "hash",
357786
-              "type": "md5",
357786
-              "hash": "$key"
357786
-          }
357786
-      },
357786
-      "size": 8388608
357786
-  }
357786
-}
357786
-{ "execute": "quit" }
357786
-EOF
357786
-
357786
-_img_info | _filter_img_info
357786
-
357786
-
357786
-key=$(ssh-keyscan -t rsa 127.0.0.1 2>/dev/null | grep -v "\\^#" |
357786
-      cut -d" " -f3 | base64 -d | sha1sum -b | cut -d" " -f1)
357786
-
357786
-run_qemu <
357786
-{ "execute": "qmp_capabilities" }
357786
-{ "execute": "x-blockdev-create",
357786
-  "arguments": {
357786
-      "driver": "ssh",
357786
-      "location": {
357786
-          "path": "$TEST_IMG_FILE",
357786
-          "server": {
357786
-              "host": "127.0.0.1",
357786
-              "port": "22"
357786
-          },
357786
-          "host-key-check": {
357786
-              "mode": "hash",
357786
-              "type": "sha1",
357786
-              "hash": "wrong"
357786
-          }
357786
-      },
357786
-      "size": 4194304
357786
-  }
357786
-}
357786
-{ "execute": "x-blockdev-create",
357786
-  "arguments": {
357786
-      "driver": "ssh",
357786
-      "location": {
357786
-          "path": "$TEST_IMG_FILE",
357786
-          "server": {
357786
-              "host": "127.0.0.1",
357786
-              "port": "22"
357786
-          },
357786
-          "host-key-check": {
357786
-              "mode": "hash",
357786
-              "type": "sha1",
357786
-              "hash": "$key"
357786
-          }
357786
-      },
357786
-      "size": 4194304
357786
-  }
357786
-}
357786
-{ "execute": "quit" }
357786
-EOF
357786
-
357786
-_img_info | _filter_img_info
357786
-
357786
-echo
357786
-echo "=== Invalid path and user ==="
357786
-echo
357786
-
357786
-run_qemu <
357786
-{ "execute": "qmp_capabilities" }
357786
-{ "execute": "x-blockdev-create",
357786
-  "arguments": {
357786
-      "driver": "ssh",
357786
-      "location": {
357786
-          "path": "/this/is/not/an/existing/path",
357786
-          "server": {
357786
-              "host": "127.0.0.1",
357786
-              "port": "22"
357786
-          }
357786
-      },
357786
-      "size": 4194304
357786
-  }
357786
-}
357786
-{ "execute": "x-blockdev-create",
357786
-  "arguments": {
357786
-      "driver": "ssh",
357786
-      "location": {
357786
-          "path": "$TEST_IMG_FILE",
357786
-          "user": "invalid user",
357786
-          "server": {
357786
-              "host": "127.0.0.1",
357786
-              "port": "22"
357786
-          }
357786
-      },
357786
-      "size": 4194304
357786
-  }
357786
-}
357786
-{ "execute": "quit" }
357786
-EOF
357786
-
357786
-# success, all done
357786
-echo "*** done"
357786
-rm -f $seq.full
357786
-status=0
357786
+import iotests
357786
+import subprocess
357786
+import re
357786
+
357786
+iotests.verify_image_format(supported_fmts=['raw'])
357786
+iotests.verify_protocol(supported=['ssh'])
357786
+
357786
+def filter_hash(msg):
357786
+    return re.sub("'hash': '[0-9a-f]+'", "'hash': HASH", msg)
357786
+
357786
+def blockdev_create(vm, options):
357786
+    result = vm.qmp_log('x-blockdev-create', job_id='job0', options=options,
357786
+                        filters=[iotests.filter_testfiles, filter_hash])
357786
+
357786
+    if 'return' in result:
357786
+        assert result['return'] == {}
357786
+        vm.run_job('job0')
357786
+    iotests.log("")
357786
+
357786
+with iotests.FilePath('t.img') as disk_path, \
357786
+     iotests.VM() as vm:
357786
+
357786
+    remote_path = iotests.remote_filename(disk_path)
357786
+
357786
+    #
357786
+    # Successful image creation (defaults)
357786
+    #
357786
+    iotests.log("=== Successful image creation (defaults) ===")
357786
+    iotests.log("")
357786
+
357786
+    vm.launch()
357786
+    blockdev_create(vm, { 'driver': 'ssh',
357786
+                          'location': {
357786
+                              'path': disk_path,
357786
+                              'server': {
357786
+                                  'host': '127.0.0.1',
357786
+                                  'port': '22'
357786
+                              }
357786
+                          },
357786
+                          'size': 4194304 })
357786
+    vm.shutdown()
357786
+
357786
+    iotests.img_info_log(remote_path, filter_path=disk_path)
357786
+    iotests.log("")
357786
+    iotests.img_info_log(disk_path)
357786
+
357786
+    #
357786
+    # Test host-key-check options
357786
+    #
357786
+    iotests.log("=== Test host-key-check options ===")
357786
+    iotests.log("")
357786
+
357786
+    vm.launch()
357786
+    blockdev_create(vm, { 'driver': 'ssh',
357786
+                          'location': {
357786
+                              'path': disk_path,
357786
+                              'server': {
357786
+                                  'host': '127.0.0.1',
357786
+                                  'port': '22'
357786
+                              },
357786
+                              'host-key-check': {
357786
+                                  'mode': 'none'
357786
+                              }
357786
+                          },
357786
+                          'size': 8388608 })
357786
+    vm.shutdown()
357786
+
357786
+    iotests.img_info_log(remote_path, filter_path=disk_path)
357786
+
357786
+    vm.launch()
357786
+    blockdev_create(vm, { 'driver': 'ssh',
357786
+                          'location': {
357786
+                              'path': disk_path,
357786
+                              'server': {
357786
+                                  'host': '127.0.0.1',
357786
+                                  'port': '22'
357786
+                              },
357786
+                              'host-key-check': {
357786
+                                  'mode': 'known_hosts'
357786
+                              }
357786
+                          },
357786
+                          'size': 4194304 })
357786
+    vm.shutdown()
357786
+
357786
+    iotests.img_info_log(remote_path, filter_path=disk_path)
357786
+
357786
+    md5_key = subprocess.check_output(
357786
+        'ssh-keyscan -t rsa 127.0.0.1 2>/dev/null | grep -v "\\^#" | ' +
357786
+        'cut -d" " -f3 | base64 -d | md5sum -b | cut -d" " -f1',
357786
+        shell=True).rstrip()
357786
+
357786
+    vm.launch()
357786
+    blockdev_create(vm, { 'driver': 'ssh',
357786
+                          'location': {
357786
+                              'path': disk_path,
357786
+                              'server': {
357786
+                                  'host': '127.0.0.1',
357786
+                                  'port': '22'
357786
+                              },
357786
+                              'host-key-check': {
357786
+                                  'mode': 'hash',
357786
+                                  'type': 'md5',
357786
+                                  'hash': 'wrong',
357786
+                              }
357786
+                          },
357786
+                          'size': 2097152 })
357786
+    blockdev_create(vm, { 'driver': 'ssh',
357786
+                          'location': {
357786
+                              'path': disk_path,
357786
+                              'server': {
357786
+                                  'host': '127.0.0.1',
357786
+                                  'port': '22'
357786
+                              },
357786
+                              'host-key-check': {
357786
+                                  'mode': 'hash',
357786
+                                  'type': 'md5',
357786
+                                  'hash': md5_key,
357786
+                              }
357786
+                          },
357786
+                          'size': 8388608 })
357786
+    vm.shutdown()
357786
+
357786
+    iotests.img_info_log(remote_path, filter_path=disk_path)
357786
+
357786
+    sha1_key = subprocess.check_output(
357786
+        'ssh-keyscan -t rsa 127.0.0.1 2>/dev/null | grep -v "\\^#" | ' +
357786
+        'cut -d" " -f3 | base64 -d | sha1sum -b | cut -d" " -f1',
357786
+        shell=True).rstrip()
357786
+
357786
+    vm.launch()
357786
+    blockdev_create(vm, { 'driver': 'ssh',
357786
+                          'location': {
357786
+                              'path': disk_path,
357786
+                              'server': {
357786
+                                  'host': '127.0.0.1',
357786
+                                  'port': '22'
357786
+                              },
357786
+                              'host-key-check': {
357786
+                                  'mode': 'hash',
357786
+                                  'type': 'sha1',
357786
+                                  'hash': 'wrong',
357786
+                              }
357786
+                          },
357786
+                          'size': 2097152 })
357786
+    blockdev_create(vm, { 'driver': 'ssh',
357786
+                          'location': {
357786
+                              'path': disk_path,
357786
+                              'server': {
357786
+                                  'host': '127.0.0.1',
357786
+                                  'port': '22'
357786
+                              },
357786
+                              'host-key-check': {
357786
+                                  'mode': 'hash',
357786
+                                  'type': 'sha1',
357786
+                                  'hash': sha1_key,
357786
+                              }
357786
+                          },
357786
+                          'size': 4194304 })
357786
+    vm.shutdown()
357786
+
357786
+    iotests.img_info_log(remote_path, filter_path=disk_path)
357786
+
357786
+    #
357786
+    # Invalid path and user
357786
+    #
357786
+    iotests.log("=== Invalid path and user ===")
357786
+    iotests.log("")
357786
+
357786
+    vm.launch()
357786
+    blockdev_create(vm, { 'driver': 'ssh',
357786
+                          'location': {
357786
+                              'path': '/this/is/not/an/existing/path',
357786
+                              'server': {
357786
+                                  'host': '127.0.0.1',
357786
+                                  'port': '22'
357786
+                              },
357786
+                              'host-key-check': {
357786
+                                  'mode': 'none'
357786
+                              }
357786
+                          },
357786
+                          'size': 4194304 })
357786
+    blockdev_create(vm, { 'driver': 'ssh',
357786
+                          'location': {
357786
+                              'path': disk_path,
357786
+                              'user': 'invalid user',
357786
+                              'server': {
357786
+                                  'host': '127.0.0.1',
357786
+                                  'port': '22'
357786
+                              },
357786
+                              'host-key-check': {
357786
+                                  'mode': 'none'
357786
+                              }
357786
+                          },
357786
+                          'size': 4194304 })
357786
+    vm.shutdown()
357786
diff --git a/tests/qemu-iotests/207.out b/tests/qemu-iotests/207.out
357786
index 417deee..5eee17b 100644
357786
--- a/tests/qemu-iotests/207.out
357786
+++ b/tests/qemu-iotests/207.out
357786
@@ -1,75 +1,80 @@
357786
-QA output created by 207
357786
-
357786
 === Successful image creation (defaults) ===
357786
 
357786
-Testing:
357786
-QMP_VERSION
357786
-{"return": {}}
357786
-{"return": {}}
357786
-{"return": {}}
357786
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
357786
+{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'server': {'host': '127.0.0.1', 'port': '22'}}, 'size': 4194304}}}
357786
+{u'return': {}}
357786
+{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
357786
+{u'return': {}}
357786
 
357786
-image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_DIR/t.IMGFMT"}}
357786
+image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_IMG"}}
357786
 file format: IMGFMT
357786
 virtual size: 4.0M (4194304 bytes)
357786
 
357786
-image: TEST_DIR/t.IMGFMT
357786
+
357786
+image: TEST_IMG
357786
 file format: IMGFMT
357786
 virtual size: 4.0M (4194304 bytes)
357786
 
357786
 === Test host-key-check options ===
357786
 
357786
-Testing:
357786
-QMP_VERSION
357786
-{"return": {}}
357786
-{"return": {}}
357786
-{"return": {}}
357786
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
357786
+{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'host-key-check': {'mode': 'none'}, 'server': {'host': '127.0.0.1', 'port': '22'}}, 'size': 8388608}}}
357786
+{u'return': {}}
357786
+{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
357786
+{u'return': {}}
357786
 
357786
-image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_DIR/t.IMGFMT"}}
357786
+image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_IMG"}}
357786
 file format: IMGFMT
357786
 virtual size: 8.0M (8388608 bytes)
357786
-Testing:
357786
-QMP_VERSION
357786
-{"return": {}}
357786
-{"return": {}}
357786
-{"return": {}}
357786
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
357786
-
357786
-image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_DIR/t.IMGFMT"}}
357786
+
357786
+{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'host-key-check': {'mode': 'known_hosts'}, 'server': {'host': '127.0.0.1', 'port': '22'}}, 'size': 4194304}}}
357786
+{u'return': {}}
357786
+{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
357786
+{u'return': {}}
357786
+
357786
+image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_IMG"}}
357786
 file format: IMGFMT
357786
 virtual size: 4.0M (4194304 bytes)
357786
-Testing:
357786
-QMP_VERSION
357786
-{"return": {}}
357786
-{"error": {"class": "GenericError", "desc": "remote host key does not match host_key_check 'wrong'"}}
357786
-{"return": {}}
357786
-{"return": {}}
357786
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
357786
-
357786
-image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_DIR/t.IMGFMT"}}
357786
+
357786
+{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'host-key-check': {'hash': 'wrong', 'type': 'md5', 'mode': 'hash'}, 'server': {'host': '127.0.0.1', 'port': '22'}}, 'size': 2097152}}}
357786
+{u'return': {}}
357786
+Job failed: remote host key does not match host_key_check 'wrong'
357786
+{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
357786
+{u'return': {}}
357786
+
357786
+{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'host-key-check': {'hash': HASH, 'type': 'md5', 'mode': 'hash'}, 'server': {'host': '127.0.0.1', 'port': '22'}}, 'size': 8388608}}}
357786
+{u'return': {}}
357786
+{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
357786
+{u'return': {}}
357786
+
357786
+image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_IMG"}}
357786
 file format: IMGFMT
357786
 virtual size: 8.0M (8388608 bytes)
357786
-Testing:
357786
-QMP_VERSION
357786
-{"return": {}}
357786
-{"error": {"class": "GenericError", "desc": "remote host key does not match host_key_check 'wrong'"}}
357786
-{"return": {}}
357786
-{"return": {}}
357786
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
357786
-
357786
-image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_DIR/t.IMGFMT"}}
357786
+
357786
+{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'host-key-check': {'hash': 'wrong', 'type': 'sha1', 'mode': 'hash'}, 'server': {'host': '127.0.0.1', 'port': '22'}}, 'size': 2097152}}}
357786
+{u'return': {}}
357786
+Job failed: remote host key does not match host_key_check 'wrong'
357786
+{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
357786
+{u'return': {}}
357786
+
357786
+{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'host-key-check': {'hash': HASH, 'type': 'sha1', 'mode': 'hash'}, 'server': {'host': '127.0.0.1', 'port': '22'}}, 'size': 4194304}}}
357786
+{u'return': {}}
357786
+{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
357786
+{u'return': {}}
357786
+
357786
+image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_IMG"}}
357786
 file format: IMGFMT
357786
 virtual size: 4.0M (4194304 bytes)
357786
 
357786
 === Invalid path and user ===
357786
 
357786
-Testing:
357786
-QMP_VERSION
357786
-{"return": {}}
357786
-{"error": {"class": "GenericError", "desc": "failed to open remote file '/this/is/not/an/existing/path': Failed opening remote file (libssh2 error code: -31)"}}
357786
-{"error": {"class": "GenericError", "desc": "failed to authenticate using publickey authentication and the identities held by your ssh-agent"}}
357786
-{"return": {}}
357786
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
357786
+{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'ssh', 'location': {'path': '/this/is/not/an/existing/path', 'host-key-check': {'mode': 'none'}, 'server': {'host': '127.0.0.1', 'port': '22'}}, 'size': 4194304}}}
357786
+{u'return': {}}
357786
+Job failed: failed to open remote file '/this/is/not/an/existing/path': Failed opening remote file (libssh2 error code: -31)
357786
+{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
357786
+{u'return': {}}
357786
+
357786
+{'execute': 'x-blockdev-create', 'arguments': {'job_id': 'job0', 'options': {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'host-key-check': {'mode': 'none'}, 'user': 'invalid user', 'server': {'host': '127.0.0.1', 'port': '22'}}, 'size': 4194304}}}
357786
+{u'return': {}}
357786
+Job failed: failed to authenticate using publickey authentication and the identities held by your ssh-agent
357786
+{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}}
357786
+{u'return': {}}
357786
 
357786
-*** done
357786
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
357786
index 3d6ae02..649291a 100644
357786
--- a/tests/qemu-iotests/group
357786
+++ b/tests/qemu-iotests/group
357786
@@ -205,11 +205,11 @@
357786
 204 rw auto quick
357786
 205 rw auto quick
357786
 206 rw auto
357786
-# TODO The following commented out tests need to be reworked to work
357786
-# with the x-blockdev-create job
357786
-#207 rw auto
357786
+207 rw auto
357786
 208 rw auto quick
357786
 209 rw auto quick
357786
+# TODO The following commented out tests need to be reworked to work
357786
+# with the x-blockdev-create job
357786
 #210 rw auto
357786
 #211 rw auto quick
357786
 #212 rw auto quick
357786
-- 
357786
1.8.3.1
357786