'A dataset created with the gold profile as specified in metadata on EBS
has EBS volume type \'io1\'.
This is verified by constructing an EBS backend in this process, purely
for the sake of using it as a wrapper on the cloud API.'

@require_cluster(1, required_backend=backends.AWS)
def test_dataset_creation_with_gold_profile(self, cluster, backend):

    waiting_for_create = create_dataset(self, cluster, maximum_size=(((4 * 1024) * 1024) * 1024), metadata={u'clusterhq:flocker:profile': u'gold'})
    def confirm_gold(dataset):
        volumes = backend.list_volumes()
        matching = [v for v in volumes if (v.dataset_id == dataset.dataset_id)]
        volume_types = [backend._get_ebs_volume(v.blockdevice_id).volume_type for v in matching]
        self.assertEqual(volume_types, ['io1'])
    waiting_for_create.addCallback(confirm_gold)
    return waiting_for_create
