Chef Serverspec should not listen

176 Views Asked by At

From this link I could see http://serverspec.org/resource_types.html#port

describe port(80) do
  it { should be_listening }
end

I wanted to test the negative of it. Say I disabled a port and I don't want anything listening to that port.

What should be the correct test case?

Just starting out with kitchen serverspec test

1

There are 1 best solutions below

0
On BEST ANSWER

it should be like:-

describe port(80) do
  it { should_not be_listening }
end

you can refer in same doc: http://serverspec.org/resource_types.html#x509_private_key