'test that images don\'t get deleted immediately and that the scrubber
scrubs them'

def test_delayed_delete(self):

    self.cleanup()
    self.start_servers(delayed_delete=True, daemon=True, metadata_encryption_key='')
    path = ('http://%s:%d/v1/images' % ('127.0.0.1', self.api_port))
    (response, content) = self._send_http_request(path, 'POST', body='XXX')
    self.assertEqual(http_client.CREATED, response.status)
    image = jsonutils.loads(content)['image']
    self.assertEqual('active', image['status'])
    path = ('http://%s:%d/v1/images/%s' % ('127.0.0.1', self.api_port, image['id']))
    (response, content) = self._send_http_request(path, 'DELETE')
    self.assertEqual(http_client.OK, response.status)
    (response, content) = self._send_http_request(path, 'HEAD')
    self.assertEqual(http_client.OK, response.status)
    self.assertEqual('pending_delete', response['x-image-meta-status'])
    self.wait_for_scrub(path)
    self.stop_servers()
