Server should_notの使い方のサンプル

環境
AlmaLinux release 9.2 (Turquoise Kodkod)
Serverspec

構文

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
describe service('サービス名') do
it { should_not be_running }
it { should_not be_enabled }
end
describe service('サービス名') do it { should_not be_running } it { should_not be_enabled } end
describe service('サービス名') do
 it { should_not be_running }
  it { should_not be_enabled }
end

インストールされていないことを確認するには、should_notを使います。

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
describe service('iptables') do
it { should_not be_running }
it { should_not be_enabled }
end
describe service('iptables') do it { should_not be_running } it { should_not be_enabled } end
describe service('iptables') do
  it { should_not be_running }
  it { should_not be_enabled }
end

 

Ansible

Posted by arkgame