def DoAwsDiskTest(self, disk_type, machine_type, goal_media, goal_replication): disk_spec = aws_disk.AwsDiskSpec(_COMPONENT, disk_size=2, disk_type=disk_type) vm_spec = aws_virtual_machine.AwsVmSpec( 'test_vm_spec.AWS', zone='us-east-1a', machine_type=machine_type) vm = aws_virtual_machine.DebianBasedAwsVirtualMachine( vm_spec) vm.CreateScratchDisk(disk_spec) self.assertDictContainsSubset( {disk.MEDIA: goal_media, disk.REPLICATION: goal_replication}, vm.scratch_disks[0].metadata )
def doAwsDiskTest(self, disk_type, machine_type, goal_media, goal_replication, goal_legacy_disk_type): disk_spec = aws_disk.AwsDiskSpec(_COMPONENT, disk_size=2, disk_type=disk_type) vm_spec = virtual_machine.BaseVmSpec('test_vm_spec.AWS', zone='us-east-1a', machine_type=machine_type) vm = aws_virtual_machine.DebianBasedAwsVirtualMachine(vm_spec) vm.CreateScratchDisk(disk_spec) self.assertEqual( vm.scratch_disks[0].metadata, { disk.MEDIA: goal_media, disk.REPLICATION: goal_replication, disk.LEGACY_DISK_TYPE: goal_legacy_disk_type })
def doAwsDiskTest(self, disk_type, machine_type, goal_media, goal_replication, goal_legacy_disk_type): disk_spec = aws_disk.AwsDiskSpec(disk_size=2, disk_type=disk_type, mount_point=None) context.SetThreadBenchmarkSpec( benchmark_spec.BenchmarkSpec({}, 'name', 'uid')) vm_spec = virtual_machine.BaseVmSpec('test_vm_spec.AWS', zone='us-east-1a', machine_type=machine_type) vm = aws_virtual_machine.DebianBasedAwsVirtualMachine(vm_spec) vm.CreateScratchDisk(disk_spec) self.assertEqual( vm.scratch_disks[0].metadata, { disk.MEDIA: goal_media, disk.REPLICATION: goal_replication, disk.LEGACY_DISK_TYPE: goal_legacy_disk_type })
def _CreateVm(self): vm_spec = aws_virtual_machine.AwsVmSpec( 'test_vm_spec.AWS', zone='us-east-1a', machine_type='test_machine_type') return aws_virtual_machine.DebianBasedAwsVirtualMachine(vm_spec)