crowdsec/docker/test/tests/test_nolapi.py
mmetc 301782ae18
Docker tests: use pytest-cs 0.2 (#2079)
* Use pytest-cs 0.2

* fix pipenv cache key

* Cache docker layers

* Load build images from buildx to docker

* CI: commit Pipfile.lock

* Add full docker tag

* Cache only amd64 docker layers

* Cache layer mode=min
2023-02-28 17:49:32 +01:00

20 lines
505 B
Python

#!/usr/bin/env python
from pytest_cs import Status
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
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*")