mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +09:00
tests:unittests: Fix tests on FreeBSD
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Jakub Jelen
parent
3d0226cadc
commit
bfae56634c
@@ -13,8 +13,9 @@
|
|||||||
|
|
||||||
#include <libssh/libssh.h>
|
#include <libssh/libssh.h>
|
||||||
|
|
||||||
|
#define TEST_SERVER_HOST "127.0.0.1"
|
||||||
#define TEST_SERVER_PORT 2222
|
#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_DEST_PORT 12345
|
||||||
#define TEST_ORIG_HOST "127.0.0.1"
|
#define TEST_ORIG_HOST "127.0.0.1"
|
||||||
#define TEST_ORIG_PORT 54321
|
#define TEST_ORIG_PORT 54321
|
||||||
@@ -121,7 +122,7 @@ static void *server_thread(void *arg)
|
|||||||
ssh_callbacks_init(&server_cb);
|
ssh_callbacks_init(&server_cb);
|
||||||
|
|
||||||
/* Create server */
|
/* Create server */
|
||||||
sshbind = torture_ssh_bind("localhost",
|
sshbind = torture_ssh_bind(TEST_SERVER_HOST,
|
||||||
TEST_SERVER_PORT,
|
TEST_SERVER_PORT,
|
||||||
h->key_type,
|
h->key_type,
|
||||||
h->hostkey_path);
|
h->hostkey_path);
|
||||||
@@ -264,7 +265,7 @@ static void torture_forwarded_tcpip_callback(void **state, bool should_accept)
|
|||||||
pthread_mutex_unlock(&server_mutex);
|
pthread_mutex_unlock(&server_mutex);
|
||||||
|
|
||||||
session =
|
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);
|
assert_non_null(session);
|
||||||
|
|
||||||
rc = ssh_set_callbacks(session, &client_cb);
|
rc = ssh_set_callbacks(session, &client_cb);
|
||||||
|
|||||||
@@ -13,8 +13,9 @@
|
|||||||
|
|
||||||
#include <libssh/libssh.h>
|
#include <libssh/libssh.h>
|
||||||
|
|
||||||
|
#define TEST_SERVER_HOST "127.0.0.1"
|
||||||
#define TEST_SERVER_PORT 2222
|
#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_DEST_PORT 12345
|
||||||
#define TEST_ORIG_HOST "127.0.0.1"
|
#define TEST_ORIG_HOST "127.0.0.1"
|
||||||
#define TEST_ORIG_PORT 54321
|
#define TEST_ORIG_PORT 54321
|
||||||
@@ -81,7 +82,8 @@ static void *client_thread(void *arg)
|
|||||||
ssh_channel channel = NULL;
|
ssh_channel channel = NULL;
|
||||||
bool should_accept = *(bool *)arg;
|
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);
|
assert_non_null(session);
|
||||||
|
|
||||||
channel = ssh_channel_new(session);
|
channel = ssh_channel_new(session);
|
||||||
@@ -177,7 +179,7 @@ static void torture_ssh_channel_direct_tcpip(void **state, int should_accept)
|
|||||||
ssh_callbacks_init(&server_cb);
|
ssh_callbacks_init(&server_cb);
|
||||||
|
|
||||||
/* Create server */
|
/* Create server */
|
||||||
sshbind = torture_ssh_bind("localhost",
|
sshbind = torture_ssh_bind(TEST_SERVER_HOST,
|
||||||
TEST_SERVER_PORT,
|
TEST_SERVER_PORT,
|
||||||
h->key_type,
|
h->key_type,
|
||||||
h->hostkey_path);
|
h->hostkey_path);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "torture_key.h"
|
#include "torture_key.h"
|
||||||
#include <libssh/libssh.h>
|
#include <libssh/libssh.h>
|
||||||
|
|
||||||
|
#define TEST_SERVER_HOST "127.0.0.1"
|
||||||
#define TEST_SERVER_PORT 2222
|
#define TEST_SERVER_PORT 2222
|
||||||
|
|
||||||
struct hostkey_state {
|
struct hostkey_state {
|
||||||
@@ -79,7 +80,7 @@ static void *client_thread(void *arg) {
|
|||||||
(void)arg;
|
(void)arg;
|
||||||
|
|
||||||
usleep(200);
|
usleep(200);
|
||||||
session = torture_ssh_session(NULL, "localhost",
|
session = torture_ssh_session(NULL, TEST_SERVER_HOST,
|
||||||
&test_port,
|
&test_port,
|
||||||
"foo", "bar");
|
"foo", "bar");
|
||||||
assert_non_null(session);
|
assert_non_null(session);
|
||||||
@@ -178,7 +179,7 @@ static void test_ssh_channel_request_x11(void **state) {
|
|||||||
ssh_callbacks_init(&server_cb);
|
ssh_callbacks_init(&server_cb);
|
||||||
|
|
||||||
/* Create server */
|
/* Create server */
|
||||||
sshbind = torture_ssh_bind("localhost",
|
sshbind = torture_ssh_bind(TEST_SERVER_HOST,
|
||||||
TEST_SERVER_PORT,
|
TEST_SERVER_PORT,
|
||||||
h->key_type,
|
h->key_type,
|
||||||
h->hostkey_path);
|
h->hostkey_path);
|
||||||
|
|||||||
Reference in New Issue
Block a user