|
|
|
|
@ -84,9 +84,15 @@ static int test2_wrong_key(void) {
|
|
|
|
|
0, 200, 0, on_cli_ready, &cli_ready, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL); |
|
|
|
|
TASSERT(sc); |
|
|
|
|
|
|
|
|
|
int ticks = 0; |
|
|
|
|
while (ticks < 2000) { uasync_poll(ua, 10); ticks++; } |
|
|
|
|
// Неверный ключ должен завершить handshake закрытием, без создания серверного линка.
|
|
|
|
|
struct stcp_conn* conn = stcp_client_get_conn(sc); TASSERT(conn); |
|
|
|
|
uint64_t start = get_time_tb(), deadline = start + 20000; |
|
|
|
|
while (conn->state != STCP_STATE_CLOSED && get_time_tb() < deadline) uasync_poll(ua, 10); |
|
|
|
|
TASSERT(conn->state == STCP_STATE_CLOSED); |
|
|
|
|
TASSERT(!cli_ready); |
|
|
|
|
TASSERT(!g_on_srv_link); // should NOT connect with wrong key
|
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "STCP wrong-key test: handshake closed without READY/link elapsed_tb=%llu", |
|
|
|
|
(unsigned long long)(get_time_tb() - start)); |
|
|
|
|
|
|
|
|
|
stcp_client_destroy(sc); |
|
|
|
|
stcp_link_server_destroy(ss); |
|
|
|
|
|