@@ -35,7 +35,12 @@ def filter_hash(qmsg):
if key == 'hash' and re.match('[0-9a-f]+', value):
return 'HASH'
return value
- return iotests.filter_qmp(qmsg, _filter)
+ if isinstance(qmsg, str):
+ # Strip key type and fingerprint
+ p = r"\S+ (key fingerprint) '(md5|sha1|sha256):[0-9a-f]+'"
+ return re.sub(p, r"\1 '\2:HASH'", qmsg)
+ else:
+ return iotests.filter_qmp(qmsg, _filter)
def blockdev_create(vm, options):
vm.blockdev_create(options, filters=[iotests.filter_qmp_testfiles, filter_hash])
@@ -42,7 +42,7 @@ virtual size: 4 MiB (4194304 bytes)
{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "ssh", "location": {"host-key-check": {"hash": "wrong", "mode": "hash", "type": "md5"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}}, "size": 2097152}}}
{"return": {}}
-Job failed: remote host key does not match host_key_check 'wrong'
+Job failed: remote host key fingerprint 'md5:HASH' does not match host_key_check 'md5:wrong'
{"execute": "job-dismiss", "arguments": {"id": "job0"}}
{"return": {}}
@@ -59,7 +59,7 @@ virtual size: 8 MiB (8388608 bytes)
{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "ssh", "location": {"host-key-check": {"hash": "wrong", "mode": "hash", "type": "sha1"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}}, "size": 2097152}}}
{"return": {}}
-Job failed: remote host key does not match host_key_check 'wrong'
+Job failed: remote host key fingerprint 'sha1:HASH' does not match host_key_check 'sha1:wrong'
{"execute": "job-dismiss", "arguments": {"id": "job0"}}
{"return": {}}
@@ -76,7 +76,7 @@ virtual size: 4 MiB (4194304 bytes)
{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "ssh", "location": {"host-key-check": {"hash": "wrong", "mode": "hash", "type": "sha256"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}}, "size": 2097152}}}
{"return": {}}
-Job failed: remote host key does not match host_key_check 'wrong'
+Job failed: remote host key fingerprint 'sha256:HASH' does not match host_key_check 'sha256:wrong'
{"execute": "job-dismiss", "arguments": {"id": "job0"}}
{"return": {}}