yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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