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

kernel_parameter does not show fully info when test fails #1093

Closed
nvtkaszpir opened this issue Sep 18, 2016 · 1 comment
Closed

kernel_parameter does not show fully info when test fails #1093

nvtkaszpir opened this issue Sep 18, 2016 · 1 comment
Labels
Type: Enhancement Improves an existing feature

Comments

@nvtkaszpir
Copy link
Contributor

Description

When using kernel_parameter in the test and it fails then the message is missing detailed explanation what actually failed - unless you have insanely detailed tests.

InSpec and Platform Version

Tinspec 0.32.0
ubuntu 15.10 testing remotely on 14.04

Replication Case

title 'test kernel_parameter'

control 'test-kernel_parameter-999' do
  impact 1.0
  title 'verify certain settings in sysctl'
  desc 'tuning system/kernel'

  describe kernel_parameter('net.core.somaxconn') do
    its('value') { should be >= 18419238472 } # this should fail some random insane value to make it invalid
  end
  describe kernel_parameter('net.core.somaxconn') do
    its('value') { should be > 100 } # this should pass
  end
end

output:

  ✖  test-kernel_parameter-999: verify certain settings in sysctl (1 failed)
     ✖  expected: >= 18419238472
          got:    128
     ✔  Kernel Parameter net.core.somaxconn value should be > 100

As we can see:

  • first one fails, but does not say that it refers to net.core.somaxconn
  • second test shows that net.core.somaxconn is valid.

Possible Solutions

Verify that kernel_parameter actually shows full output when it fails.

Expected output something like this:

  ✖  test-kernel_parameter-999: verify certain settings in sysctl (1 failed)
     ✖  expected: net.core.somaxconn >= 18419238472
          got:    128
     ✔  Kernel Parameter net.core.somaxconn value should be > 100

Stacktrace

No stacktrace.

@chris-rock chris-rock added the Type: Enhancement Improves an existing feature label Sep 19, 2016
@chris-rock
Copy link
Contributor

@nvtkaszpir that is a very good recommendation for improvement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improves an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants