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

Processes resource doesn't handle user or state #295

Closed
thomascate opened this issue Dec 4, 2015 · 2 comments
Closed

Processes resource doesn't handle user or state #295

thomascate opened this issue Dec 4, 2015 · 2 comments
Labels
Type: Bug Feature not working as expected
Milestone

Comments

@thomascate
Copy link
Contributor

Testing on Ubuntu 14.04 and OSX 10.10.5 with the following code

Ubuntu

describe processes('init') do
  its('user') { should eq 'root' }
  its('list.length') { should eq 1 }
  its('state') { should eq 'R<' }
end

OSX

describe processes('launchd') do
  its('user') { should eq 'root' }
  its('list.length') { should eq 3 }
  its('state') { should eq 'R<' }
end

The process is found and list length returns correctly, however user and state return

Failures:

  1) Processes user
     Failure/Error: inner_subject.send(attr)

     NoMethodError:
       undefined method `user' for Processes:#<Class:0x007f82648669e0>
     # test_spec.rb:2:in `block (2 levels) in load'
     # /Library/Ruby/Gems/2.0.0/gems/inspec-0.9.5/lib/inspec/runner.rb:97:in `run_with'
     # /Library/Ruby/Gems/2.0.0/gems/inspec-0.9.5/lib/inspec/runner.rb:93:in `run'
     # /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
     # /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
     # /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
     # /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'

  2) Processes state
     Failure/Error: inner_subject.send(attr)

     NoMethodError:
       undefined method `state' for Processes:#<Class:0x007f82648669e0>
     # test_spec.rb:4:in `block (2 levels) in load'
     # /Library/Ruby/Gems/2.0.0/gems/inspec-0.9.5/lib/inspec/runner.rb:97:in `run_with'
     # /Library/Ruby/Gems/2.0.0/gems/inspec-0.9.5/lib/inspec/runner.rb:93:in `run'
     # /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
     # /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
     # /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
     # /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
@thomascate
Copy link
Contributor Author

Just a note, these tests were done with gem version 0.9.5.

@chris-rock chris-rock added the Type: Bug Feature not working as expected label Dec 6, 2015
@chris-rock
Copy link
Contributor

@thomascate Thanks for catching this bug!

@srenatus srenatus self-assigned this Dec 7, 2015
srenatus added a commit that referenced this issue Dec 7, 2015
this addresses #295. will add the other items (or rather refactor) after
we discussed this solution.
srenatus added a commit that referenced this issue Dec 7, 2015
this addresses #295. will add the other items (or rather refactor) after
we discussed this solution.
srenatus added a commit that referenced this issue Dec 7, 2015
processes('bash').user will be non-nil iff the process owner of each
process is the same. Analogous for processes('bash').state.

These are the only two attributes where asking for them to be unique
among multiple processes makes sense.

The attributes 'users' and 'states' expose the values corresponding to
that property of each entry in the process list.

Fixes #295.
srenatus added a commit that referenced this issue Dec 7, 2015
processes('bash').user will be non-nil iff the process owner of each
process is the same. Analogous for processes('bash').state.

These are the only two attributes where asking for them to be unique
among multiple processes makes sense.

The attributes 'users' and 'states' expose the values corresponding to
that property of each entry in the process list.

Fixes #295.
srenatus added a commit that referenced this issue Dec 7, 2015
processes('bash').user will be non-nil iff the process owner of each
process is the same. Analogous for processes('bash').state.

These are the only two attributes where asking for them to be unique
among multiple processes makes sense.

The attributes 'users' and 'states' expose the values corresponding to
that property of each entry in the process list.

Fixes #295.
srenatus added a commit that referenced this issue Dec 7, 2015
processes('bash').user will be non-nil iff the process owner of each
process is the same. Analogous for processes('bash').state.

These are the only two attributes where asking for them to be unique
among multiple processes makes sense.

The attributes 'users' and 'states' expose the values corresponding to
that property of each entry in the process list.

Fixes #295.
@arlimus arlimus added this to the 0.9.6 milestone Dec 7, 2015
srenatus added a commit that referenced this issue Dec 8, 2015
processes('bash').user will be non-nil iff the process owner of each
process is the same. Analogous for processes('bash').state.

These are the only two attributes where asking for them to be unique
among multiple processes makes sense.

The attributes 'users' and 'states' expose the values corresponding to
that property of each entry in the process list.

Fixes #295.
srenatus added a commit that referenced this issue Dec 8, 2015
processes('bash').user does not actually make much sense for a resource
that is a list -- different entries can belong to different users.
Analogous for processes('bash').state.

The attributes 'users' and 'states' expose the unique values
corresponding to that property of entries in the process list.

Fixes #295.
srenatus added a commit that referenced this issue Dec 8, 2015
processes('bash').user does not actually make much sense for a resource
that is a list -- different entries can belong to different users.
Analogous for processes('bash').state.

The attributes 'users' and 'states' expose the unique values
corresponding to that property of entries in the process list.

Fixes #295.
srenatus added a commit that referenced this issue Dec 8, 2015
processes('bash').user does not actually make much sense for a resource
that is a list -- different entries can belong to different users.
Analogous for processes('bash').state.

The attributes 'users' and 'states' expose the unique values
corresponding to that property of entries in the process list.

Fixes #295.
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

4 participants