mirror of
https://github.com/crowdsecurity/cs-firewall-bouncer.git
synced 2024-08-19 01:18:49 +03:00
test .yaml.local (#269)
This commit is contained in:
2
Pipfile
2
Pipfile
@@ -1,5 +1,5 @@
|
||||
[packages]
|
||||
pytest-cs = {ref = "0.7.14", git = "https://github.com/crowdsecurity/pytest-cs.git"}
|
||||
pytest-cs = {ref = "0.7.15", git = "https://github.com/crowdsecurity/pytest-cs.git"}
|
||||
pytest-dotenv = "0.5.2"
|
||||
pytest-dependency = "0.5.1"
|
||||
pexpect = "4.8.0"
|
||||
|
||||
4
Pipfile.lock
generated
4
Pipfile.lock
generated
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "d08dab481f1fc73b002ef4bde1d64d19638faf31314dca9c25c73894cef58ec6"
|
||||
"sha256": "ddd1ae2f37f2d88866a7605de0d8774c71a1311497032339bebec6c2daea0607"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
@@ -395,7 +395,7 @@
|
||||
},
|
||||
"pytest-cs": {
|
||||
"git": "https://github.com/crowdsecurity/pytest-cs.git",
|
||||
"ref": "4bf6f42da3332104b709709202de81eb86d0f025"
|
||||
"ref": "e146c11a6024f5156e590f25483d822badea6bb3"
|
||||
},
|
||||
"pytest-datadir": {
|
||||
"hashes": [
|
||||
|
||||
21
test/bouncer/test_yaml_local.py
Normal file
21
test/bouncer/test_yaml_local.py
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
def test_yaml_local(bouncer, fw_cfg_factory):
|
||||
cfg = fw_cfg_factory()
|
||||
|
||||
with bouncer(cfg) as fw:
|
||||
fw.wait_for_lines_fnmatch([
|
||||
"*unable to load configuration: config does not contain 'mode'*",
|
||||
])
|
||||
fw.proc.wait(timeout=0.2)
|
||||
assert not fw.proc.is_running()
|
||||
|
||||
config_local = {
|
||||
'mode': 'whatever'
|
||||
}
|
||||
|
||||
with bouncer(cfg, config_local=config_local) as fw:
|
||||
fw.wait_for_lines_fnmatch([
|
||||
"*firewall 'whatever' is not supported*",
|
||||
])
|
||||
fw.proc.wait(timeout=0.2)
|
||||
assert not fw.proc.is_running()
|
||||
Reference in New Issue
Block a user