class OvnUnsupportedDhcpOptionReader skipped with Podified setups
The implementation of OvnUnsupportedDhcpOptionReader requires to connect to controller nodes and access neutron logs, which is not supported yet The module tobiko.openstack.topology._neutron has been moved to tobiko.openstack.neutron.neutron_log_reader because it only includes neutron-related operations. Change-Id: I56f222da145399ddfa8096bb92fde500b1b8c6d1
This commit is contained in:
parent
26dbe89b9d
commit
197da7188d
@ -22,8 +22,9 @@ from oslo_log import log
|
||||
|
||||
import tobiko
|
||||
from tobiko.openstack import neutron
|
||||
from tobiko.openstack.topology import _config
|
||||
from tobiko.openstack.topology import _topology
|
||||
from tobiko.openstack.neutron import _agent
|
||||
from tobiko.openstack import topology
|
||||
from tobiko import podified
|
||||
from tobiko.shell import files
|
||||
|
||||
|
||||
@ -49,14 +50,14 @@ class NeutronNovaCommonReader(tobiko.SharedFixture):
|
||||
groups: typing.List[str]
|
||||
message_pattern: str
|
||||
datetime_pattern: typing.Pattern
|
||||
config = tobiko.required_fixture(_config.OpenStackTopologyConfig)
|
||||
config = tobiko.required_fixture(topology.OpenStackTopologyConfig)
|
||||
service_name = neutron.SERVER
|
||||
|
||||
def setup_fixture(self):
|
||||
self.datetime_pattern = re.compile(
|
||||
self.config.conf.log_datetime_pattern)
|
||||
self.log_digger = self.useFixture(
|
||||
_topology.get_log_file_digger(
|
||||
topology.get_log_file_digger(
|
||||
service_name=self.service_name,
|
||||
groups=self.groups,
|
||||
pattern=self.message_pattern))
|
||||
@ -129,7 +130,8 @@ class UnsupportedDhcpOptionMessage(typing.NamedTuple):
|
||||
return self.timestamp < other.timestamp
|
||||
|
||||
|
||||
@neutron.skip_unless_is_ovn()
|
||||
@podified.skip_if_podified
|
||||
@_agent.skip_unless_is_ovn()
|
||||
class OvnUnsupportedDhcpOptionReader(NeutronNovaCommonReader):
|
||||
groups = ['controller']
|
||||
message_pattern = (
|
@ -14,9 +14,9 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from tobiko.openstack.topology import _assert
|
||||
from tobiko.openstack.topology import _config
|
||||
from tobiko.openstack.topology import _exception
|
||||
from tobiko.openstack.topology import _namespace
|
||||
from tobiko.openstack.topology import _neutron
|
||||
from tobiko.openstack.topology import _topology
|
||||
from tobiko.openstack.topology import _sh
|
||||
|
||||
@ -26,12 +26,6 @@ assert_unreachable_nodes = _assert.assert_unreachable_nodes
|
||||
NoSuchOpenStackTopologyNodeGroup = _exception.NoSuchOpenStackTopologyNodeGroup
|
||||
NoSuchOpenStackTopologyNode = _exception.NoSuchOpenStackTopologyNode
|
||||
|
||||
NeutronNovaResponse = _neutron.NeutronNovaResponse
|
||||
NeutronNovaResponseReader = _neutron.NeutronNovaResponseReader
|
||||
read_neutron_nova_responses = _neutron.read_neutron_nova_responses
|
||||
assert_ovn_unsupported_dhcp_option_messages = (
|
||||
_neutron.assert_ovn_unsupported_dhcp_option_messages)
|
||||
|
||||
get_hosts_namespaces = _namespace.get_hosts_namespaces
|
||||
assert_namespace_in_hosts = _namespace.assert_namespace_in_hosts
|
||||
assert_namespace_not_in_hosts = _namespace.assert_namespace_not_in_hosts
|
||||
@ -65,5 +59,6 @@ verify_osp_version = _topology.verify_osp_version
|
||||
get_config_setting = _topology.get_config_setting
|
||||
node_name_from_hostname = _topology.node_name_from_hostname
|
||||
remove_duplications = _topology.remove_duplications
|
||||
|
||||
OpenstackGroupNamesType = _topology.OpenstackGroupNamesType
|
||||
|
||||
OpenStackTopologyConfig = _config.OpenStackTopologyConfig
|
||||
|
@ -27,6 +27,7 @@ EDPM_OTHER_GROUP = _openshift.EDPM_OTHER_GROUP
|
||||
PodifiedTopology = _topology.PodifiedTopology
|
||||
|
||||
skip_if_not_podified = _topology.skip_if_not_podified
|
||||
skip_if_podified = _topology.skip_if_podified
|
||||
|
||||
get_dataplane_ssh_keypair = _openshift.get_dataplane_ssh_keypair
|
||||
has_podified_cp = _openshift.has_podified_cp
|
||||
|
@ -33,6 +33,9 @@ LOG = log.getLogger(__name__)
|
||||
skip_if_not_podified = tobiko.skip_unless(
|
||||
"Podified deployment not configured", _openshift.has_podified_cp
|
||||
)
|
||||
skip_if_podified = tobiko.skip_if(
|
||||
"This test cannot run on a Podified deployment", _openshift.has_podified_cp
|
||||
)
|
||||
|
||||
# In Podified topology there are groups like 'edpm-compute', 'edpm-networker'
|
||||
# and 'edpm-other' but we need to provide also "virtual" group which will
|
||||
|
@ -29,6 +29,7 @@ from tobiko.shell import ping
|
||||
from tobiko.shell import ip
|
||||
from tobiko.shell import sh
|
||||
from tobiko.openstack import neutron
|
||||
from tobiko.openstack.neutron import neutron_log_reader
|
||||
from tobiko.openstack import stacks
|
||||
from tobiko.openstack import topology
|
||||
from tobiko.tripleo import overcloud
|
||||
@ -185,7 +186,7 @@ class ExtraDhcpOptsPortLoggingTest(testtools.TestCase):
|
||||
|
||||
def test_extra_dhcp_opts_logs_unsupported_options(self):
|
||||
# initialize logs that match the pattern
|
||||
topology.assert_ovn_unsupported_dhcp_option_messages()
|
||||
neutron_log_reader.assert_ovn_unsupported_dhcp_option_messages()
|
||||
|
||||
wrong_ipv4_option = 'wrong-ipv4-option'
|
||||
wrong_ipv6_option = 'bananas'
|
||||
@ -211,7 +212,7 @@ class ExtraDhcpOptsPortLoggingTest(testtools.TestCase):
|
||||
invalid_options = [wrong_ipv4_option,
|
||||
a_valid_ipv4_option_used_for_ipv6]
|
||||
# assert every invalid dhcp option is logged
|
||||
topology.assert_ovn_unsupported_dhcp_option_messages(
|
||||
neutron_log_reader.assert_ovn_unsupported_dhcp_option_messages(
|
||||
unsupported_options=invalid_options,
|
||||
port_uuid=port['id'])
|
||||
|
||||
@ -223,6 +224,6 @@ class ExtraDhcpOptsPortLoggingTest(testtools.TestCase):
|
||||
**{'extra_dhcp_opts': extra_dhcp_opts})
|
||||
invalid_options.append(wrong_ipv6_option)
|
||||
# assert every invalid dhcp option is logged
|
||||
topology.assert_ovn_unsupported_dhcp_option_messages(
|
||||
neutron_log_reader.assert_ovn_unsupported_dhcp_option_messages(
|
||||
unsupported_options=invalid_options,
|
||||
port_uuid=port['id'])
|
||||
|
Loading…
Reference in New Issue
Block a user