Skip to content

Commit

Permalink
Reduce the amount of HA services, and increase the pause
Browse files Browse the repository at this point in the history
  • Loading branch information
palfrey committed Apr 3, 2024
1 parent e747676 commit 8696698
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions integration_tests/config/configuration.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
default_config:

ban_allowlist:
ip_addresses: {{ ALLOWLIST }}

Expand All @@ -8,6 +6,9 @@ http:
login_attempts_threshold: 1

logger:
default: warning
default: info
logs:
custom_components.ban_allowlist: debug

api:
frontend:
9 changes: 5 additions & 4 deletions integration_tests/test_banning_works.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ def configure_ha(allowlist: list[str]) -> None:
config_out.write(configuration_template.render(ALLOWLIST=allowlist))

subprocess.check_call(["docker-compose", "down"])
if ban_ip_path.exists():
ban_ip_path.unlink()

for dirpath, dirnames, filenames in config_folder.walk(top_down=True):
if "custom_components" in dirnames:
Expand Down Expand Up @@ -100,7 +98,9 @@ def configure_ha(allowlist: list[str]) -> None:
env={**os.environ, "UID": str(os.getuid()), "GID": str(os.getgid())},
)
wait_for_http(8123)
time.sleep(1)

# FIXME: check for actually up, as opposed to waiting "probably long enough"
time.sleep(5)


def check_res(expected_results: list[int]):
Expand All @@ -111,7 +111,8 @@ def check_res(expected_results: list[int]):
"""
try:
for index in range(len(expected_results)):
# Tried less terrible URLS (e.g. just /api/) and they don't seem to reliably work
# Tried less terrible URLs and they don't seem to reliably work
# Or like /api/ just always give 403s
# This one to a generally non-existant login flow, seems to work reliably
res = requests.post(
"http://localhost:8123/auth/login_flow/b4b20b5004a6baa2a1d903de46886ed2",
Expand Down

0 comments on commit 8696698

Please sign in to comment.