Skip to content

Commit

Permalink
DELETE ME
Browse files Browse the repository at this point in the history
Postgres seems to be listening on the expected port, but serverspec
cannot connect to it?

Attempt to do some connections to see if it is a serverspec bug or
an issue with the module.
  • Loading branch information
smortex committed Apr 17, 2024
1 parent 22d05a5 commit fc5ff27
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/acceptance/utf8_encoding_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ class { 'postgresql::server': }
export_locales('en_NG.UTF8')
idempotent_apply(pp, debug: true)
puts '-------------------------------'
pp os
puts '-------------------------------'
puts LitmusHelper.instance.run_shell('ss -lntp').stdout
puts '-------------------------------'
puts LitmusHelper.instance.run_shell('journalctl -u postgresql').stdout
puts '-------------------------------'
puts LitmusHelper.instance.run_shell('systemctl status postgresql*').stdout
puts '-------------------------------'
puts LitmusHelper.instance.run_shell("su postgres -c 'psql -c \\\\l'").stdout
puts '-------------------------------'
puts LitmusHelper.instance.run_shell('true &>/dev/null </dev/tcp/127.0.0.1/5432 && echo open || echo closed').stdout
puts '-------------------------------'
expect(port(5432)).to be_listening.on('127.0.0.1').with('tcp')
expect(psql('--command="\l" postgres', 'postgres').stdout).to match(%r{List of databases})
expect(psql('--command="SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE datname=\'template1\'"').stdout).to match(%r{UTF8})
Expand Down

0 comments on commit fc5ff27

Please sign in to comment.