latest.ipv8.test.messaging.anonymization.test_hiddenservices

Module Contents

Classes

TestHiddenServices

Tests related to the HiddenTunnelCommunity.

class latest.ipv8.test.messaging.anonymization.test_hiddenservices.TestHiddenServices(methodName: str = 'runTest')

Bases: latest.ipv8.test.base.TestBase[latest.ipv8.messaging.anonymization.hidden_services.HiddenTunnelCommunity]

Tests related to the HiddenTunnelCommunity.

setUp() None

Set up three nodes and keep track of nodes that should remain hidden from other nodes.

async tearDown() None

Make sure to also tear down our hidden nodes.

get_e2e_circuit_path() list[tuple[latest.ipv8.types.Address, latest.ipv8.messaging.anonymization.tunnel.RoutingObject]] | None

Return the e2e circuit information which is extracted from the nodes. Useful for debugging purposes or to verify whether the e2e circuit is correctly established.

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

Initialize a HiddenTunnelCommunity without circuits or exit node functionality.

async create_intro(node_nr: int, service: bytes, required_ip: latest.ipv8.peer.Peer | None = None) None

Create an 1 hop introduction point for some node for some service.

async assign_exit_node(node_nr: int) None

Give a node a dedicated exit node to play with.

async test_create_introduction_point() None

Check if setting up an introduction point works. Some node, other than the instigator, should be assigned as the intro point.

async test_dht_lookup_with_counterparty() None

Check if a DHT lookup works.

Steps:
  1. Create an introduction point

  2. Do a DHT lookup

  3. Create a rendezvous point

  4. Link the circuit e2e

  5. Callback the service handler

  6. Send data

  7. Remove circuits

async test_dht_lookup_no_counterparty() None

Check if a DHT lookup doesn’t return on its own required service. Ergo, no self-introduction.

async test_dht_lookup_failure() None

Check that if a DHT lookup fails, it will retry during the next do_peer_discovery call.

async test_pex_lookup() None

Check if peers lookups succeed through the pex communities.

async test_pex_lookup_exit_is_ip() None

Check if peers lookups succeed through the pex communities if the exit is the introduction point.

async test_test_request_e2e() None

Check if sending test-request messages over an e2e circuit works as expected.