'Test that cache index command works'

def test_no_cache_enabled(self):

    self.cleanup()
    self.api_server.deployment_flavor = ''
    self.start_servers()
    api_port = self.api_port
    exe_cmd = ('%s    -m    glance.cmd.cache_manage' % sys.executable)
    cmd = ('%s    --port=%d    list-cached' % (exe_cmd, api_port))
    (exitcode, out, err) = execute(cmd, raise_error=False)
    self.assertEqual(1, exitcode)
    self.assertIn('Cache    management    middleware    not    enabled    on    host', out.strip())
    self.stop_servers()
