From e6c4fd020fbb6f1124dba7b72ae924c25a57d867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 17 Apr 2024 10:38:48 -1000 Subject: [PATCH] DELETE ME 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. --- spec/acceptance/utf8_encoding_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/acceptance/utf8_encoding_spec.rb b/spec/acceptance/utf8_encoding_spec.rb index 25d868b158..13b8bfc3d9 100644 --- a/spec/acceptance/utf8_encoding_spec.rb +++ b/spec/acceptance/utf8_encoding_spec.rb @@ -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('nc -zv 127.0.0.1 5432').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})