Ejemplo n.º 1
0
    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]
Ejemplo n.º 2
0
    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]
Ejemplo n.º 3
0
 def test(self):
     testPath = os.path.join(sc.REPO_DATA_CENTER,
                             "spUUID/sdUUID/images/imgUUID/volUUID")
     assert fileVolume.getDomUuidFromVolumePath(testPath) == "sdUUID"
Ejemplo n.º 4
0
 def test(self):
     testPath = os.path.join(sc.REPO_DATA_CENTER,
                             "spUUID/sdUUID/images/imgUUID/volUUID")
     assert fileVolume.getDomUuidFromVolumePath(testPath) == "sdUUID"
Ejemplo n.º 5
0
 def test(self):
     testPath = os.path.join(config.get('irs', 'repository'),
                             "spUUID/sdUUID/images/imgUUID/volUUID")
     self.assertEqual(fileVolume.getDomUuidFromVolumePath(testPath),
                      "sdUUID")