mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 20:36:12 +02:00
27 lines
895 B
Python
27 lines
895 B
Python
#!/usr/bin/env python
|
|
|
|
"""
|
|
Test pre-installed hub items.
|
|
"""
|
|
|
|
from http import HTTPStatus
|
|
import json
|
|
|
|
import pytest
|
|
|
|
pytestmark = pytest.mark.docker
|
|
|
|
|
|
def test_preinstalled_hub(crowdsec, flavor):
|
|
"""Test hub objects installed in the entrypoint"""
|
|
with crowdsec(flavor=flavor) as cs:
|
|
cs.wait_for_log("*Starting processing data*")
|
|
cs.wait_for_http(8080, '/health', want_status=HTTPStatus.OK)
|
|
res = cs.cont.exec_run('cscli hub list -o json', stderr=False)
|
|
assert res.exit_code == 0
|
|
j = json.loads(res.output)
|
|
collections = {c['name']: c for c in j['collections']}
|
|
assert collections['crowdsecurity/linux']['status'] == 'enabled'
|
|
parsers = {c['name']: c for c in j['parsers']}
|
|
assert parsers['crowdsecurity/whitelists']['status'] == 'enabled'
|
|
assert parsers['crowdsecurity/docker-logs']['status'] == 'enabled'
|