inspec/examples/example_vm_datadisks.rb
Russell Seymour 9c3cec433f Moved example controls into examples
Added check for the name of hte resource group
#11

Signed-off-by: Russell Seymour <russell.seymour@turtlesystems.co.uk>
2017-02-23 13:32:59 +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