inspec/controls/example_vm_datadisks.rb
Russell Seymour 93f5dcd072 Corrected rubocop offences
Signed-off-by: Russell Seymour <russell.seymour@turtlesystems.co.uk>
2017-02-17 17:25:30 +00:00

19 lines
589 B
Ruby

title 'Sample profile to test the data disks of a vm'
control 'azure-vm-datadisks-1.0' do
impact 1.0
title 'Ensure that the machine has 1 data disk'
hostname = ENV['AZURE_VM_NAME']
resource_group_name = ENV['AZURE_RESOURCE_GROUP_NAME']
describe azure_vm_datadisks(host: hostname, resource_group: resource_group_name) do
its('has_disks?') { should be true }
its('count') { should eq 1 }
end
describe azure_vm_datadisks(host: hostname, resource_group: resource_group_name).where { disk.zero? and size > 10 } do
its('entries') { should_not be_empty }
end
end