mirror of
				https://github.com/qemu/qemu.git
				synced 2025-10-31 12:07:31 +00:00 
			
		
		
		
	 48f1fcd5c8
			
		
	
	
		48f1fcd5c8
		
	
	
	
	
		
			
			Commite3296cc796made 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>
		
			
				
	
	
		
			106 lines
		
	
	
		
			5.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			106 lines
		
	
	
		
			5.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| === Successful image creation (defaults) ===
 | |
| 
 | |
| {"execute": "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}}}
 | |
| {"return": {}}
 | |
| {"execute": "job-dismiss", "arguments": {"id": "job0"}}
 | |
| {"return": {}}
 | |
| 
 | |
| image: TEST_IMG
 | |
| file format: IMGFMT
 | |
| virtual size: 4 MiB (4194304 bytes)
 | |
| 
 | |
| 
 | |
| image: TEST_IMG
 | |
| file format: IMGFMT
 | |
| virtual size: 4 MiB (4194304 bytes)
 | |
| 
 | |
| === Test host-key-check options ===
 | |
| 
 | |
| --- no host key checking --
 | |
| 
 | |
| {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "ssh", "location": {"host-key-check": {"mode": "none"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}}, "size": 8388608}}}
 | |
| {"return": {}}
 | |
| {"execute": "job-dismiss", "arguments": {"id": "job0"}}
 | |
| {"return": {}}
 | |
| 
 | |
| image: TEST_IMG
 | |
| file format: IMGFMT
 | |
| virtual size: 8 MiB (8388608 bytes)
 | |
| 
 | |
| --- known_hosts key checking --
 | |
| 
 | |
| {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "ssh", "location": {"host-key-check": {"mode": "known_hosts"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}}, "size": 4194304}}}
 | |
| {"return": {}}
 | |
| {"execute": "job-dismiss", "arguments": {"id": "job0"}}
 | |
| {"return": {}}
 | |
| 
 | |
| image: TEST_IMG
 | |
| file format: IMGFMT
 | |
| virtual size: 4 MiB (4194304 bytes)
 | |
| 
 | |
| --- explicit md5 key checking --
 | |
| 
 | |
| {"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 fingerprint 'md5:HASH' does not match host_key_check 'md5:wrong'
 | |
| {"execute": "job-dismiss", "arguments": {"id": "job0"}}
 | |
| {"return": {}}
 | |
| 
 | |
| {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "ssh", "location": {"host-key-check": {"hash": "HASH", "mode": "hash", "type": "md5"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}}, "size": 8388608}}}
 | |
| {"return": {}}
 | |
| {"execute": "job-dismiss", "arguments": {"id": "job0"}}
 | |
| {"return": {}}
 | |
| 
 | |
| image: TEST_IMG
 | |
| file format: IMGFMT
 | |
| virtual size: 8 MiB (8388608 bytes)
 | |
| 
 | |
| --- explicit sha1 key checking --
 | |
| 
 | |
| {"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 fingerprint 'sha1:HASH' does not match host_key_check 'sha1:wrong'
 | |
| {"execute": "job-dismiss", "arguments": {"id": "job0"}}
 | |
| {"return": {}}
 | |
| 
 | |
| {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "ssh", "location": {"host-key-check": {"hash": "HASH", "mode": "hash", "type": "sha1"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}}, "size": 4194304}}}
 | |
| {"return": {}}
 | |
| {"execute": "job-dismiss", "arguments": {"id": "job0"}}
 | |
| {"return": {}}
 | |
| 
 | |
| image: TEST_IMG
 | |
| file format: IMGFMT
 | |
| virtual size: 4 MiB (4194304 bytes)
 | |
| 
 | |
| --- explicit sha256 key checking --
 | |
| 
 | |
| {"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 fingerprint 'sha256:HASH' does not match host_key_check 'sha256:wrong'
 | |
| {"execute": "job-dismiss", "arguments": {"id": "job0"}}
 | |
| {"return": {}}
 | |
| 
 | |
| {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "ssh", "location": {"host-key-check": {"hash": "HASH", "mode": "hash", "type": "sha256"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}}, "size": 4194304}}}
 | |
| {"return": {}}
 | |
| {"execute": "job-dismiss", "arguments": {"id": "job0"}}
 | |
| {"return": {}}
 | |
| 
 | |
| image: TEST_IMG
 | |
| file format: IMGFMT
 | |
| virtual size: 4 MiB (4194304 bytes)
 | |
| 
 | |
| === Invalid path and user ===
 | |
| 
 | |
| {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "ssh", "location": {"host-key-check": {"mode": "none"}, "path": "/this/is/not/an/existing/path", "server": {"host": "127.0.0.1", "port": "22"}}, "size": 4194304}}}
 | |
| {"return": {}}
 | |
| Job failed: failed to open remote file '/this/is/not/an/existing/path': SFTP server: No such file (libssh error code: 1, sftp error code: 2)
 | |
| {"execute": "job-dismiss", "arguments": {"id": "job0"}}
 | |
| {"return": {}}
 | |
| 
 | |
| {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "ssh", "location": {"host-key-check": {"mode": "none"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}, "user": "invalid user"}, "size": 4194304}}}
 | |
| {"return": {}}
 | |
| Job failed: failed to authenticate using publickey authentication and the identities held by your ssh-agent
 | |
| {"execute": "job-dismiss", "arguments": {"id": "job0"}}
 | |
| {"return": {}}
 | |
| 
 |