Serverspec プロセスが起動していることをテストする

環境
Serverspec
RHEL8.6

構文

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
describe process("プロセス名t") do
it { should be_running }
end
describe process("プロセス名t") do it { should be_running } end
describe process("プロセス名t") do
  it { should be_running }
end

processを利用してプロセスとして起動しているかを検証できます

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
describe process("amazon-ssm-agent") do
it { should be_running }
end
describe process("amazon-ssm-agent") do it { should be_running } end
describe process("amazon-ssm-agent") do
  it { should be_running }
end

 

Serverspec

Posted by arkgame