Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `max_connections' for PostgreSQL #825

Closed
atomic111 opened this issue Jul 12, 2016 · 1 comment
Closed

undefined method `max_connections' for PostgreSQL #825

atomic111 opened this issue Jul 12, 2016 · 1 comment
Labels
Type: Bug Feature not working as expected

Comments

@atomic111
Copy link
Contributor

Description

I add the following test to my inspec profile:

control 'postgres-12' do
  impact 1.0
  title 'Define max client connections'
  desc 'Define max client connections'
  describe postgres_conf do
    its('max_connections') { should eq '100' }
  end
end

and got the error:

postgres-12: Define max client connections (1 failed)
undefined method `max_connections' for PostgreSQL Configuration:Inspec::Resource::Registry::PostgresConf

I execute the test with:

inspec exec test/integration -t ssh://ubuntu@127.0.0.1 --port 2200 --key-files /home/user/projekte/chef_cookbooks/chef-postgres-hardening/.kitchen/kitchen-vagrant/kitchen-chef-postgres-hardening-default-ubuntu-1604/.vagrant/machines/default/virtualbox/private_key --sudo

If i execute the test within the inspec shell like this:
postgres_conf.params['max_connections'].eql?'100' I get the expected result:

inspec> postgres_conf.params['max_connections'].eql?'100'
=> true

InSpec and Platform Version

inspec version 0.27.0

Replication Case

I started the ubuntu 16.04 (https://atlas.hashicorp.com/ubuntu/boxes/xenial64/versions/20160627.0.0/providers/virtualbox.box)

I applied the chef-postgres-hardening cookbook. I can provide you access to my fork of the chef-postgres-hardening. Because i am switching the tests from serverspec to inspec for the project.

@chris-rock chris-rock added the Type: Bug Feature not working as expected label Jul 25, 2016
@chris-rock
Copy link
Contributor

This issue has been fixes and is available with the next version of InSpec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Feature not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants