running local tests fails in oslo_policy package

Bug #1484553 reported by Mathieu Rohon
This bug report is a duplicate of:  Bug #1485537: adopt oslo_config.fixture.Config. Edit Remove
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Incomplete
Undecided
Unassigned

Bug Description

When I run tests localy with ./run_tests.sh or tox -e py27, it constantly fails in the oslo_policy package.

For instance :

$ ./run_tests.sh neutron.tests.unit.extensions.test_securitygroup.TestSecurityGroups.test_create_security_group_rule_bad_tenant_security_group_rule

Running `tools/with_venv.sh python setup.py testr --slowest --testr-args='--subunit neutron.tests.unit.extensions.test_securitygroup.TestSecurityGroups.test_create_security_group_rule_bad_tenant_security_group_rule'`
running testr
No handlers could be found for logger "neutron.quota"
No handlers could be found for logger "neutron.quota"
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./neutron/tests/unit} --list
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./neutron/tests/unit} --load-list /tmp/tmpfLjMOq
neutron.tests.unit.extensions.test_securitygroup.TestSecurityGroups.test_create_security_group_rule_bad_tenant_security_group_rule
neutron.tests.unit.extensions.test_securitygroup.TestSecurityGroups.test_create_security_group_rule_bad_tenant_security_group_rule ... FAIL
Slowest Tests
Test id Runtime (s)
---------------------------------------------------------------------------------------------------------------------------------- -----------
neutron.tests.unit.extensions.test_securitygroup.TestSecurityGroups.test_create_security_group_rule_bad_tenant_security_group_rule 0.141

======================================================================
FAIL: neutron.tests.unit.extensions.test_securitygroup.TestSecurityGroups.test_create_security_group_rule_bad_tenant_security_group_rule
neutron.tests.unit.extensions.test_securitygroup.TestSecurityGroups.test_create_security_group_rule_bad_tenant_security_group_rule
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:'neutron.api.extensions'
  stderr
  stdout

pythonlogging:'': {{{2015-08-13 16:04:58,490 WARNING [oslo_config.cfg] Option "verbose" from group "DEFAULT" is deprecated for removal. Its value may be silently ignored in the future.}}}

Traceback (most recent call last):
  File "neutron/tests/unit/extensions/test_securitygroup.py", line 229, in setUp
    self).setUp(plugin=plugin, ext_mgr=ext_mgr)
  File "neutron/tests/unit/db/test_db_base_plugin_v2.py", line 94, in setUp
    super(NeutronDbPluginV2TestCase, self).setUp()
  File "neutron/tests/unit/testlib_api.py", line 100, in setUp
    super(WebTestCase, self).setUp()
  File "neutron/tests/unit/testlib_api.py", line 92, in setUp
    super(SqlTestCase, self).setUp()
  File "neutron/tests/base.py", line 291, in setUp
    policy.init()
  File "neutron/policy.py", line 56, in init
    _ENFORCER.load_rules(True)
  File "/opt/stack/neutron/.venv/local/lib/python2.7/site-packages/oslo_policy/policy.py", line 401, in load_rules
    force_reload, False)
  File "/opt/stack/neutron/.venv/local/lib/python2.7/site-packages/oslo_policy/policy.py", line 424, in _walk_through_policy_directory
    policy_files = next(os.walk(path))[2]
StopIteration

----------------------------------------------------------------------
Ran 1 test in 5.117s

FAILED (failures=1)

Tags: unittest
tags: added: unittest
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/212571

Changed in neutron:
assignee: nobody → Mathieu Rohon (mathieu-rohon)
status: New → In Progress
Revision history for this message
Mathieu Rohon (mathieu-rohon) wrote :

I removed the /etc/neutron.policy.d on my system, and it works fine now. However, even if I recreate the /etc/neutron/policy.d, tests don't fail anymore. I Don't understand what happened

Revision history for this message
Ihar Hrachyshka (ihar-hrachyshka) wrote :

It seems that our attempt to isolate unit tests from oslo.config autodiscovery is not complete. I reported a separate bug to adopt the fixture that should make it for us: https://bugs.launchpad.net/neutron/+bug/1485537

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Mathieu Rohon (<email address hidden>) on branch: master
Review: https://review.openstack.org/212571
Reason: This fixes the bug but not the good way. Waiting for the appropirated fix for the bug 1485537

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

This bug is > 240 days without activity. We are unsetting assignee and milestone and setting status to Incomplete in order to allow its expiry in 60 days.

If the bug is still valid, then update the bug status.

Changed in neutron:
assignee: Mathieu Rohon (mathieu-rohon) → nobody
status: In Progress → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.