Skip to content

Commit e857e9d

Browse files
committed
test: try direct
1 parent 90c8f03 commit e857e9d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

testinfra/test_ami_nix.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -407,38 +407,38 @@ def is_healthy(ssh) -> bool:
407407

408408
# Log Nix profile setup checks
409409
logger.info("Checking Nix profile setup:")
410-
nix_profile_result = host.run("sudo -u postgres ls -la /home/postgres/.nix-profile")
410+
nix_profile_result = host.run("ls -la /home/postgres/.nix-profile")
411411
logger.info(f"Nix profile directory:\n{nix_profile_result.stdout}\n{nix_profile_result.stderr}")
412412

413-
nix_bin_result = host.run("sudo -u postgres ls -la /home/postgres/.nix-profile/bin")
413+
nix_bin_result = host.run("ls -la /home/postgres/.nix-profile/bin")
414414
logger.info(f"Nix profile bin directory:\n{nix_bin_result.stdout}\n{nix_bin_result.stderr}")
415415

416-
nix_script_result = host.run("sudo -u postgres test -x /home/postgres/.nix-profile/bin/switch_pg_cron_version")
416+
nix_script_result = host.run("test -x /home/postgres/.nix-profile/bin/switch_pg_cron_version")
417417
logger.info(f"Switch script executable check: {'success' if not nix_script_result.failed else 'failed'}")
418418

419-
nix_script_output = host.run("sudo -u postgres /home/postgres/.nix-profile/bin/switch_pg_cron_version")
419+
nix_script_output = host.run("/home/postgres/.nix-profile/bin/switch_pg_cron_version")
420420
logger.info(f"Switch script output:\n{nix_script_output.stdout}\n{nix_script_output.stderr}")
421421

422422
if systemd_status.failed:
423423
logger.error("PostgreSQL systemd service is not active")
424424
logger.error(f"systemd status: {systemd_status.stdout}")
425425
logger.error(f"systemd error: {systemd_status.stderr}")
426-
426+
427427
# Check systemd service unit file
428428
logger.error("PostgreSQL systemd service unit file:")
429429
result = host.run("sudo systemctl cat postgresql")
430430
logger.error(f"service unit file:\n{result.stdout}\n{result.stderr}")
431-
431+
432432
# Check systemd service environment
433433
logger.error("PostgreSQL systemd service environment:")
434434
result = host.run("sudo systemctl show postgresql")
435435
logger.error(f"service environment:\n{result.stdout}\n{result.stderr}")
436-
436+
437437
# Check systemd service dependencies
438438
logger.error("PostgreSQL systemd service dependencies:")
439439
result = host.run("sudo systemctl list-dependencies postgresql")
440440
logger.error(f"service dependencies:\n{result.stdout}\n{result.stderr}")
441-
441+
442442
# Check if service is enabled
443443
logger.error("PostgreSQL service enabled status:")
444444
result = host.run("sudo systemctl is-enabled postgresql")

0 commit comments

Comments
 (0)