mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
iotests/207: Filter host fingerprint
Commite3296cc796
made the ssh block driver's error message for fingerprint mismatches more verbose, so it now prints the actual host key fingerprint and the key type. iotest 207 tests such errors, but was not amended to filter that fingerprint (which is host-specific), so do it now. Filter the key type, too, because I guess this too can differ depending on the host configuration. Fixes:e3296cc796
("block: print the server key type and fingerprint on failure") Reported-by: John Snow <jsnow@redhat.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com> Message-Id: <20220318125304.66131-3-hreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
This commit is contained in:
parent
da9d88d8e6
commit
48f1fcd5c8
2 changed files with 9 additions and 4 deletions
|
@ -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])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue