tribler.test_integration.test_hidden_services

Attributes

DOWNLOADER

SEEDER

RELAYS

EXITS

Classes

GlobalTestSettings

Keep track of a global node identifier.

MockDownloadManager

Mocked manager that always allows shutdown (regardless of the libtorrent state).

MockExitDict

Wrap all exit sockets in a mock.

TestHiddenServicesDownload

An integration test for anonymous downloads.

Module Contents

tribler.test_integration.test_hidden_services.DOWNLOADER = 0
tribler.test_integration.test_hidden_services.SEEDER = 1
tribler.test_integration.test_hidden_services.RELAYS = [2, 3, 4]
tribler.test_integration.test_hidden_services.EXITS = [5, 6]
class tribler.test_integration.test_hidden_services.GlobalTestSettings

Bases: ipv8.community.CommunitySettings

Keep track of a global node identifier.

node_id: int = 0
class tribler.test_integration.test_hidden_services.MockDownloadManager

Bases: tribler.core.libtorrent.download_manager.download_manager.DownloadManager

Mocked manager that always allows shutdown (regardless of the libtorrent state).

is_shutdown_ready() bool

Always ready.

class tribler.test_integration.test_hidden_services.MockExitDict

Bases: dict

Wrap all exit sockets in a mock.

__getitem__(key: int) ipv8.test.mocking.exit_socket.MockTunnelExitSocket

Get the exit socket belonging to a given circuit id.

class tribler.test_integration.test_hidden_services.TestHiddenServicesDownload

Bases: ipv8.test.base.TestBase[tribler.core.tunnel.community.TriblerTunnelCommunity]

An integration test for anonymous downloads.

MAX_TEST_TIME = 90
setUp() None

Create the necessary tunnel communities.

async tearDown() None

Tear down all communities and the download managers.

create_node(settings: ipv8.community.CommunitySettings | None = None, create_dht: bool = False, enable_statistics: bool = False) ipv8.test.mocking.ipv8.MockIPv8

Create a downloader, relay, or exit node.

The seeder does not have an overlay!

async start_socks_servers() None

Start the socks servers.

async add_mock_download_config(manager: tribler.core.libtorrent.download_manager.download_manager.DownloadManager, hops: int) tribler.core.libtorrent.download_manager.download_config.DownloadConfig

Create a mocked DownloadConfig.

async start_seeding() bytes

Create a file and start the seeding.

async start_anon_download(infohash: bytes) tribler.core.libtorrent.download_manager.download.Download

Start an anonymous download in the main Tribler session.

start_rust() None

Add Rust endpoints to all IPv8 nodes. Should be called after the event loop has started.

async test_hidden_services() None

Test an e2e anonymous download.