Converted Volume model and operation to use UUIDs.
This commit is contained in:
		@@ -127,9 +127,9 @@ class CloudTestCase(test.TestCase):
 | 
			
		||||
        result = self.cloud.describe_volumes(self.context)
 | 
			
		||||
        self.assertEqual(len(result['volumeSet']), 2)
 | 
			
		||||
        result = self.cloud.describe_volumes(self.context,
 | 
			
		||||
                                             volume_id=[vol2['ec2_id']])
 | 
			
		||||
                                             volume_id=[vol2['id']])
 | 
			
		||||
        self.assertEqual(len(result['volumeSet']), 1)
 | 
			
		||||
        self.assertEqual(result['volumeSet'][0]['volumeId'], vol2['ec2_id'])
 | 
			
		||||
        self.assertEqual(result['volumeSet'][0]['volumeId'], vol2['id'])
 | 
			
		||||
        db.volume_destroy(self.context, vol1['id'])
 | 
			
		||||
        db.volume_destroy(self.context, vol2['id'])
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -79,8 +79,8 @@ class XenAPIVolumeTestCase(test.TestCase):
 | 
			
		||||
        helper = volume_utils.VolumeHelper
 | 
			
		||||
        helper.XenAPI = session.get_imported_xenapi()
 | 
			
		||||
        vol = self._create_volume()
 | 
			
		||||
        info = helper.parse_volume_info(vol['ec2_id'], '/dev/sdc')
 | 
			
		||||
        label = 'SR-%s' % vol['ec2_id']
 | 
			
		||||
        info = helper.parse_volume_info(vol['id'], '/dev/sdc')
 | 
			
		||||
        label = 'SR-%s' % vol['id']
 | 
			
		||||
        description = 'Test-SR'
 | 
			
		||||
        sr_ref = helper.create_iscsi_storage(session, info, label, description)
 | 
			
		||||
        srs = fake.get_all('SR')
 | 
			
		||||
@@ -97,7 +97,7 @@ class XenAPIVolumeTestCase(test.TestCase):
 | 
			
		||||
        # oops, wrong mount point!
 | 
			
		||||
        self.assertRaises(volume_utils.StorageError,
 | 
			
		||||
                          helper.parse_volume_info,
 | 
			
		||||
                          vol['ec2_id'],
 | 
			
		||||
                          vol['id'],
 | 
			
		||||
                          '/dev/sd')
 | 
			
		||||
        db.volume_destroy(context.get_admin_context(), vol['id'])
 | 
			
		||||
 | 
			
		||||
@@ -108,8 +108,7 @@ class XenAPIVolumeTestCase(test.TestCase):
 | 
			
		||||
        volume = self._create_volume()
 | 
			
		||||
        instance = db.instance_create(self.values)
 | 
			
		||||
        fake.create_vm(instance.name, 'Running')
 | 
			
		||||
        result = conn.attach_volume(instance.name, volume['ec2_id'],
 | 
			
		||||
                                    '/dev/sdc')
 | 
			
		||||
        result = conn.attach_volume(instance.name, volume['id'], '/dev/sdc')
 | 
			
		||||
 | 
			
		||||
        def check():
 | 
			
		||||
            # check that the VM has a VBD attached to it
 | 
			
		||||
@@ -134,7 +133,7 @@ class XenAPIVolumeTestCase(test.TestCase):
 | 
			
		||||
        self.assertRaises(Exception,
 | 
			
		||||
                          conn.attach_volume,
 | 
			
		||||
                          instance.name,
 | 
			
		||||
                          volume['ec2_id'],
 | 
			
		||||
                          volume['id'],
 | 
			
		||||
                          '/dev/sdc')
 | 
			
		||||
 | 
			
		||||
    def tearDown(self):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user