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

port should be_listening busted in 1.17.0? #1602

Closed
lamont-granquist opened this issue Mar 28, 2017 · 2 comments
Closed

port should be_listening busted in 1.17.0? #1602

lamont-granquist opened this issue Mar 28, 2017 · 2 comments

Comments

@lamont-granquist
Copy link
Contributor

this block had been working prior to bumping from 1.16.1 to 1.17.0 (although the comment suggests we've had issues with this in the past?)

# busted inside of docker containers?
describe port(22) do
  it { should be_listening }
  its("protocols") { should include "tcp" }
  its("processes") { should eq ["sshd"] }
end

the listening check seems to be blowing up now:

Failures:
  1) Port 22 should be listening
     Failure/Error: raise InvalidAddressError, "invalid address"
     
     IPAddr::InvalidAddressError:
       invalid address
     # ./vendor/bundle/ruby/2.4.0/gems/inspec-1.17.0/lib/resources/port.rb:301:in `new'
     # ./vendor/bundle/ruby/2.4.0/gems/inspec-1.17.0/lib/resources/port.rb:301:in `parse_net_address'
     # ./vendor/bundle/ruby/2.4.0/gems/inspec-1.17.0/lib/resources/port.rb:335:in `parse_netstat_line'
     # ./vendor/bundle/ruby/2.4.0/gems/inspec-1.17.0/lib/resources/port.rb:275:in `block in info'
     # ./vendor/bundle/ruby/2.4.0/gems/inspec-1.17.0/lib/resources/port.rb:274:in `each_line'
     # ./vendor/bundle/ruby/2.4.0/gems/inspec-1.17.0/lib/resources/port.rb:274:in `info'
     # ./vendor/bundle/ruby/2.4.0/gems/inspec-1.17.0/lib/resources/port.rb:83:in `info'
     # ./vendor/bundle/ruby/2.4.0/gems/inspec-1.17.0/lib/utils/filter.rb:177:in `call'
     # ./vendor/bundle/ruby/2.4.0/gems/inspec-1.17.0/lib/utils/filter.rb:177:in `block (2 levels) in connect'
     # ./test/integration/webapp/default_spec.rb:115:in `block (2 levels) in load_with_context'
     # ./vendor/bundle/ruby/2.4.0/gems/inspec-1.17.0/lib/inspec/runner_rspec.rb:77:in `run'
     # ./vendor/bundle/ruby/2.4.0/gems/inspec-1.17.0/lib/inspec/runner.rb:117:in `run_tests'
     # ./vendor/bundle/ruby/2.4.0/gems/inspec-1.17.0/lib/inspec/runner.rb:101:in `run'
     # ./vendor/bundle/ruby/2.4.0/gems/kitchen-inspec-0.17.0/lib/kitchen/verifier/inspec.rb:94:in `call'
     # ./vendor/bundle/ruby/2.4.0/gems/test-kitchen-1.16.0/lib/kitchen/instance.rb:434:in `block in verify_action'
     # ./vendor/bundle/ruby/2.4.0/gems/test-kitchen-1.16.0/lib/kitchen/instance.rb:527:in `synchronize_or_call'
     # ./vendor/bundle/ruby/2.4.0/gems/test-kitchen-1.16.0/lib/kitchen/instance.rb:489:in `block in action'
     # ./vendor/bundle/ruby/2.4.0/gems/test-kitchen-1.16.0/lib/kitchen/instance.rb:488:in `action'
     # ./vendor/bundle/ruby/2.4.0/gems/test-kitchen-1.16.0/lib/kitchen/instance.rb:426:in `verify_action'
     # ./vendor/bundle/ruby/2.4.0/gems/test-kitchen-1.16.0/lib/kitchen/instance.rb:359:in `block in transition_to'
     # ./vendor/bundle/ruby/2.4.0/gems/test-kitchen-1.16.0/lib/kitchen/instance.rb:358:in `each'
     # ./vendor/bundle/ruby/2.4.0/gems/test-kitchen-1.16.0/lib/kitchen/instance.rb:358:in `transition_to'
     # ./vendor/bundle/ruby/2.4.0/gems/test-kitchen-1.16.0/lib/kitchen/instance.rb:157:in `verify'
     # ./vendor/bundle/ruby/2.4.0/gems/test-kitchen-1.16.0/lib/kitchen/instance.rb:186:in `block in test'
     # ./vendor/bundle/ruby/2.4.0/gems/test-kitchen-1.16.0/lib/kitchen/instance.rb:182:in `test'
     # ./vendor/bundle/ruby/2.4.0/gems/test-kitchen-1.16.0/lib/kitchen/command.rb:197:in `public_send'
     # ./vendor/bundle/ruby/2.4.0/gems/test-kitchen-1.16.0/lib/kitchen/command.rb:197:in `run_action_in_thread'
     # ./vendor/bundle/ruby/2.4.0/gems/test-kitchen-1.16.0/lib/kitchen/command.rb:169:in `block (2 levels) in run_action'

that's from the chef/chef kitchen-tests running under kitchen-dokken on docker containers, ubuntu/debian guests along with centos-7 (but not centos-6) all seem to be busted the same way...

@adamleff
Copy link
Contributor

@lamont-granquist there were definitely some changes to that resource to address some v4/v6 issues, so it looks like we introduced a bug. I'll take a look at this soon.

@adamleff
Copy link
Contributor

Reproduced, PR submitted to properly handle truncated IPs from netstat output. Thanks for bringing this to our attention, @lamont-granquist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants