2023-02-20 13:55:56 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2023-02-28 16:49:32 +00:00
|
|
|
from pytest_cs import Status
|
2023-02-20 13:55:56 +00:00
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
pytestmark = pytest.mark.docker
|
|
|
|
|
|
|
|
|
|
|
|
def test_no_agent(crowdsec, flavor):
|
|
|
|
"""Test DISABLE_LOCAL_API=true (failing stand-alone container)"""
|
|
|
|
env = {
|
|
|
|
'DISABLE_LOCAL_API': 'true',
|
|
|
|
}
|
|
|
|
|
|
|
|
# if an alternative lapi url is not defined, the container should exit
|
|
|
|
|
2023-02-28 16:49:32 +00:00
|
|
|
with crowdsec(flavor=flavor, environment=env, wait_status=Status.EXITED) as cs:
|
|
|
|
cs.wait_for_log("*dial tcp 0.0.0.0:8080: connect: connection refused*")
|