[Yahoo-eng-team] [Bug 1478503] Re: test_admin_version_v3 actually tests public app

2015-07-29 Thread Alexey Miroshkin
Launchpad somehow created 2 records for one bug, the original is here
https://bugs.launchpad.net/keystone/+bug/1478504

** Changed in: keystone
   Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1478503

Title:
  test_admin_version_v3 actually  tests public app

Status in Keystone:
  Invalid

Bug description:
  VersionTestCase.test_admin_version_v3
  (keystone/tests/unit/test_versions.py) in fact tests public app:

  def test_admin_version_v3(self):
  client = tests.TestClient(self.public_app)

  It makes sense only in case of V3 eventless setup where public app
  handles bot endpoints, but I believe it should be tested by a separate
  test like .test_admin_version_v3_eventlets which will be introduced as
  part of fix of bug #1381961. Also this behavior was introduced when 2
  apps setup was used for eventless.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1478503/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp


[Yahoo-eng-team] [Bug 1478629] [NEW] test_admin in VersionSingleAppTestCase expects public endpoint in a response

2015-07-27 Thread Alexey Miroshkin
Public bug reported:

In VersionSingleAppTestCase both test_public and test_admin methods use
a helper method _test_version which expects public_port config value in
a response. It has no impact on test result because of bug #1478000,
admin and public endpoints are indistinguishable in test_versions.

** Affects: keystone
 Importance: Undecided
 Assignee: Alexey Miroshkin (amirosh)
 Status: New


** Tags: test-improvement

** Changed in: keystone
 Assignee: (unassigned) => Alexey Miroshkin (amirosh)

** Summary changed:

- test_admin in VersionSingleAppTestCase expects public endpoint
+ test_admin in VersionSingleAppTestCase expects public endpoint in a response

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1478629

Title:
  test_admin in VersionSingleAppTestCase expects public endpoint in a
  response

Status in Keystone:
  New

Bug description:
  In VersionSingleAppTestCase both test_public and test_admin methods
  use a helper method _test_version which expects public_port config
  value in a response. It has no impact on test result because of bug
  #1478000, admin and public endpoints are indistinguishable in
  test_versions.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1478629/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp


[Yahoo-eng-team] [Bug 1478503] [NEW] test_admin_version_v3 actually tests public app

2015-07-27 Thread Alexey Miroshkin
Public bug reported:

VersionTestCase.test_admin_version_v3
(keystone/tests/unit/test_versions.py) in fact tests public app:

def test_admin_version_v3(self):
client = tests.TestClient(self.public_app)

It makes sense only in case of V3 eventless setup where public app
handles bot endpoints, but I believe it should be tested by a separate
test like .test_admin_version_v3_eventlets which will be introduced as
part of fix of bug #1381961. Also this behavior was introduced when 2
apps setup was used for eventless.

** Affects: keystone
 Importance: Undecided
 Status: New


** Tags: test-improvement

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1478503

Title:
  test_admin_version_v3 actually  tests public app

Status in Keystone:
  New

Bug description:
  VersionTestCase.test_admin_version_v3
  (keystone/tests/unit/test_versions.py) in fact tests public app:

  def test_admin_version_v3(self):
  client = tests.TestClient(self.public_app)

  It makes sense only in case of V3 eventless setup where public app
  handles bot endpoints, but I believe it should be tested by a separate
  test like .test_admin_version_v3_eventlets which will be introduced as
  part of fix of bug #1381961. Also this behavior was introduced when 2
  apps setup was used for eventless.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1478503/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp


[Yahoo-eng-team] [Bug 1478504] [NEW] test_admin_version_v3 actually tests public app

2015-07-27 Thread Alexey Miroshkin
Public bug reported:

VersionTestCase.test_admin_version_v3
(keystone/tests/unit/test_versions.py) in fact tests public app:

def test_admin_version_v3(self):
client = tests.TestClient(self.public_app)

It makes sense only in case of V3 eventless setup where public app
handles bot endpoints, but I believe it should be tested by a separate
test like .test_admin_version_v3_eventlets which will be introduced as
part of fix of bug #1381961. Also this behavior was introduced when 2
apps setup was used for eventless.

** Affects: keystone
 Importance: Undecided
 Assignee: Alexey Miroshkin (amirosh)
 Status: New


** Tags: test-improvement

** Changed in: keystone
 Assignee: (unassigned) => Alexey Miroshkin (amirosh)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1478504

Title:
  test_admin_version_v3 actually  tests public app

Status in Keystone:
  New

Bug description:
  VersionTestCase.test_admin_version_v3
  (keystone/tests/unit/test_versions.py) in fact tests public app:

  def test_admin_version_v3(self):
  client = tests.TestClient(self.public_app)

  It makes sense only in case of V3 eventless setup where public app
  handles bot endpoints, but I believe it should be tested by a separate
  test like .test_admin_version_v3_eventlets which will be introduced as
  part of fix of bug #1381961. Also this behavior was introduced when 2
  apps setup was used for eventless.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1478504/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp


[Yahoo-eng-team] [Bug 1478000] [NEW] VersionTestCase uses the same port for admin and public endpoints

2015-07-24 Thread Alexey Miroshkin
Public bug reported:

VersionTestCase uses the same port for admin and public endpoints:

 port = random.randint(1, 3)
 self.config_fixture.config(group='eventlet_server', public_port=port,
   admin_port=port)

https://github.com/openstack/keystone/blob/master/keystone/tests/unit/test_versions.py#L648

It makes public and admin endpoints indistinguishable. As results bugs
like "Keystone API GET 5000/v3 returns wrong endpoint URL in response
body" https://bugs.launchpad.net/keystone/+bug/1381961 can't be catched
by our tests  (e.g. VersionTestCase.test_admin_version_v3)

In reality admin and public endpoints must be different:

 admin_port = random.randint(1, 3)
 public_port = random.randint(1, 3)
 self.config_fixture.config(group='eventlet_server', public_port=public_port,
   admin_port=admin_port)

After that VersionTestCase.test_admin_version_v3 will fail because of
bug #1381961

** Affects: keystone
 Importance: Undecided
 Assignee: Alexey Miroshkin (amirosh)
 Status: New

** Changed in: keystone
     Assignee: (unassigned) => Alexey Miroshkin (amirosh)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1478000

Title:
  VersionTestCase uses the same port for admin and public endpoints

Status in Keystone:
  New

Bug description:
  VersionTestCase uses the same port for admin and public endpoints:

   port = random.randint(1, 3)
   self.config_fixture.config(group='eventlet_server', public_port=port,
 admin_port=port)

  
https://github.com/openstack/keystone/blob/master/keystone/tests/unit/test_versions.py#L648

  It makes public and admin endpoints indistinguishable. As results bugs
  like "Keystone API GET 5000/v3 returns wrong endpoint URL in response
  body" https://bugs.launchpad.net/keystone/+bug/1381961 can't be
  catched by our tests  (e.g. VersionTestCase.test_admin_version_v3)

  In reality admin and public endpoints must be different:

   admin_port = random.randint(1, 3)
   public_port = random.randint(1, 3)
   self.config_fixture.config(group='eventlet_server', public_port=public_port,
 admin_port=admin_port)

  After that VersionTestCase.test_admin_version_v3 will fail because of
  bug #1381961

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1478000/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp


[Yahoo-eng-team] [Bug 1393026] [NEW] Synchronized decorator is not reentrant

2014-11-15 Thread Alexey Miroshkin
Public bug reported:

It's impossible to call a synchronized method from the synchronized
method with the same lock name or use any kind of recursion. The
following test case hangs forever:

class TestLockUtils(base.BaseTestCase):

def test_synchronized(self):

@utils.synchronized('ab_test')
def a():
b()

@utils.synchronized('ab_test')
def b():
pass

@utils.synchronized('c_test')
def c(n):
if n == 0:
return
c(n -1)
  
a()
c(5)

The same logic works fine in Java:

public class JavaSynch {
public synchronized void a() {
b();
}

public synchronized void b() {
}

public synchronized void c(int n) {
if (n == 0)
return;
c(n--);
}

public static void main(String[] args) {
JavaSynch js = new JavaSynch();
js.a();
}
}

Synchronized decorator from neutron.openstack.common.lockutils uses
semaphore which can't track the current owner of the lock. It would be
good to use RLock, but I understand that eventless greenthreads  must be
taken into account.

Currently this behavior stop fixing us
https://bugs.launchpad.net/neutron/+bug/1197176 because delete_network
should call delete_subnet, but these methods are synchronized using the
same lock in BigSwithc plugin.

** Affects: neutron
     Importance: Undecided
 Assignee: Alexey Miroshkin (amirosh)
 Status: New

** Changed in: neutron
 Assignee: (unassigned) => Alexey Miroshkin (amirosh)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1393026

Title:
  Synchronized decorator is not reentrant

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  It's impossible to call a synchronized method from the synchronized
  method with the same lock name or use any kind of recursion. The
  following test case hangs forever:

  class TestLockUtils(base.BaseTestCase):
  
  def test_synchronized(self):
  
  @utils.synchronized('ab_test')
  def a():
  b()
  
  @utils.synchronized('ab_test')
  def b():
  pass
  
  @utils.synchronized('c_test')
  def c(n):
  if n == 0:
  return
  c(n -1)

  a()
  c(5)

  The same logic works fine in Java:

  public class JavaSynch {
  public synchronized void a() {
  b();
  }

  public synchronized void b() {
  }

  public synchronized void c(int n) {
  if (n == 0)
  return;
  c(n--);
  }

  public static void main(String[] args) {
  JavaSynch js = new JavaSynch();
  js.a();
  }
  }

  Synchronized decorator from neutron.openstack.common.lockutils uses
  semaphore which can't track the current owner of the lock. It would be
  good to use RLock, but I understand that eventless greenthreads  must
  be taken into account.

  Currently this behavior stop fixing us
  https://bugs.launchpad.net/neutron/+bug/1197176 because delete_network
  should call delete_subnet, but these methods are synchronized using
  the same lock in BigSwithc plugin.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1393026/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp


[Yahoo-eng-team] [Bug 1353511] [NEW] Credential backend doesn't use hints model

2014-08-06 Thread Alexey Miroshkin
Public bug reported:

The current implementation of credential.backends.sql.Credential work with 
filters directly:  list_credentials def list_credentials(self, **filters):
..
if 'user_id' in filters:
query = query.filter_by(user_id=filters.get('user_id'))

The most part of backends implementation follows hints model,
considering any filters as hints, so the particular backend
implementation has an option to process it or ignore it. It makes sense
to update credential backend,  for example:

def list_credentials(self, hints)

** Affects: keystone
 Importance: Undecided
     Assignee: Alexey Miroshkin (amirosh)
 Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1353511

Title:
  Credential backend doesn't use hints model

Status in OpenStack Identity (Keystone):
  New

Bug description:
  The current implementation of credential.backends.sql.Credential work with 
filters directly:  list_credentials def list_credentials(self, **filters):
  ..
  if 'user_id' in filters:
  query = query.filter_by(user_id=filters.get('user_id'))

  The most part of backends implementation follows hints model,
  considering any filters as hints, so the particular backend
  implementation has an option to process it or ignore it. It makes
  sense to update credential backend,  for example:

  def list_credentials(self, hints)

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1353511/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp


[Yahoo-eng-team] [Bug 1353487] [NEW] Code in keystone.credential.backends has no test coverage

2014-08-06 Thread Alexey Miroshkin
Public bug reported:

There are no tests for Credential backend class. Such tests should be
implemented in keystone.tests.test_backend. It will allow a proper
testing of an implementation of a blueprint 'Enable filtering of
credentials by user_id ' https://blueprints.launchpad.net/keystone/+spec
/filter-credentials-by-user

** Affects: keystone
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1353487

Title:
  Code in keystone.credential.backends has no test coverage

Status in OpenStack Identity (Keystone):
  New

Bug description:
  There are no tests for Credential backend class. Such tests should be
  implemented in keystone.tests.test_backend. It will allow a proper
  testing of an implementation of a blueprint 'Enable filtering of
  credentials by user_id '
  https://blueprints.launchpad.net/keystone/+spec/filter-credentials-by-
  user

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1353487/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp


[Yahoo-eng-team] [Bug 1348063] [NEW] Testing of results of entity lists does not check that the command part of the url is in the 'self' link

2014-07-24 Thread Alexey Miroshkin
Public bug reported:

Methods assertValidListResponse and consequently assertValidListLinks of
the unit test RestfulTestCase (test_v3.py) don't have any information
about request, so the  check of 'self' url in links collection is very
general:

self.assertThat(links['self'], matchers.StartsWith('http://localhost'))

To implement a proper fix of the bug 1195037 ("Self" link in v3
collections omits any url filters) we need to pass some request data, at
least the command part of the url, for example:

def assertValidListLinks(self, links, command=None)
def assertValidListResponse(self, resp, key, entity_validator, ref=None,
expected_length=None, keys_to_check=None,
command=None)

as result a proper check would be possible:

if command:
self.assertThat(links['self'], matchers.EndsWith(command))

** Affects: keystone
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1348063

Title:
  Testing of results of entity lists does not check that the command
  part of the url is in the 'self' link

Status in OpenStack Identity (Keystone):
  New

Bug description:
  Methods assertValidListResponse and consequently assertValidListLinks
  of the unit test RestfulTestCase (test_v3.py) don't have any
  information about request, so the  check of 'self' url in links
  collection is very general:

  self.assertThat(links['self'],
  matchers.StartsWith('http://localhost'))

  To implement a proper fix of the bug 1195037 ("Self" link in v3
  collections omits any url filters) we need to pass some request data,
  at least the command part of the url, for example:

  def assertValidListLinks(self, links, command=None)
  def assertValidListResponse(self, resp, key, entity_validator, ref=None,
  expected_length=None, keys_to_check=None,
  command=None)

  as result a proper check would be possible:

  if command:
  self.assertThat(links['self'], matchers.EndsWith(command))

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1348063/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp