|
Monero
|
#include <algorithm>#include <atomic>#include <boost/archive/portable_binary_oarchive.hpp>#include <boost/archive/portable_binary_iarchive.hpp>#include <boost/asio/buffer.hpp>#include <boost/asio/io_context.hpp>#include <boost/asio/ip/tcp.hpp>#include <boost/asio/read.hpp>#include <boost/asio/steady_timer.hpp>#include <boost/asio/write.hpp>#include <boost/endian/conversion.hpp>#include <boost/range/adaptor/sliced.hpp>#include <boost/range/combine.hpp>#include <boost/optional/optional.hpp>#include <boost/system/error_code.hpp>#include <boost/thread/scoped_thread.hpp>#include <boost/thread/thread.hpp>#include <boost/uuid/nil_generator.hpp>#include <boost/uuid/random_generator.hpp>#include <boost/uuid/uuid.hpp>#include <cstdint>#include <cstring>#include <functional>#include <gtest/gtest.h>#include <map>#include <memory>#include <thread>#include <type_traits>#include <csignal>#include <pthread.h>#include "crypto/crypto.h"#include "net/dandelionpp.h"#include "net/error.h"#include "net/host.h"#include "net/i2p_address.h"#include "net/net_helper.h"#include "net/net_utils_base.h"#include "net/socks.h"#include "net/socks_connect.h"#include "net/parse.h"#include "net/tor_address.h"#include "net/zmq.h"#include "p2p/net_peerlist_boost_serialization.h"#include "serialization/keyvalue_serialization.h"#include "storages/portable_storage.h"#include "unit_tests_utils.h"
Functions | |
| TEST (host, canonicalize_host) | |
| TEST (blocked_mode_client, shutdown_aborts_blocked_recv) | |
| TEST (blocked_mode_client, shutdown_aborts_blocked_recv_from_signal_handler) | |
| TEST (blocked_mode_client, shutdown_aborts_blocked_connect) | |
| TEST (blocked_mode_client, shutdown_aborts_stalled_ssl_handshake) | |
| TEST (blocked_mode_client, shutdown_is_permanent) | |
| TEST (blocked_mode_client, eof_marks_disconnected_and_allows_reconnect) | |
| TEST (blocked_mode_client, peer_eof_detected_before_reuse) | |
| TEST (blocked_mode_client, disconnect_is_idempotent_after_peer_close) | |
| TEST_P (blocked_mode_client_ssl, close_notify_detected_before_reuse) | |
| TEST_P (blocked_mode_client_ssl, preserves_unread_data) | |
| TEST_P (blocked_mode_client_ssl, abrupt_eof_detected_before_reuse) | |
| TEST_P (blocked_mode_client_ssl, partial_record_does_not_block) | |
| TEST_P (blocked_mode_client_ssl, idle_probe_allows_request_and_response) | |
| TEST_P (blocked_mode_client_ssl, reconnect_with_pending_probe) | |
| TEST_P (blocked_mode_client_ssl, shutdown_aborts_pending_probe) | |
| TEST_P (blocked_mode_client_ssl, data_before_close_notify_is_preserved) | |
| TEST_P (blocked_mode_client_ssl, recv_times_out_with_pending_probe) | |
| TEST_P (blocked_mode_client_ssl, disconnect_with_pending_probe_is_graceful) | |
| TEST_P (blocked_mode_client_ssl, disconnect_after_peer_eof_is_graceful) | |
| TEST_P (blocked_mode_client_ssl, disconnect_after_abrupt_eof_is_idempotent) | |
| TEST_P (blocked_mode_client_ssl, disconnect_after_shutdown_does_not_wait_for_peer) | |
| TEST_P (blocked_mode_client_ssl, recv_n_preserves_probe_byte_and_count) | |
| TEST_P (blocked_mode_client_ssl, recv_n_returns_false_on_eof_after_probe_byte) | |
| INSTANTIATE_TEST_CASE_P (tls, blocked_mode_client_ssl, testing::Values(TLS1_2_VERSION)) | |
| TEST (tor_address, constants) | |
| TEST (tor_address, invalid) | |
| TEST (tor_address, unblockable_types) | |
| TEST (tor_address, valid) | |
| TEST (tor_address, generic_network_address) | |
| TEST (tor_address, epee_serializev_v2) | |
| TEST (tor_address, epee_serializev_v3) | |
| TEST (tor_address, epee_serialize_unknown) | |
| TEST (tor_address, boost_serialize_v2) | |
| TEST (tor_address, boost_serialize_v3) | |
| TEST (tor_address, boost_serialize_unknown) | |
| TEST (get_network_address, onion) | |
| TEST (i2p_address, constants) | |
| TEST (i2p_address, invalid) | |
| TEST (i2p_address, unblockable_types) | |
| TEST (i2p_address, valid) | |
| TEST (i2p_address, generic_network_address) | |
| TEST (i2p_address, epee_serializev_b32) | |
| TEST (i2p_address, epee_serialize_unknown) | |
| TEST (i2p_address, boost_serialize_b32) | |
| TEST (i2p_address, boost_serialize_unknown) | |
| TEST (get_network_address, i2p) | |
| TEST (get_network_address, ipv4) | |
| TEST (get_network_address, ipv4subnet) | |
| TEST (get_network_address_host_and_port, ipv4) | |
| TEST (get_network_address_host_and_port, ipv6) | |
| TEST (get_network_address_host_and_port, hostname) | |
| TEST (scheme_and_authority, basic) | |
| TEST (userinfo_and_hostport, basic) | |
| TEST (user_and_pass, basic) | |
| TEST (uri_components, get) | |
| TEST (socks_endpoint, get) | |
| TEST (socks_client, unsupported_command) | |
| TEST (socks_client, no_command) | |
| TEST (socks_client, connect_command) | |
| TEST (socks_client, v5_ipv6_connect_command) | |
| TEST (socks_client, connect_command_failed) | |
| TEST (socks_client, v5_ipv4_connect_command_failed) | |
| TEST (socks_client, resolve_command) | |
| TEST (socks_client, v5_username_host_connect) | |
| TEST (socks_client, v5_usernameskipped_host_connect) | |
| TEST (socks_connector, host) | |
| TEST (socks_connector, ipv4) | |
| TEST (socks_connector, error) | |
| TEST (socks_connector, timeout) | |
| TEST (dandelionpp_map, traits) | |
| TEST (dandelionpp_map, empty) | |
| TEST (dandelionpp_map, zero_stems) | |
| TEST (dandelionpp_map, dropped_connection) | |
| TEST (dandelionpp_map, dropped_connection_remapped) | |
| TEST (dandelionpp_map, dropped_all_connections) | |
| TEST (zmq, error_codes) | |
| TEST (zmq, read_write) | |
| TEST (zmq, read_write_slice) | |
| TEST (zmq, write_slice_fail) | |
| TEST (zmq, read_write_multipart) | |
| TEST (zmq, read_write_termination) | |
| INSTANTIATE_TEST_CASE_P | ( | tls | , |
| blocked_mode_client_ssl | , | ||
| testing::Values(TLS1_2_VERSION) | ) |
| TEST | ( | blocked_mode_client | , |
| disconnect_is_idempotent_after_peer_close | ) |
| TEST | ( | blocked_mode_client | , |
| eof_marks_disconnected_and_allows_reconnect | ) |
| TEST | ( | blocked_mode_client | , |
| peer_eof_detected_before_reuse | ) |
| TEST | ( | blocked_mode_client | , |
| shutdown_aborts_blocked_connect | ) |
| TEST | ( | blocked_mode_client | , |
| shutdown_aborts_blocked_recv | ) |
| TEST | ( | blocked_mode_client | , |
| shutdown_aborts_blocked_recv_from_signal_handler | ) |
| TEST | ( | blocked_mode_client | , |
| shutdown_aborts_stalled_ssl_handshake | ) |
| TEST | ( | blocked_mode_client | , |
| shutdown_is_permanent | ) |
| TEST | ( | dandelionpp_map | , |
| dropped_all_connections | ) |
| TEST | ( | dandelionpp_map | , |
| dropped_connection | ) |
| TEST | ( | dandelionpp_map | , |
| dropped_connection_remapped | ) |
| TEST | ( | dandelionpp_map | , |
| empty | ) |
| TEST | ( | dandelionpp_map | , |
| traits | ) |
| TEST | ( | dandelionpp_map | , |
| zero_stems | ) |
| TEST | ( | get_network_address | , |
| i2p | ) |
| TEST | ( | get_network_address | , |
| ipv4 | ) |
| TEST | ( | get_network_address | , |
| ipv4subnet | ) |
| TEST | ( | get_network_address | , |
| onion | ) |
| TEST | ( | get_network_address_host_and_port | , |
| hostname | ) |
| TEST | ( | get_network_address_host_and_port | , |
| ipv4 | ) |
| TEST | ( | get_network_address_host_and_port | , |
| ipv6 | ) |
| TEST | ( | host | , |
| canonicalize_host | ) |
| TEST | ( | i2p_address | , |
| boost_serialize_b32 | ) |
| TEST | ( | i2p_address | , |
| boost_serialize_unknown | ) |
| TEST | ( | i2p_address | , |
| constants | ) |
| TEST | ( | i2p_address | , |
| epee_serialize_unknown | ) |
| TEST | ( | i2p_address | , |
| epee_serializev_b32 | ) |
| TEST | ( | i2p_address | , |
| generic_network_address | ) |
| TEST | ( | i2p_address | , |
| invalid | ) |
| TEST | ( | i2p_address | , |
| unblockable_types | ) |
| TEST | ( | i2p_address | , |
| valid | ) |
| TEST | ( | scheme_and_authority | , |
| basic | ) |
| TEST | ( | socks_client | , |
| connect_command | ) |
| TEST | ( | socks_client | , |
| connect_command_failed | ) |
| TEST | ( | socks_client | , |
| no_command | ) |
| TEST | ( | socks_client | , |
| resolve_command | ) |
| TEST | ( | socks_client | , |
| unsupported_command | ) |
| TEST | ( | socks_client | , |
| v5_ipv4_connect_command_failed | ) |
| TEST | ( | socks_client | , |
| v5_ipv6_connect_command | ) |
| TEST | ( | socks_client | , |
| v5_username_host_connect | ) |
| TEST | ( | socks_client | , |
| v5_usernameskipped_host_connect | ) |
| TEST | ( | socks_connector | , |
| error | ) |
| TEST | ( | socks_connector | , |
| host | ) |
| TEST | ( | socks_connector | , |
| ipv4 | ) |
| TEST | ( | socks_connector | , |
| timeout | ) |
| TEST | ( | socks_endpoint | , |
| get | ) |
| TEST | ( | tor_address | , |
| boost_serialize_unknown | ) |
| TEST | ( | tor_address | , |
| boost_serialize_v2 | ) |
| TEST | ( | tor_address | , |
| boost_serialize_v3 | ) |
| TEST | ( | tor_address | , |
| constants | ) |
| TEST | ( | tor_address | , |
| epee_serialize_unknown | ) |
| TEST | ( | tor_address | , |
| epee_serializev_v2 | ) |
| TEST | ( | tor_address | , |
| epee_serializev_v3 | ) |
| TEST | ( | tor_address | , |
| generic_network_address | ) |
| TEST | ( | tor_address | , |
| invalid | ) |
| TEST | ( | tor_address | , |
| unblockable_types | ) |
| TEST | ( | tor_address | , |
| valid | ) |
| TEST | ( | uri_components | , |
| get | ) |
| TEST | ( | user_and_pass | , |
| basic | ) |
| TEST | ( | userinfo_and_hostport | , |
| basic | ) |
| TEST | ( | zmq | , |
| error_codes | ) |
| TEST | ( | zmq | , |
| read_write | ) |
| TEST | ( | zmq | , |
| read_write_multipart | ) |
| TEST | ( | zmq | , |
| read_write_slice | ) |
| TEST | ( | zmq | , |
| read_write_termination | ) |
| TEST | ( | zmq | , |
| write_slice_fail | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| abrupt_eof_detected_before_reuse | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| close_notify_detected_before_reuse | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| data_before_close_notify_is_preserved | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| disconnect_after_abrupt_eof_is_idempotent | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| disconnect_after_peer_eof_is_graceful | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| disconnect_after_shutdown_does_not_wait_for_peer | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| disconnect_with_pending_probe_is_graceful | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| idle_probe_allows_request_and_response | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| partial_record_does_not_block | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| preserves_unread_data | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| reconnect_with_pending_probe | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| recv_n_preserves_probe_byte_and_count | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| recv_n_returns_false_on_eof_after_probe_byte | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| recv_times_out_with_pending_probe | ) |
| TEST_P | ( | blocked_mode_client_ssl | , |
| shutdown_aborts_pending_probe | ) |