From 7113916347b635acb2cb2b6e06773e700adce50e Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Thu, 11 Mar 2021 19:37:23 +0200 Subject: [PATCH] Try to test with i2pd: - TestProcessI2P runs minode with i2p args with _connection_limit = 4 - TestProcess waits for connections _wait_time sec (120 for TestProcessI2P) --- minode/tests/test_process.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/minode/tests/test_process.py b/minode/tests/test_process.py index 29726c5..b3fedfd 100644 --- a/minode/tests/test_process.py +++ b/minode/tests/test_process.py @@ -1,6 +1,7 @@ """Blind tests, starting the minode process""" import unittest import signal +import socket import subprocess import sys import tempfile @@ -8,6 +9,12 @@ import time import psutil +try: + socket.socket().bind(('127.0.0.1', 7656)) + i2p_port_free = True +except (OSError, socket.error): + i2p_port_free = False + class TestProcessProto(unittest.TestCase): """Test process attributes, common flow""" @@ -113,3 +120,13 @@ class TestProcess(TestProcessProto): else: if self._listen: self.fail('No listening connection found') + + +@unittest.skipIf(i2p_port_free, 'No running i2pd detected') +class TestProcessI2P(TestProcess): + """Test minode process with --i2p and no IP""" + _process_cmd = ['minode', '--i2p', '--no-ip'] + _connection_limit = 4 + _wait_time = 120 + _listen = True + _listening_port = 8448