Opened 5 years ago

Closed 5 months ago

#15999 closed enhancement (duplicate)

End-to-end integ test for hidden service

Reported by: atagar Owned by: atagar
Priority: Low Milestone:
Component: Archived/Stem Version:
Severity: Normal Keywords: testing
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


While adding support for ephemeral hidden services I tried to add a end-to-end integ test without success. Ideally the test would create a new hidden service, then use tor to retrieve its content.

Really shouldn't be a big whoop. We have a tutorial for something similar after all. But for some reason even the tutorial wasn't working for me (hidden service was inaccessible)...

  def test_using_ephemeral_hidden_services(self):
    Create and use a live ephemeral hidden service.

    # TODO: Not having success getting... well, just about any damn hidden
    # serivce working. Even our prior tutorial is failing right now. >:(


    with test.runner.get_runner().get_tor_controller() as controller:
      incoming_address = None, None 

      def run_server():
        serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        serversocket.bind(('localhost', 4567))
        incoming_socket, incoming_address = serversocket.accept()
        incoming_socket.write('hello world')

      server_thread = threading.Thread(target = run_server)

      response = controller.create_ephemeral_hidden_service({80: 4567})

      with[0]) as s:
        s.connect(('%s.onion' % response.service_id, 80)) 

      self.assertTrue(incoming_address is not None)


Child Tickets

Change History (3)

comment:1 Changed 2 years ago by teor

Severity: Normal

Set all open tickets without a severity to "Normal"

comment:2 Changed 12 months ago by 0xrichard

Tests for this are included in

comment:3 Changed 5 months ago by atagar

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.