You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
control 'port-param-by-number' do
impact 1.0
title 'ssh should listen on port 22, if parameter provided is as number'
describe port(22) do
it { should be_listening }
its('processes') {should include 'sshd'}
end
end
control 'port-param-by-string' do
impact 1.0
title 'ssh should listen on port 22, if parameter provided is as string'
describe port('22') do
it { should be_listening }
its('processes') {should include 'sshd'}
end
end
Possible Solutions
convert string to integer, sanitize it is a valid port number
Stacktrace
used port('3389'), and thus weird response:
✖ xrdp: xrdp should be listening on 3389 (2 failed)
fail: expected `Port 3389.listening?` to return true, got false
fail: expected [] to include "xrdp"
changed to port(3389) and it worked as expected.
The text was updated successfully, but these errors were encountered:
I'm sorry I'm not a ruby dev and I'm unfortunately not having enough time to learn thoroughly ruby to commit patches. It's on my todo list but you know, I'm having already enough ops problems ;)
This allows the user to write:
describe port(22) do
it { should be_listening }
end
as well as
describe port('22') do
it { should be_listening }
end
without hitting an error.
Fixes#867
Signed-off-by: Steven Danna <[email protected]>
This allows the user to write:
describe port(22) do
it { should be_listening }
end
as well as
describe port('22') do
it { should be_listening }
end
without hitting an error.
Fixes#867
Signed-off-by: Steven Danna <[email protected]>
Description
port() should accept string and try to convert it to integer, so:
port(123)
and
port('123')
would be equal
InSpec and Platform Version
0.28.0
Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily
Replication Case
Possible Solutions
convert string to integer, sanitize it is a valid port number
Stacktrace
used port('3389'), and thus weird response:
changed to port(3389) and it worked as expected.
The text was updated successfully, but these errors were encountered: