diff --git a/tests/postgres-pghost/.test.sh b/tests/postgres-pghost/.test.sh new file mode 100755 index 000000000..b7eeb4f39 --- /dev/null +++ b/tests/postgres-pghost/.test.sh @@ -0,0 +1,11 @@ +wait_for_port 2345 +psql postgres -c '\q' &> /dev/null + +# Check the exit status of the psql command +if [ $? -eq 0 ]; then + echo "listen_address and PGHOST is valid, connection successful" + exit 0 +else + echo "listen_address and PGHOST is invalid, connection failed" + exit 1 +fi \ No newline at end of file diff --git a/tests/postgres-pghost/devenv.nix b/tests/postgres-pghost/devenv.nix new file mode 100644 index 000000000..59efea59e --- /dev/null +++ b/tests/postgres-pghost/devenv.nix @@ -0,0 +1,10 @@ +{ + services.postgres = { + enable = true; + listen_addresses = "*"; + port = 2345; + initialScript = '' + CREATE USER postgres SUPERUSER; + ''; + }; +}