我是 Chef Inspec 的新手,我想使用 Inspec 代码测试(仅限 Windows)需要重启。下面是我的代码:
# Reboot Required Yes for windows
control 'PowerShellTest' do
impact 0.1
title 'Check powershell code inside inspec'
desc 'TestCase for Powershell'
if os.family == 'windows'
describe command(shutdown /r) do
its('action') { should be 'yes' }
its('stderr') { should eq '' }
its('exit_status') { should eq 0 }
end
end