diff --git a/tests/unittests/torture_forwarded_tcpip_callback.c b/tests/unittests/torture_forwarded_tcpip_callback.c index 036fde8d..cf80c87b 100644 --- a/tests/unittests/torture_forwarded_tcpip_callback.c +++ b/tests/unittests/torture_forwarded_tcpip_callback.c @@ -13,8 +13,9 @@ #include +#define TEST_SERVER_HOST "127.0.0.1" #define TEST_SERVER_PORT 2222 -#define TEST_DEST_HOST "localhost" +#define TEST_DEST_HOST "127.0.0.1" #define TEST_DEST_PORT 12345 #define TEST_ORIG_HOST "127.0.0.1" #define TEST_ORIG_PORT 54321 @@ -121,7 +122,7 @@ static void *server_thread(void *arg) ssh_callbacks_init(&server_cb); /* Create server */ - sshbind = torture_ssh_bind("localhost", + sshbind = torture_ssh_bind(TEST_SERVER_HOST, TEST_SERVER_PORT, h->key_type, h->hostkey_path); @@ -264,7 +265,7 @@ static void torture_forwarded_tcpip_callback(void **state, bool should_accept) pthread_mutex_unlock(&server_mutex); session = - torture_ssh_session(NULL, "localhost", &server_port, "foo", "bar"); + torture_ssh_session(NULL, "127.0.0.1", &server_port, "foo", "bar"); assert_non_null(session); rc = ssh_set_callbacks(session, &client_cb); diff --git a/tests/unittests/torture_server_direct_tcpip.c b/tests/unittests/torture_server_direct_tcpip.c index 6d8aa4bb..bad0896b 100644 --- a/tests/unittests/torture_server_direct_tcpip.c +++ b/tests/unittests/torture_server_direct_tcpip.c @@ -13,8 +13,9 @@ #include +#define TEST_SERVER_HOST "127.0.0.1" #define TEST_SERVER_PORT 2222 -#define TEST_DEST_HOST "localhost" +#define TEST_DEST_HOST "127.0.0.1" #define TEST_DEST_PORT 12345 #define TEST_ORIG_HOST "127.0.0.1" #define TEST_ORIG_PORT 54321 @@ -81,7 +82,8 @@ static void *client_thread(void *arg) ssh_channel channel = NULL; bool should_accept = *(bool *)arg; - session = torture_ssh_session(NULL, "localhost", &test_port, "foo", "bar"); + session = + torture_ssh_session(NULL, TEST_SERVER_HOST, &test_port, "foo", "bar"); assert_non_null(session); channel = ssh_channel_new(session); @@ -124,7 +126,7 @@ static int auth_password_accept(ssh_session session, struct channel_data { /* Whether the callback should accept the channel open request */ bool should_accept; - + int req_seen; char *dest_host; uint32_t dest_port; @@ -177,7 +179,7 @@ static void torture_ssh_channel_direct_tcpip(void **state, int should_accept) ssh_callbacks_init(&server_cb); /* Create server */ - sshbind = torture_ssh_bind("localhost", + sshbind = torture_ssh_bind(TEST_SERVER_HOST, TEST_SERVER_PORT, h->key_type, h->hostkey_path); diff --git a/tests/unittests/torture_server_x11.c b/tests/unittests/torture_server_x11.c index 7c858742..98423cf7 100644 --- a/tests/unittests/torture_server_x11.c +++ b/tests/unittests/torture_server_x11.c @@ -12,6 +12,7 @@ #include "torture_key.h" #include +#define TEST_SERVER_HOST "127.0.0.1" #define TEST_SERVER_PORT 2222 struct hostkey_state { @@ -79,7 +80,7 @@ static void *client_thread(void *arg) { (void)arg; usleep(200); - session = torture_ssh_session(NULL, "localhost", + session = torture_ssh_session(NULL, TEST_SERVER_HOST, &test_port, "foo", "bar"); assert_non_null(session); @@ -178,7 +179,7 @@ static void test_ssh_channel_request_x11(void **state) { ssh_callbacks_init(&server_cb); /* Create server */ - sshbind = torture_ssh_bind("localhost", + sshbind = torture_ssh_bind(TEST_SERVER_HOST, TEST_SERVER_PORT, h->key_type, h->hostkey_path);