'test that the glance-scrubber script runs successfully when not in
daemon mode and with a registry that operates in trustedauth mode'

def test_scrubber_app_with_trustedauth_registry(self):

    self.cleanup()
    self.api_server.deployment_flavor = 'noauth'
    self.registry_server.deployment_flavor = 'trusted-auth'
    self.start_servers(delayed_delete=True, daemon=False, metadata_encryption_key='', send_identity_headers=True)
    base_headers = {'X-Identity-Status': 'Confirmed', 'X-Auth-Token': '932c5c84-02ac-4fe5-a9ba-620af0e2bb96', 'X-User-Id': 'f9a41d13-0c13-47e9-bee2-ce4e8bfe958e', 'X-Tenant-Id': 'deae8923-075d-4287-924b-840fb2644874', 'X-Roles': 'admin'}
    headers = {'x-image-meta-name': 'test_image', 'x-image-meta-is_public': 'true', 'x-image-meta-disk_format': 'raw', 'x-image-meta-container_format': 'ovf', 'content-type': 'application/octet-stream'}
    headers.update(base_headers)
    path = ('http://%s:%d/v1/images' % ('127.0.0.1', self.api_port))
    http = httplib2.Http()
    (response, content) = http.request(path, 'POST', body='XXX', headers=headers)
    self.assertEqual(http_client.CREATED, response.status)
    image = jsonutils.loads(content)['image']
    self.assertEqual('active', image['status'])
    image_id = image['id']
    path = ('http://%s:%d/v1/images/%s' % ('127.0.0.1', self.api_port, image_id))
    http = httplib2.Http()
    (response, content) = http.request(path, 'DELETE', headers=base_headers)
    self.assertEqual(http_client.OK, response.status)
    (response, content) = http.request(path, 'HEAD', headers=base_headers)
    self.assertEqual(http_client.OK, response.status)
    self.assertEqual('pending_delete', response['x-image-meta-status'])
    time.sleep(self.api_server.scrub_time)
    exe_cmd = ('%s    -m    glance.cmd.scrubber' % sys.executable)
    cmd = ('%s    --config-file    %s' % (exe_cmd, self.scrubber_daemon.conf_file_name))
    (exitcode, out, err) = execute(cmd, raise_error=False)
    self.assertEqual(0, exitcode)
    self.wait_for_scrub(path, headers=base_headers)
    self.stop_servers()
