some more info on the tests done
Этот коммит содержится в:
родитель
4675d1242b
Коммит
5f2864c0b4
57
test/README
57
test/README
@ -1,10 +1,47 @@
|
||||
This is meant to test the libssh2 code's protocol compliance against other
|
||||
implementations. If you want to add a test, you will need to do the following:
|
||||
This directory contains some code meant to test libssh2's protocol compliance
|
||||
against other implementations, as well as providing a body of example code.
|
||||
The following tests are done:
|
||||
|
||||
* methods.c:
|
||||
|
||||
Tries a connection + authentication with every possible key exchange,
|
||||
hostkey, encryption, mac and compression method (see
|
||||
libssh2_session_method_pref()).
|
||||
|
||||
The first connection is done with methods that are required to be supported
|
||||
by server implementations according to the standard: key exchange method
|
||||
"diffie-hellman-group1-sha1", hostkey method "ssh-dss", encryption method
|
||||
"3des-cbc", mac method "hmac-sha1" and no compression.
|
||||
|
||||
Then every method is tried in turn, with all the other methods set to these
|
||||
"known good" methods. Hence, the test will report exactly which method of
|
||||
which method type failed to initialize a connection. A total of 26 tests
|
||||
is performed.
|
||||
|
||||
|
||||
* auth.c:
|
||||
|
||||
This test tries to authenticate with username+pasword, and public/private
|
||||
key + passphrase. In addition, the hostkey is retrieved in both MD5 and SHA1
|
||||
formats, and sanity-checked.
|
||||
|
||||
|
||||
* forward.c:
|
||||
|
||||
This test tries to make the remote host listen on a port, then requests a
|
||||
tunnel through the remote host to that port, accepting the connection
|
||||
locally. A block of data is then sent through the tunnel, and this data is
|
||||
then compared to the original when received.
|
||||
|
||||
This is tried four times: one each for every combination of the remote
|
||||
host's bind address provided or not, and bind port provided or not.
|
||||
|
||||
|
||||
|
||||
If you want to add a test, you will need to do the following:
|
||||
|
||||
* create a new source file, and add it to the Makefile
|
||||
|
||||
* call your main function (runtest_yourtest) from main() in main.c
|
||||
|
||||
* at the top of your source file, put:
|
||||
|
||||
#include <libssh2.h>
|
||||
@ -12,16 +49,10 @@ implementations. If you want to add a test, you will need to do the following:
|
||||
|
||||
extern struct authdefs auth;
|
||||
|
||||
|
||||
* call init_test("description of your test", number_of_steps)
|
||||
|
||||
* use new_socket() to get a connected socket, and log_line() to log
|
||||
errors if your test fails.
|
||||
* before every step in your test, call increase_progress()
|
||||
|
||||
* after every step, if it was successful, call step_successful()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
* after your test, print a "\n".
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user