Add logging for some functional tests
Functional tests log to a file only if they inherit from the Sudo tests base class. This patch changes the base class for some test cases to make them log. Related-Bug: #1567668 Change-Id: I494ad5410e48489f1fb3689cec44c5a29bbc42f3changes/88/303588/4
parent
863b170009
commit
474b1e7e2f
|
@ -19,12 +19,12 @@ from neutron._i18n import _
|
|||
from neutron.agent.linux import external_process
|
||||
from neutron.agent.linux import keepalived
|
||||
from neutron.agent.linux import utils
|
||||
from neutron.tests import base
|
||||
from neutron.tests.functional.agent.linux import helpers
|
||||
from neutron.tests.functional import base
|
||||
from neutron.tests.unit.agent.linux import test_keepalived
|
||||
|
||||
|
||||
class KeepalivedManagerTestCase(base.BaseTestCase,
|
||||
class KeepalivedManagerTestCase(base.BaseLoggingTestCase,
|
||||
test_keepalived.KeepalivedConfBaseMixin):
|
||||
|
||||
def setUp(self):
|
||||
|
|
|
@ -28,7 +28,14 @@ SUDO_CMD = 'sudo -n'
|
|||
DEFAULT_LOG_DIR = '/tmp/dsvm-functional-logs/'
|
||||
|
||||
|
||||
class BaseSudoTestCase(base.BaseTestCase):
|
||||
class BaseLoggingTestCase(base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(BaseLoggingTestCase, self).setUp()
|
||||
base.setup_test_logging(
|
||||
cfg.CONF, DEFAULT_LOG_DIR, "%s.log" % self.id())
|
||||
|
||||
|
||||
class BaseSudoTestCase(BaseLoggingTestCase):
|
||||
"""
|
||||
Base class for tests requiring invocation of commands via a root helper.
|
||||
|
||||
|
@ -54,9 +61,6 @@ class BaseSudoTestCase(base.BaseTestCase):
|
|||
if not base.bool_from_env('OS_SUDO_TESTING'):
|
||||
self.skipTest('Testing with sudo is not enabled')
|
||||
|
||||
base.setup_test_logging(
|
||||
cfg.CONF, DEFAULT_LOG_DIR, "%s.log" % self.id())
|
||||
|
||||
config.register_root_helper(cfg.CONF)
|
||||
self.config(group='AGENT',
|
||||
root_helper=os.environ.get('OS_ROOTWRAP_CMD', SUDO_CMD))
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
|
||||
import netaddr
|
||||
|
||||
from neutron.tests import base
|
||||
from neutron.tests.common.exclusive_resources import ip_address
|
||||
from neutron.tests.functional import base
|
||||
|
||||
|
||||
class TestExclusiveIPAddress(base.DietTestCase):
|
||||
class TestExclusiveIPAddress(base.BaseLoggingTestCase):
|
||||
def test_ip_address(self):
|
||||
address_1 = self.useFixture(
|
||||
ip_address.ExclusiveIPAddress('10.0.0.1', '10.0.0.2')).address
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
|
||||
import netaddr
|
||||
|
||||
from neutron.tests import base
|
||||
from neutron.tests.common.exclusive_resources import ip_network
|
||||
from neutron.tests.functional import base
|
||||
|
||||
|
||||
class TestExclusiveIPNetwork(base.DietTestCase):
|
||||
class TestExclusiveIPNetwork(base.BaseLoggingTestCase):
|
||||
def test_ip_network(self):
|
||||
network_1 = self.useFixture(
|
||||
ip_network.ExclusiveIPNetwork(
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
|
||||
from neutron_lib import constants
|
||||
|
||||
from neutron.tests import base
|
||||
from neutron.tests.common.exclusive_resources import port
|
||||
from neutron.tests.functional import base
|
||||
|
||||
|
||||
class TestExclusivePort(base.DietTestCase):
|
||||
class TestExclusivePort(base.BaseLoggingTestCase):
|
||||
def test_port(self):
|
||||
port_1 = self.useFixture(port.ExclusivePort(
|
||||
constants.PROTO_NAME_TCP)).port
|
||||
|
|
|
@ -17,8 +17,8 @@ import os
|
|||
import testtools
|
||||
|
||||
from neutron.common import utils
|
||||
from neutron.tests import base
|
||||
from neutron.tests.common.exclusive_resources import resource_allocator
|
||||
from neutron.tests.functional import base
|
||||
|
||||
|
||||
def safe_remove_file(file_path):
|
||||
|
@ -28,7 +28,7 @@ def safe_remove_file(file_path):
|
|||
pass
|
||||
|
||||
|
||||
class TestResourceAllocator(base.DietTestCase):
|
||||
class TestResourceAllocator(base.BaseLoggingTestCase):
|
||||
def setUp(self):
|
||||
super(TestResourceAllocator, self).setUp()
|
||||
self.ra = resource_allocator.ResourceAllocator(
|
||||
|
|
Loading…
Reference in New Issue