blob: 05cf7532836cc21ab77a69d4ea7242138832993a [file] [log] [blame]
Kevin Wolf56ea7452018-02-08 20:06:41 +01001=== Successful image creation (defaults) ===
2
Max Reitz8a57a4b2019-02-10 15:57:36 +01003{"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}}}
Max Reitze21b5f32018-10-22 14:53:07 +01004{"return": {}}
5{"execute": "job-dismiss", "arguments": {"id": "job0"}}
6{"return": {}}
Kevin Wolf56ea7452018-02-08 20:06:41 +01007
Max Reitzb8c1f902019-02-25 20:08:27 +01008image: TEST_IMG
Kevin Wolf56ea7452018-02-08 20:06:41 +01009file format: IMGFMT
Eric Blakede38b502019-04-17 12:11:01 -050010virtual size: 4 MiB (4194304 bytes)
Kevin Wolf56ea7452018-02-08 20:06:41 +010011
Kevin Wolf00af1932018-05-23 18:19:00 +020012
13image: TEST_IMG
Kevin Wolf56ea7452018-02-08 20:06:41 +010014file format: IMGFMT
Eric Blakede38b502019-04-17 12:11:01 -050015virtual size: 4 MiB (4194304 bytes)
Kevin Wolf56ea7452018-02-08 20:06:41 +010016
17=== Test host-key-check options ===
18
Daniel P. Berrangébf783262021-06-22 12:51:56 +010019--- no host key checking --
20
Max Reitz8a57a4b2019-02-10 15:57:36 +010021{"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}}}
Max Reitze21b5f32018-10-22 14:53:07 +010022{"return": {}}
23{"execute": "job-dismiss", "arguments": {"id": "job0"}}
24{"return": {}}
Kevin Wolf56ea7452018-02-08 20:06:41 +010025
Max Reitzb8c1f902019-02-25 20:08:27 +010026image: TEST_IMG
Kevin Wolf56ea7452018-02-08 20:06:41 +010027file format: IMGFMT
Eric Blakede38b502019-04-17 12:11:01 -050028virtual size: 8 MiB (8388608 bytes)
Kevin Wolf56ea7452018-02-08 20:06:41 +010029
Daniel P. Berrangébf783262021-06-22 12:51:56 +010030--- known_hosts key checking --
31
Max Reitz8a57a4b2019-02-10 15:57:36 +010032{"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}}}
Max Reitze21b5f32018-10-22 14:53:07 +010033{"return": {}}
34{"execute": "job-dismiss", "arguments": {"id": "job0"}}
35{"return": {}}
Kevin Wolf00af1932018-05-23 18:19:00 +020036
Max Reitzb8c1f902019-02-25 20:08:27 +010037image: TEST_IMG
Kevin Wolf56ea7452018-02-08 20:06:41 +010038file format: IMGFMT
Eric Blakede38b502019-04-17 12:11:01 -050039virtual size: 4 MiB (4194304 bytes)
Kevin Wolf56ea7452018-02-08 20:06:41 +010040
Daniel P. Berrangébf783262021-06-22 12:51:56 +010041--- explicit md5 key checking --
42
Max Reitz8a57a4b2019-02-10 15:57:36 +010043{"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}}}
Max Reitze21b5f32018-10-22 14:53:07 +010044{"return": {}}
Hanna Reitz48f1fcd2022-03-18 13:53:04 +010045Job failed: remote host key fingerprint 'md5:HASH' does not match host_key_check 'md5:wrong'
Max Reitze21b5f32018-10-22 14:53:07 +010046{"execute": "job-dismiss", "arguments": {"id": "job0"}}
47{"return": {}}
Kevin Wolf00af1932018-05-23 18:19:00 +020048
Max Reitz8a57a4b2019-02-10 15:57:36 +010049{"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}}}
Max Reitze21b5f32018-10-22 14:53:07 +010050{"return": {}}
51{"execute": "job-dismiss", "arguments": {"id": "job0"}}
52{"return": {}}
Kevin Wolf00af1932018-05-23 18:19:00 +020053
Max Reitzb8c1f902019-02-25 20:08:27 +010054image: TEST_IMG
Kevin Wolf56ea7452018-02-08 20:06:41 +010055file format: IMGFMT
Eric Blakede38b502019-04-17 12:11:01 -050056virtual size: 8 MiB (8388608 bytes)
Kevin Wolf56ea7452018-02-08 20:06:41 +010057
Daniel P. Berrangébf783262021-06-22 12:51:56 +010058--- explicit sha1 key checking --
59
Max Reitz8a57a4b2019-02-10 15:57:36 +010060{"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}}}
Max Reitze21b5f32018-10-22 14:53:07 +010061{"return": {}}
Hanna Reitz48f1fcd2022-03-18 13:53:04 +010062Job failed: remote host key fingerprint 'sha1:HASH' does not match host_key_check 'sha1:wrong'
Max Reitze21b5f32018-10-22 14:53:07 +010063{"execute": "job-dismiss", "arguments": {"id": "job0"}}
64{"return": {}}
Kevin Wolf00af1932018-05-23 18:19:00 +020065
Max Reitz8a57a4b2019-02-10 15:57:36 +010066{"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}}}
Max Reitze21b5f32018-10-22 14:53:07 +010067{"return": {}}
68{"execute": "job-dismiss", "arguments": {"id": "job0"}}
69{"return": {}}
Kevin Wolf00af1932018-05-23 18:19:00 +020070
Max Reitzb8c1f902019-02-25 20:08:27 +010071image: TEST_IMG
Kevin Wolf56ea7452018-02-08 20:06:41 +010072file format: IMGFMT
Eric Blakede38b502019-04-17 12:11:01 -050073virtual size: 4 MiB (4194304 bytes)
Kevin Wolf56ea7452018-02-08 20:06:41 +010074
Daniel P. Berrangébf783262021-06-22 12:51:56 +010075--- explicit sha256 key checking --
76
77{"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}}}
78{"return": {}}
Hanna Reitz48f1fcd2022-03-18 13:53:04 +010079Job failed: remote host key fingerprint 'sha256:HASH' does not match host_key_check 'sha256:wrong'
Daniel P. Berrangébf783262021-06-22 12:51:56 +010080{"execute": "job-dismiss", "arguments": {"id": "job0"}}
81{"return": {}}
82
83{"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}}}
84{"return": {}}
85{"execute": "job-dismiss", "arguments": {"id": "job0"}}
86{"return": {}}
87
88image: TEST_IMG
89file format: IMGFMT
90virtual size: 4 MiB (4194304 bytes)
91
Kevin Wolf56ea7452018-02-08 20:06:41 +010092=== Invalid path and user ===
93
Max Reitz8a57a4b2019-02-10 15:57:36 +010094{"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}}}
Max Reitze21b5f32018-10-22 14:53:07 +010095{"return": {}}
Pino Toscanob10d49d2019-06-20 22:08:40 +020096Job 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)
Max Reitze21b5f32018-10-22 14:53:07 +010097{"execute": "job-dismiss", "arguments": {"id": "job0"}}
98{"return": {}}
Kevin Wolf56ea7452018-02-08 20:06:41 +010099
Max Reitz8a57a4b2019-02-10 15:57:36 +0100100{"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}}}
Max Reitze21b5f32018-10-22 14:53:07 +0100101{"return": {}}
Kevin Wolf00af1932018-05-23 18:19:00 +0200102Job failed: failed to authenticate using publickey authentication and the identities held by your ssh-agent
Max Reitze21b5f32018-10-22 14:53:07 +0100103{"execute": "job-dismiss", "arguments": {"id": "job0"}}
104{"return": {}}
Kevin Wolf00af1932018-05-23 18:19:00 +0200105