Skip to content

Commit

Permalink
Use netstat full ip output
Browse files Browse the repository at this point in the history
  • Loading branch information
jubenitezg committed Jul 20, 2023
1 parent 4edc1ea commit 5ca1da8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec/system/security_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
describe 'security' do
describe 'the broker' do
it 'does not listen publicly on the backend_port' do
netstat_output = bosh.ssh(deployment_name, Helpers::Environment::BROKER_INSTANCE_NAME, "netstat -l | grep #{broker_backend_port}")
netstat_output = bosh.ssh(deployment_name, Helpers::Environment::BROKER_INSTANCE_NAME, "netstat -W -l | grep #{broker_backend_port}")
hostname = bosh.ssh(deployment_name, Helpers::Environment::BROKER_INSTANCE_NAME, "hostname")
expect(netstat_output.lines.count).to eq(1)
expect(netstat_output).to include("localhost:#{broker_backend_port}")
expect(netstat_output).to match(/(#{hostname}|localhost):#{broker_backend_port}/)
end
end
end

0 comments on commit 5ca1da8

Please sign in to comment.