'Test group_snapshot can be created and deleted.'

@mock.patch('cinder.volume.driver.VolumeDriver.create_group_snapshot', autospec=True, return_value=({'status': 'available'}, []))
def test_create_group_snapshot_with_bootable_volumes(self, mock_create_grpsnap):

    group = tests_utils.create_group(self.context, availability_zone=CONF.storage_availability_zone, volume_type_ids=[fake.VOLUME_TYPE_ID], group_type_id=fake.GROUP_TYPE_ID, host=CONF.host)
    volume = tests_utils.create_volume(self.context, group_id=group.id, host=group.host, volume_type_id=fake.VOLUME_TYPE_ID)
    self.volume.create_volume(self.context, volume)
    bootable_vol_params = {'status': 'creating', 'host': CONF.host, 'size': 1, 'bootable': True}
    bootable_vol = tests_utils.create_volume(self.context, group_id=group.id, **bootable_vol_params)
    self.volume.create_volume(self.context, bootable_vol)
    volume_ids = [volume.id, bootable_vol.id]
    group_snapshot_returns = self._create_group_snapshot(group.id, volume_ids)
    group_snapshot = group_snapshot_returns[0]
    self.volume.create_group_snapshot(self.context, group_snapshot)
    self.assertEqual(group_snapshot.id, objects.GroupSnapshot.get_by_id(context.get_admin_context(), group_snapshot.id).id)
    self.assertTrue(mock_create_grpsnap.called)
