This patch fixes bug 938637
Quantum unittests doesn't pass with plugin (openvswitch, linuxbridge) in venv
as follows.
This is because config file under <quantum src>/etc/ can't be find due to
FLAGS.state_path points to <python-quantumclient src> which can be different
from <quantum src>.
Set FLAGS.state_path to <quantum src> when quantum unit tests.
$ PLUGIN_DIR=quantum/plugins/openvswitch ./run_tests.sh -V
<snip>
ActionExtensionTest
test_extended_action_for_adding_extra_data (quantum.tests.unit.test_extensions.ActionExtensionTest)ERROR
<snip>
======================================================================
ERROR: test_extended_action_for_adding_extra_data (quantum.tests.unit.test_extensions.ActionExtensionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/quantum/tests/unit/test_extensions.py", line 212, in setUp
self.extension_app = setup_extensions_test_app()
File "/quantum-src/quantum/tests/unit/test_extensions.py", line 474, in setup_extensions_test_app
return TestApp(setup_extensions_middleware(extension_manager))
File "/quantum-src/quantum/tests/unit/test_extensions.py", line 469, in setup_extensions_middleware
conf, app = config.load_paste_app('extensions_test_app', options, None)
File "/quantum-src/.venv/src/python-quantumclient/quantum/common/config.py", line 316, in load_paste_app
conf_file, conf = load_paste_config(app_name, options, args)
File "/quantum-src/.venv/src/python-quantumclient/quantum/common/config.py", line 286, in load_paste_config
"Cannot load application %s" % app_name)
RuntimeError: Unable to locate any configuration file. Cannot load application extensions_test_app
-------------------- >> begin captured logging << --------------------
quantum.extensions.extensions: INFO: Initializing extension manager.
quantum.extensions.extensions: INFO: Loading extension file: foxinsocks.py
quantum.extensions.extensions: DEBUG: Ext name: Fox In Socks
quantum.extensions.extensions: DEBUG: Ext alias: FOXNSOX
quantum.extensions.extensions: DEBUG: Ext description: The Fox In Socks Extension
quantum.extensions.extensions: DEBUG: Ext namespace: http://www.fox.in.socks/api/ext/pie/v1.0
quantum.extensions.extensions: DEBUG: Ext updated: 2011-01-22T13:25:27-06:00
quantum.extensions.extensions: WARNING: Loaded extension: FOXNSOX
quantum.extensions.extensions: INFO: Loading extension file: __init__.py
quantum.extensions.extensions: INFO: Loading extension file: foxinsocks.pyc
quantum.extensions.extensions: INFO: Loading extension file: __init__.pyc
--------------------- >> end captured logging << ---------------------
Change-Id: I3b8e1414b22b1a526468488fe885ac39f2e6c420
42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
|
|
|
# Copyright 2011 OpenStack LLC.
|
|
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
# See http://code.google.com/p/python-nose/issues/detail?id=373
|
|
# The code below enables nosetests to work with i18n _() blocks
|
|
|
|
import __builtin__
|
|
import unittest
|
|
setattr(__builtin__, '_', lambda x: x)
|
|
|
|
import os
|
|
from quantum.common import flags
|
|
|
|
FLAGS = flags.FLAGS
|
|
reldir = os.path.join(os.path.dirname(__file__), '..', '..', '..')
|
|
absdir = os.path.abspath(reldir)
|
|
FLAGS.state_path = absdir
|
|
|
|
|
|
class BaseTest(unittest.TestCase):
|
|
|
|
def setUp(self):
|
|
pass
|
|
|
|
|
|
def setUp():
|
|
pass
|