Example #1
0
 def testValidMachineTypeWithSpecifiedRootVolumeSize(self):
   util.IssueRetryableCommand.side_effect = [(self.describeImageOutput, None)]
   desired_root_volume_size_gb = 35
   machine_type = 'c1.medium'
   image_id = 'ami-a9d276c9'
   region = 'us-west-2'
   expected = [{'DeviceName': '/dev/sda1',
                'Ebs': {'SnapshotId': 'snap-826344d5',
                        'DeleteOnTermination': True,
                        'VolumeType': 'gp2',
                        'VolumeSize': 35}},
               {'DeviceName': '/dev/xvdb',
                'VirtualName': 'ephemeral0'}]
   actual = json.loads(aws_virtual_machine.GetBlockDeviceMap(
       machine_type, desired_root_volume_size_gb, image_id, region))
   self.assertEqual(actual, expected)
Example #2
0
 def testValidMachineTypeWithNoRootVolumeSize(self):
     expected = [{'DeviceName': '/dev/xvdb', 'VirtualName': 'ephemeral0'}]
     actual = json.loads(aws_virtual_machine.GetBlockDeviceMap('c1.medium'))
     self.assertEqual(actual, expected)
Example #3
0
 def testInvalidMachineType(self):
     self.assertEqual(aws_virtual_machine.GetBlockDeviceMap('invalid'),
                      None)