2017-02-28 14:21:57 +00:00
|
|
|
|
|
|
|
title 'Virtual Machine Data Disks'
|
|
|
|
|
|
|
|
control 'azure-vm-datadisks-1.0' do
|
|
|
|
|
|
|
|
impact 1.0
|
|
|
|
title 'Ensure VM has 1 data disk and it is of the correct size'
|
|
|
|
|
|
|
|
# Set the name of the vm and resource_group
|
|
|
|
vm_internal = 'Linux-Internal-VM'
|
|
|
|
resource_group_name = 'Inspec-Azure'
|
|
|
|
|
|
|
|
# Ensure that the named machine has 1 data disk
|
2017-03-01 17:20:59 +00:00
|
|
|
describe azure_virtual_machine_datadisks(name: vm_internal, resource_group: resource_group_name) do
|
2017-02-28 14:21:57 +00:00
|
|
|
its('has_disks?') { should be true }
|
|
|
|
its('count') { should eq 1 }
|
|
|
|
end
|
|
|
|
|
|
|
|
# Ensure that the first data disk on the same machine size is greater than 10gb
|
2017-03-01 17:20:59 +00:00
|
|
|
describe azure_virtual_machine_datadisks(name: vm_internal, resource_group: resource_group_name).where { disk.zero? and size > 10 } do
|
2017-02-28 14:21:57 +00:00
|
|
|
its('entries') { should_not be_empty }
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|