def test_get_image_volumes(self): img_id = make_uuid() vol_id = make_uuid() remote_path = "[2001:db8:85a3::8a2e:370:7334]:1234:/path" size = 5 * MEGAB # Simulate a domain with an ipv6 address with fake_env(storage_type='file', remote_path=remote_path) as env: env.make_volume(size, img_id, vol_id) vol = env.sd_manifest.produceVolume(img_id, vol_id) vol_path = vol.getVolumePath() sduuid = fileVolume.getDomUuidFromVolumePath(vol_path) assert vol.getImageVolumes(sduuid, img_id) == [vol_id]
def test(self): testPath = os.path.join(sc.REPO_DATA_CENTER, "spUUID/sdUUID/images/imgUUID/volUUID") assert fileVolume.getDomUuidFromVolumePath(testPath) == "sdUUID"
def test(self): testPath = os.path.join(config.get('irs', 'repository'), "spUUID/sdUUID/images/imgUUID/volUUID") self.assertEqual(fileVolume.getDomUuidFromVolumePath(testPath), "sdUUID")