Skip to content

Commit

Permalink
fix typo in test condition (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc authored May 11, 2023
1 parent b811ee5 commit 0e4444e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[packages]
exceptiongroup = "1.1.1"
pexpect = "4.8.0"
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"
exceptiongroup = "1.1.1"
pytest-dotenv = "0.5.2"
flask = "2.2.3"
pytimeparse = "1.1.8"
psutil = "5.9.5"
Expand Down
3 changes: 1 addition & 2 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ check_ipset() {
gen_apikey() {
if command -v cscli >/dev/null; then
msg succ "cscli found, generating bouncer api key."
unique=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 8)
bouncer_id="$BOUNCER_PREFIX-$unique"
bouncer_id="$BOUNCER_PREFIX-$(date +%s)"
API_KEY=$(cscli -oraw bouncers add "$bouncer_id")
echo "$bouncer_id" > "$CONFIG.id"
msg info "API Key: $API_KEY"
Expand Down
4 changes: 3 additions & 1 deletion test/install/with_crowdsec/test_crowdsec_deb.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_deb_install_purge(deb_package_path, bouncer_under_test, must_be_root):
cfg = yaml.safe_load(f)
api_key = cfg['api_key']
# the api key has been set to a random value
assert api_key == zxcvbn(api_key)['score'] == 4
assert zxcvbn(api_key)['score'] == 4

with open(config+'.id') as f:
bouncer_name = f.read().strip()
Expand Down Expand Up @@ -126,6 +126,8 @@ def test_deb_install_purge_yaml_local(deb_package_path, bouncer_under_test, must
merged_config = yaml.safe_load(p)
assert merged_config['api_key'] == '123456'

os.unlink(config.with_suffix('.yaml.local'))

p = subprocess.run(
['dpkg', '--purge', package_name],
stdout=subprocess.PIPE,
Expand Down

0 comments on commit 0e4444e

Please sign in to comment.