diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2013-07-11 15:15:34 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2013-07-11 15:34:50 +0200 |
commit | e52cc613e4127d419b79aca5db9e5493f62a5593 (patch) | |
tree | 9da6ad71a54c1ee526f7369fc7cde5bbfda07989 /tests/unittests | |
parent | 89be6d0309f3ab7a869805b4de6ce63d769484c9 (diff) | |
download | libssh-e52cc613e4127d419b79aca5db9e5493f62a5593.tar.gz libssh-e52cc613e4127d419b79aca5db9e5493f62a5593.tar.xz libssh-e52cc613e4127d419b79aca5db9e5493f62a5593.zip |
BUG 103: Disable proxy command if set to 'none'.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests/unittests')
-rw-r--r-- | tests/unittests/torture_options.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unittests/torture_options.c b/tests/unittests/torture_options.c index 76da3edb..6f5df1bb 100644 --- a/tests/unittests/torture_options.c +++ b/tests/unittests/torture_options.c @@ -176,6 +176,23 @@ static void torture_options_get_identity(void **state) { free(identity); } +static void torture_options_proxycommand(void **state) { + ssh_session session = *state; + int rc; + + /* Enable ProxyCommand */ + rc = ssh_options_set(session, SSH_OPTIONS_PROXYCOMMAND, "ssh -q -A -X -W %h:%p JUMPHOST"); + assert_int_equal(rc, 0); + + assert_string_equal(session->opts.ProxyCommand, "ssh -q -A -X -W %h:%p JUMPHOST"); + + /* Disable ProxyCommand */ + rc = ssh_options_set(session, SSH_OPTIONS_PROXYCOMMAND, "none"); + assert_int_equal(rc, 0); + + assert_null(session->opts.ProxyCommand); +} + int torture_run_tests(void) { int rc; const UnitTest tests[] = { @@ -188,6 +205,7 @@ int torture_run_tests(void) { unit_test_setup_teardown(torture_options_get_user, setup, teardown), unit_test_setup_teardown(torture_options_set_identity, setup, teardown), unit_test_setup_teardown(torture_options_get_identity, setup, teardown), + unit_test_setup_teardown(torture_options_proxycommand, setup, teardown), }; ssh_init(); |