Agent: Add control client proxies to tunnel telem initialization

This commit is contained in:
Ilija Lazoroski 2022-06-13 12:55:41 +02:00 committed by vakarisz
parent 799ff3d6fd
commit fb1a577823
3 changed files with 6 additions and 5 deletions

View File

@ -167,7 +167,7 @@ class InfectionMonkey:
self._monkey_inbound_tunnel.start()
StateTelem(is_done=False, version=get_version()).send()
TunnelTelem().send()
TunnelTelem(self.cc_client.proxies).send()
self._build_master()

View File

@ -1,15 +1,16 @@
from typing import Mapping
from common.common_consts.telem_categories import TelemCategoryEnum
from infection_monkey.control import ControlClient
from infection_monkey.telemetry.base_telem import BaseTelem
class TunnelTelem(BaseTelem):
def __init__(self):
def __init__(self, proxy: Mapping[str, str]):
"""
Default tunnel telemetry constructor
"""
super(TunnelTelem, self).__init__()
self.proxy = ControlClient.proxies.get("https")
self.proxy = proxy.get("https")
telem_category = TelemCategoryEnum.TUNNEL

View File

@ -7,7 +7,7 @@ from infection_monkey.telemetry.tunnel_telem import TunnelTelem
@pytest.fixture
def tunnel_telem_test_instance():
return TunnelTelem()
return TunnelTelem({})
def test_tunnel_telem_send(tunnel_telem_test_instance, spy_send_telemetry):