Skip to content

Commit

Permalink
CI: test variable expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Mar 11, 2024
1 parent 01c55f0 commit f0fa642
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
4 changes: 1 addition & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ import (
"golang.org/x/exp/slices"
"golang.org/x/sync/errgroup"

"github.com/crowdsecurity/crowdsec/pkg/models"
csbouncer "github.com/crowdsecurity/go-cs-bouncer"
"github.com/crowdsecurity/go-cs-lib/csdaemon"
"github.com/crowdsecurity/go-cs-lib/csstring"
"github.com/crowdsecurity/go-cs-lib/version"


"github.com/crowdsecurity/crowdsec/pkg/models"

"github.com/crowdsecurity/cs-firewall-bouncer/pkg/backend"
"github.com/crowdsecurity/cs-firewall-bouncer/pkg/cfg"
"github.com/crowdsecurity/cs-firewall-bouncer/pkg/metrics"
Expand Down
17 changes: 17 additions & 0 deletions test/bouncer/test_yaml_local.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os


def test_yaml_local(bouncer, fw_cfg_factory):
cfg = fw_cfg_factory()
Expand All @@ -21,3 +23,18 @@ def test_yaml_local(bouncer, fw_cfg_factory):
])
fw.proc.wait(timeout=0.2)
assert not fw.proc.is_running()

# variable expansion

config_local = {
'mode': '$BOUNCER_MODE'
}

os.environ['BOUNCER_MODE'] = 'fromenv'

with bouncer(cfg, config_local=config_local) as fw:
fw.wait_for_lines_fnmatch([
"*firewall 'fromenv' is not supported*",
])
fw.proc.wait(timeout=0.2)
assert not fw.proc.is_running()

0 comments on commit f0fa642

Please sign in to comment.