Mark Estrada
Mark Estrada

Reputation: 9201

Chef Serverspec should not listen

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

Upvotes: 0

Views: 153

Answers (1)

Mrigesh Priyadarshi
Mrigesh Priyadarshi

Reputation: 948

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

Upvotes: 2

Related Questions