Skip to content

Commit

Permalink
chore: checks
Browse files Browse the repository at this point in the history
  • Loading branch information
samrose committed Jan 24, 2025
1 parent 56b6bb4 commit f6452c9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions testinfra/test_ami_nix.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,17 @@ def get_ssh_connection(instance_ip, ssh_identity_file, max_retries=10):
)

def is_healthy(host, instance_ip, ssh_identity_file) -> bool:
postgres_logs = host.run("journalctl -u postgresql")
logger.warning(f"PostgreSQL logs: {postgres_logs.stdout}")
status_checks = [
"dpkg -l | grep postgresql",
"systemctl status postgresql",
"ls -la /var/lib/postgresql",
"ps aux | grep postgres"
]

for check in status_checks:
result = host.run(check)
logger.warning(f"{check} output: {result.stdout}")


health_checks = [
(
Expand Down

0 comments on commit f6452c9

Please sign in to comment.