forked from p15670423/monkey
Agent: Rename EVENTS_API_URL to AGENT_EVENTS_API_URL
This commit is contained in:
parent
dd2ed50609
commit
998c1d7a4f
|
@ -14,7 +14,7 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
DEFAULT_TIME_PERIOD_SECONDS = 5
|
DEFAULT_TIME_PERIOD_SECONDS = 5
|
||||||
EVENTS_API_URL = "https://%s/api/agent-events"
|
AGENT_EVENTS_API_URL = "https://%s/api/agent-events"
|
||||||
|
|
||||||
|
|
||||||
class AgentEventForwarder:
|
class AgentEventForwarder:
|
||||||
|
@ -86,7 +86,7 @@ class BatchingAgentEventForwarder:
|
||||||
try:
|
try:
|
||||||
logger.debug(f"Sending Agent events to Island at {self._server_address}: {events}")
|
logger.debug(f"Sending Agent events to Island at {self._server_address}: {events}")
|
||||||
requests.post( # noqa: DUO123
|
requests.post( # noqa: DUO123
|
||||||
EVENTS_API_URL % (self._server_address,),
|
AGENT_EVENTS_API_URL % (self._server_address,),
|
||||||
json=events,
|
json=events,
|
||||||
verify=False,
|
verify=False,
|
||||||
timeout=MEDIUM_REQUEST_TIMEOUT,
|
timeout=MEDIUM_REQUEST_TIMEOUT,
|
||||||
|
|
|
@ -3,7 +3,7 @@ import time
|
||||||
import pytest
|
import pytest
|
||||||
import requests_mock
|
import requests_mock
|
||||||
|
|
||||||
from infection_monkey.agent_event_forwarder import EVENTS_API_URL, BatchingAgentEventForwarder
|
from infection_monkey.agent_event_forwarder import AGENT_EVENTS_API_URL, BatchingAgentEventForwarder
|
||||||
|
|
||||||
SERVER = "1.1.1.1:9999"
|
SERVER = "1.1.1.1:9999"
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ def event_sender():
|
||||||
|
|
||||||
def test_send_events(event_sender):
|
def test_send_events(event_sender):
|
||||||
with requests_mock.Mocker() as mock:
|
with requests_mock.Mocker() as mock:
|
||||||
mock.post(EVENTS_API_URL % SERVER)
|
mock.post(AGENT_EVENTS_API_URL % SERVER)
|
||||||
|
|
||||||
event_sender.start()
|
event_sender.start()
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ def test_send_events(event_sender):
|
||||||
|
|
||||||
def test_send_remaining_events(event_sender):
|
def test_send_remaining_events(event_sender):
|
||||||
with requests_mock.Mocker() as mock:
|
with requests_mock.Mocker() as mock:
|
||||||
mock.post(EVENTS_API_URL % SERVER)
|
mock.post(AGENT_EVENTS_API_URL % SERVER)
|
||||||
|
|
||||||
event_sender.start()
|
event_sender.start()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue