update hacking and bandit

This patch updates hacking and bandit versions to match what neutron
and others are doing. It also fixes and ignores some pep8 errors
that crop up due to the version bump.

Change-Id: I99fa046475847400f8b0174c700d1b586766caa5
This commit is contained in:
Boden R 2019-05-30 10:47:10 -06:00 committed by Kobi Samoray
parent ef049d872f
commit e220ca0203
29 changed files with 107 additions and 94 deletions

View File

@ -1,4 +1,4 @@
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
openstackdocstheme>=1.18.1 # Apache-2.0 openstackdocstheme>=1.18.1 # Apache-2.0
reno>=2.5.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0
mock>=2.0.0 # BSD

View File

@ -1,14 +1,15 @@
coverage==4.0 coverage==4.0
hacking==0.12.0 hacking>=1.1.0 # Apache-2.0
flake8-import-order==0.12
mock==2.0.0 mock==2.0.0
neutron-lib==1.25.0 neutron-lib==1.26.0
openstackdocstheme==1.18.1 openstackdocstheme==1.18.1
os-testr==1.0.0 os-testr==1.0.0
oslotest==3.2.0 oslotest==3.2.0
pbr==4.0.0 pbr==4.0.0
pylint==1.7.1
python-subunit==1.0.0 python-subunit==1.0.0
reno==2.5.0 reno==2.5.0
Sphinx==1.6.5
stestr==2.0.0 stestr==2.0.0
tempest==17.1.0 tempest==17.1.0
testtools==2.2.0 testtools==2.2.0

View File

@ -3,4 +3,4 @@
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
pbr>=4.0.0 # Apache-2.0 pbr>=4.0.0 # Apache-2.0
neutron-lib>=1.25.0 # Apache-2.0 neutron-lib>=1.26.0 # Apache-2.0

View File

@ -2,10 +2,12 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
hacking<0.13,>=0.12.0 # Apache-2.0 hacking>=1.1.0 # Apache-2.0
bandit>=1.1.0 # Apache-2.0 bandit!=1.6.0,>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
flake8-import-order==0.12 # LGPLv3
mock>=2.0.0 # BSD
python-subunit>=1.0.0 # Apache-2.0/BSD python-subunit>=1.0.0 # Apache-2.0/BSD
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT
@ -13,4 +15,5 @@ testtools>=2.2.0 # MIT
reno>=2.5.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0
tempest>=17.1.0 # Apache-2.0 tempest>=17.1.0 # Apache-2.0
os-testr>=1.0.0 # Apache-2.0 os-testr>=1.0.0 # Apache-2.0
pylint==1.7.6 # GPLv2
stestr>=2.0.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0

View File

@ -82,7 +82,7 @@ commands = oslo_debug_helper {posargs}
# E123, E125 skipped as they are invalid PEP-8. # E123, E125 skipped as they are invalid PEP-8.
show-source = True show-source = True
ignore = E125,E126,E128,E129,E265,H305,H307,H404,H405,H904,N530,N531 ignore = E125,E126,E128,E129,E265,H305,H307,H404,H405,H904,N530,N531,W504
builtins = _ builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject
import-order-style = pep8 import-order-style = pep8

View File

@ -12,12 +12,13 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import collections import collections
import re
import netaddr import netaddr
from oslo_log import log as logging from oslo_log import log as logging
from oslo_utils import netutils from oslo_utils import netutils
import re
from tempest import config from tempest import config
from tempest.lib.common.utils import data_utils from tempest.lib.common.utils import data_utils

View File

@ -18,6 +18,7 @@ import shlex
import subprocess import subprocess
import tempfile import tempfile
import time import time
import urllib3 import urllib3
from oslo_log import log as logging from oslo_log import log as logging

View File

@ -36,7 +36,7 @@ _opts = [
class VmwareNsxTempestPlugin(plugins.TempestPlugin): class VmwareNsxTempestPlugin(plugins.TempestPlugin):
"""Our addon configuration is defined at vmware_nsx_tempest_plugin/config.py """Our addon config is defined at vmware_nsx_tempest_plugin/config.py
1. register_opts() to register group/opts to Tempest 1. register_opts() to register group/opts to Tempest
2. get_opt_lists() to pass config to Tempest 2. get_opt_lists() to pass config to Tempest

View File

@ -312,8 +312,8 @@ class VSMClient(object):
edges = self.get_all_edges() edges = self.get_all_edges()
edge_list = [] edge_list = []
for e in edges: for e in edges:
if (not e['edgeStatus'] == 'GREY' if (not e['edgeStatus'] == 'GREY' and
and not e['state'] == 'undeployed'): not e['state'] == 'undeployed'):
p = re.compile(r'dhcp*') p = re.compile(r'dhcp*')
if (p.match(e['name'])): if (p.match(e['name'])):
if version is not None and \ if version is not None and \

View File

@ -14,9 +14,10 @@
# under the License. # under the License.
import json import json
import six
import time import time
import six
from oslo_log import log from oslo_log import log
from tempest import config from tempest import config
from tempest.lib.common import rest_client from tempest.lib.common import rest_client

View File

@ -57,8 +57,8 @@ class ProviderNetworks(feature_manager.FeatureManager):
vlan_flag = 0 vlan_flag = 0
vxlan_flag = 0 vxlan_flag = 0
for tz in out: for tz in out:
if "transport_type" in tz.keys() and (vlan_flag == 0 if "transport_type" in tz.keys() and \
or vxlan_flag == 0): (vlan_flag == 0 or vxlan_flag == 0):
if vxlan_flag == 0 and tz['transport_type'] == "OVERLAY": if vxlan_flag == 0 and tz['transport_type'] == "OVERLAY":
cls.overlay_id = tz['id'] cls.overlay_id = tz['id']
vxlan_flag = 1 vxlan_flag = 1

View File

@ -13,9 +13,10 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import testtools
import time import time
import testtools
from tempest.api.network import base from tempest.api.network import base
from tempest import config from tempest import config
from tempest.lib.common.utils import data_utils from tempest.lib.common.utils import data_utils

View File

@ -39,8 +39,8 @@ class BaseDvsAdminNetworkTest(base.BaseAdminNetworkTest):
@classmethod @classmethod
def create_network(cls, **kwargs): def create_network(cls, **kwargs):
"""Wrapper utility that returns a test admin provider network.""" """Wrapper utility that returns a test admin provider network."""
network_name = (kwargs.get('net_name') network_name = (kwargs.get('net_name') or
or data_utils.rand_name('test-adm-net-')) data_utils.rand_name('test-adm-net-'))
net_type = kwargs.get('net_type', "flat") net_type = kwargs.get('net_type', "flat")
if tempest.test.is_extension_enabled('provider', 'network'): if tempest.test.is_extension_enabled('provider', 'network'):
body = {'name': network_name} body = {'name': network_name}
@ -59,8 +59,8 @@ class BaseDvsAdminNetworkTest(base.BaseAdminNetworkTest):
"""Wrapper utility that returns a test subnet.""" """Wrapper utility that returns a test subnet."""
# The cidr and mask_bits depend on the ip version. # The cidr and mask_bits depend on the ip version.
if cls._ip_version == 4: if cls._ip_version == 4:
cidr = netaddr.IPNetwork(CONF.network.project_network_cidr cidr = netaddr.IPNetwork(CONF.network.project_network_cidr or
or "192.168.101.0/24") "192.168.101.0/24")
mask_bits = CONF.network.project_network_mask_bits or 24 mask_bits = CONF.network.project_network_mask_bits or 24
elif cls._ip_version == 6: elif cls._ip_version == 6:
cidr = netaddr.IPNetwork(CONF.network.project_network_v6_cidr) cidr = netaddr.IPNetwork(CONF.network.project_network_v6_cidr)

View File

@ -69,8 +69,8 @@ class TestDvsNetworkBasicOps(manager.NetworkScenarioTest):
def _create_subnet(self, network): def _create_subnet(self, network):
# The cidr and mask_bits depend on the ip version. # The cidr and mask_bits depend on the ip version.
if self._ip_version == 4: if self._ip_version == 4:
cidr = netaddr.IPNetwork(CONF.network.project_network_cidr cidr = netaddr.IPNetwork(CONF.network.project_network_cidr or
or "192.168.101.0/24") "192.168.101.0/24")
mask_bits = CONF.network.project_network_mask_bits or 24 mask_bits = CONF.network.project_network_mask_bits or 24
elif self._ip_version == 6: elif self._ip_version == 6:
cidr = netaddr.IPNetwork(CONF.network.project_network_v6_cidr) cidr = netaddr.IPNetwork(CONF.network.project_network_v6_cidr)

View File

@ -194,16 +194,16 @@ def create_network(SELF, client=None, tenant_id=None, name=None, **kwargs):
def create_port(SELF, client=None, **kwargs): def create_port(SELF, client=None, **kwargs):
if not client: if not client:
client = SELF.port_client client = SELF.port_client
result = client.create_port(**kwargs) result = client.create_port(**kwargs)
net_port = result['port'] net_port = result['port']
SELF.assertIsNotNone(result, 'Unable to allocate port') SELF.assertIsNotNone(result, 'Unable to allocate port')
SELF.addCleanup(test_utils.call_and_ignore_notfound_exc, SELF.addCleanup(test_utils.call_and_ignore_notfound_exc,
client.delete_port, client.delete_port,
net_port['id']) net_port['id'])
return net_port return net_port
# gateway=None means don't set gateway_ip in subnet # gateway=None means don't set gateway_ip in subnet

View File

@ -530,7 +530,7 @@ class TestAdminPolicyBasicOps(dmgr.TopoDeployScenarioManager):
[self.fip_nasa_ames_1['floating_ip_address']]) [self.fip_nasa_ames_1['floating_ip_address']])
def run_policy_BB_on_ames_BB_on_jpl(self): def run_policy_BB_on_ames_BB_on_jpl(self):
### tenant jpl:policy_BB_GP, tenant ames:policy_BB_GP # tenant jpl:policy_BB_GP, tenant ames:policy_BB_GP
self.log_exc_msg( self.log_exc_msg(
("Update tenant:ames to use policy_BB[%s] with group-ping" ("Update tenant:ames to use policy_BB[%s] with group-ping"
% self.policy_BB)) % self.policy_BB))

View File

@ -62,8 +62,8 @@ class TestDHCP121BasicOps(dmgr.TopoDeployScenarioManager):
@classmethod @classmethod
def skip_checks(cls): def skip_checks(cls):
super(TestDHCP121BasicOps, cls).skip_checks() super(TestDHCP121BasicOps, cls).skip_checks()
if not ((CONF.network.project_networks_reachable if not ((CONF.network.project_networks_reachable or
or CONF.network.public_network_id) and CONF.network.public_network_id) and
CONF.network.public_network_cidr): CONF.network.public_network_cidr):
msg = ('Either project_networks_reachable must be "true", or ' msg = ('Either project_networks_reachable must be "true", or '
'public_network_id must be defined.') 'public_network_id must be defined.')
@ -458,10 +458,16 @@ class TestDhcpHostRoutesBetweenVms(TestDHCP121BasicOps):
client_mgr = self.manager client_mgr = self.manager
next_hop = CONF.network.project_network_cidr next_hop = CONF.network.project_network_cidr
ip = next_hop.rsplit('/', 1)[0] ip = next_hop.rsplit('/', 1)[0]
ip2int = lambda ipstr: struct.unpack('!I', socket.inet_aton(ipstr))[0]
ss = (ip2int(ip)) def ip2int(ipstr):
int2ip = lambda n: socket.inet_ntoa(struct.pack('!I', n)) return struct.unpack('!I', socket.inet_aton(ipstr))[0]
new_network_cidr = (int2ip(ss + 256))
ss = ip2int(ip)
def int2ip(n):
return socket.inet_ntoa(struct.pack('!I', n))
new_network_cidr = int2ip(ss + 256)
net_mask = str(CONF.network.project_network_mask_bits) net_mask = str(CONF.network.project_network_mask_bits)
new_network_cidr = new_network_cidr + '/' + net_mask new_network_cidr = new_network_cidr + '/' + net_mask
cidr = netaddr.IPNetwork(new_network_cidr) cidr = netaddr.IPNetwork(new_network_cidr)

View File

@ -47,8 +47,8 @@ class TestMultipleTransportZonesBasicOps(dmgr.TopoDeployScenarioManager):
@classmethod @classmethod
def skip_checks(cls): def skip_checks(cls):
super(TestMultipleTransportZonesBasicOps, cls).skip_checks() super(TestMultipleTransportZonesBasicOps, cls).skip_checks()
if not (CONF.network.project_networks_reachable if not (CONF.network.project_networks_reachable or
or CONF.network.public_network_id): CONF.network.public_network_id):
msg = ('Either project_networks_reachable must be "true", or ' msg = ('Either project_networks_reachable must be "true", or '
'public_network_id must be defined.') 'public_network_id must be defined.')
raise cls.skipException(msg) raise cls.skipException(msg)

View File

@ -12,6 +12,8 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import time
from oslo_log import log as logging from oslo_log import log as logging
from tempest import config from tempest import config
@ -23,8 +25,6 @@ from vmware_nsx_tempest_plugin.common import constants
from vmware_nsx_tempest_plugin.lib import feature_manager from vmware_nsx_tempest_plugin.lib import feature_manager
from vmware_nsx_tempest_plugin.services import nsxv3_client from vmware_nsx_tempest_plugin.services import nsxv3_client
import time
CONF = config.CONF CONF = config.CONF
CONF.validation.auth_method = 'None' CONF.validation.auth_method = 'None'

View File

@ -237,18 +237,18 @@ class TestAllowedAddressPair(manager.NetworkScenarioTest):
def _check_server_connectivity(self, floating_ip, def _check_server_connectivity(self, floating_ip,
remote_ip, private_key, remote_ip, private_key,
should_connect=True): should_connect=True):
ssh_source = self.get_remote_client(floating_ip, ssh_source = self.get_remote_client(floating_ip,
private_key=private_key) private_key=private_key)
msg = "ip address %s is reachable" % remote_ip msg = "ip address %s is reachable" % remote_ip
try: try:
self.assertTrue(self._check_remote_connectivity self.assertTrue(self._check_remote_connectivity
(ssh_source, remote_ip, should_connect), (ssh_source, remote_ip, should_connect),
msg) msg)
except Exception: except Exception:
LOG.exception("Unable to access {dest} via ssh to " LOG.exception("Unable to access {dest} via ssh to "
"floating-ip {src}".format(dest=remote_ip, "floating-ip {src}".format(dest=remote_ip,
src=floating_ip)) src=floating_ip))
raise raise
def _assign_ip_address(self, ssh_source, interface_name, ip_address): def _assign_ip_address(self, ssh_source, interface_name, ip_address):
ssh_source.exec_command("sudo ifconfig %s %s netmask 255.255.255.0 \ ssh_source.exec_command("sudo ifconfig %s %s netmask 255.255.255.0 \

View File

@ -63,8 +63,8 @@ class ProviderNetworks(feature_manager.FeatureManager):
vlan_flag = 0 vlan_flag = 0
vxlan_flag = 0 vxlan_flag = 0
for tz in out: for tz in out:
if "transport_type" in tz.keys() and (vlan_flag == 0 if "transport_type" in tz.keys() and (vlan_flag == 0 or
or vxlan_flag == 0): vxlan_flag == 0):
if vxlan_flag == 0 and tz['transport_type'] == "OVERLAY": if vxlan_flag == 0 and tz['transport_type'] == "OVERLAY":
cls.overlay_id = tz['id'] cls.overlay_id = tz['id']
vxlan_flag = 1 vxlan_flag = 1

View File

@ -53,8 +53,8 @@ class TestMultiHVNetworkOps(manager.NetworkScenarioTest):
@classmethod @classmethod
def skip_checks(cls): def skip_checks(cls):
super(TestMultiHVNetworkOps, cls).skip_checks() super(TestMultiHVNetworkOps, cls).skip_checks()
if not (CONF.network.project_networks_reachable if not (CONF.network.project_networks_reachable or
or CONF.network.public_network_id): CONF.network.public_network_id):
msg = ('Either project_networks_reachable must be "true", or ' msg = ('Either project_networks_reachable must be "true", or '
'public_network_id must be defined.') 'public_network_id must be defined.')
raise cls.skipException(msg) raise cls.skipException(msg)

View File

@ -225,18 +225,18 @@ class TestProviderSecurityGroup(manager.NetworkScenarioTest):
def _check_server_connectivity(self, floating_ip, def _check_server_connectivity(self, floating_ip,
remote_ip, private_key, remote_ip, private_key,
should_connect=True): should_connect=True):
ssh_source = self.get_remote_client(floating_ip, ssh_source = self.get_remote_client(floating_ip,
private_key=private_key) private_key=private_key)
msg = "ip address %s is reachable" % remote_ip msg = "ip address %s is reachable" % remote_ip
try: try:
self.assertTrue(self._check_remote_connectivity self.assertTrue(self._check_remote_connectivity
(ssh_source, remote_ip, should_connect), (ssh_source, remote_ip, should_connect),
msg) msg)
except Exception: except Exception:
LOG.exception("Unable to access {dest} via ssh to " LOG.exception("Unable to access {dest} via ssh to "
"floating-ip {src}".format(dest=remote_ip, "floating-ip {src}".format(dest=remote_ip,
src=floating_ip)) src=floating_ip))
raise raise
def _create_vms_without_psg(self, network_topo): def _create_vms_without_psg(self, network_topo):
server_name_default = data_utils.rand_name('server-default-sec-group') server_name_default = data_utils.rand_name('server-default-sec-group')

View File

@ -817,8 +817,8 @@ class NetworkScenarioTest(ScenarioTest):
port_map = [(p["id"], fxip["ip_address"]) port_map = [(p["id"], fxip["ip_address"])
for p in ports for p in ports
for fxip in p["fixed_ips"] for fxip in p["fixed_ips"]
if netutils.is_valid_ipv4(fxip["ip_address"]) if netutils.is_valid_ipv4(fxip["ip_address"]) and
and p['status'] in p_status] p['status'] in p_status]
inactive = [p for p in ports if p['status'] != 'ACTIVE'] inactive = [p for p in ports if p['status'] != 'ACTIVE']
if inactive: if inactive:
LOG.warning("Instance has ports that are not ACTIVE: %s", inactive) LOG.warning("Instance has ports that are not ACTIVE: %s", inactive)

View File

@ -12,14 +12,13 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import dns.resolver
import subprocess import subprocess
import time import time
from oslo_log import log as logging import dns.resolver
from oslo_log import log as logging
from tempest import config from tempest import config
from tempest.lib import decorators from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc from tempest.lib import exceptions as lib_exc
@ -65,8 +64,8 @@ class TestZonesV2Ops(feature_manager.FeatureManager):
vlan_flag = 0 vlan_flag = 0
vxlan_flag = 0 vxlan_flag = 0
for tz in out: for tz in out:
if "transport_type" in tz.keys() and (vlan_flag == 0 if "transport_type" in tz.keys() and \
or vxlan_flag == 0): (vlan_flag == 0 or vxlan_flag == 0):
if vxlan_flag == 0 and tz['transport_type'] == "OVERLAY": if vxlan_flag == 0 and tz['transport_type'] == "OVERLAY":
cls.overlay_id = tz['id'] cls.overlay_id = tz['id']
vxlan_flag = 1 vxlan_flag = 1
@ -391,8 +390,8 @@ class TestZonesScenario(TestZonesV2Ops):
answer = my_resolver.query(record['name']) answer = my_resolver.query(record['name'])
except Exception: except Exception:
LOG.error('ns lookup failed on ext-vm') LOG.error('ns lookup failed on ext-vm')
if (record['name'] not in answer.response.to_text() if (record['name'] not in answer.response.to_text() or
or fip not in answer.response.to_text()): fip not in answer.response.to_text()):
LOG.error('failed to resolve dns for the instance') LOG.error('failed to resolve dns for the instance')
raise Exception('DNS response does not have entry ' raise Exception('DNS response does not have entry '
'for the instance') 'for the instance')

View File

@ -14,9 +14,10 @@
# under the License. # under the License.
import re import re
import testtools
import time import time
import testtools
from oslo_utils import uuidutils from oslo_utils import uuidutils
from tempest import config from tempest import config
from tempest.lib.common.utils import data_utils from tempest.lib.common.utils import data_utils

View File

@ -56,8 +56,8 @@ class ProviderNetworks(feature_manager.FeatureManager):
vlan_flag = 0 vlan_flag = 0
vxlan_flag = 0 vxlan_flag = 0
for tz in out: for tz in out:
if "transport_type" in tz.keys() and (vlan_flag == 0 if "transport_type" in tz.keys() and \
or vxlan_flag == 0): (vlan_flag == 0 or vxlan_flag == 0):
if vxlan_flag == 0 and tz['transport_type'] == "OVERLAY": if vxlan_flag == 0 and tz['transport_type'] == "OVERLAY":
cls.overlay_id = tz['id'] cls.overlay_id = tz['id']
vxlan_flag = 1 vxlan_flag = 1

View File

@ -12,12 +12,11 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import subprocess
import time
from oslo_log import log as logging from oslo_log import log as logging
from subprocess import PIPE
from subprocess import Popen
from subprocess import STDOUT
from tempest import config from tempest import config
from tempest.lib.common.utils import data_utils from tempest.lib.common.utils import data_utils
from tempest.lib import decorators from tempest.lib import decorators
@ -26,8 +25,6 @@ from tempest import test
from vmware_nsx_tempest_plugin.lib import feature_manager from vmware_nsx_tempest_plugin.lib import feature_manager
from vmware_nsx_tempest_plugin.services import nsx_client from vmware_nsx_tempest_plugin.services import nsx_client
import time
CONF = config.CONF CONF = config.CONF
CONF.validation.auth_method = 'None' CONF.validation.auth_method = 'None'
@ -286,8 +283,9 @@ class TestQosOps(feature_manager.FeatureManager):
src_server=self.topology_servers["qos_src_vm"], src_server=self.topology_servers["qos_src_vm"],
dst_server=self.topology_servers["qos_dst_vm"], dst_server=self.topology_servers["qos_dst_vm"],
traffic_type='udp', send_dscp='0', interface='eth0') traffic_type='udp', send_dscp='0', interface='eth0')
"""Check the entire file to see if any UDP packets are sent without configured # Check the entire file to see if any UDP packets are sent without
dscp value.Example capture all UDP packets with DSCP value !=12""" # configured dscp value.Example capture all UDP packets with
# DSCP value !=12
src_vm_ip_dict = self.topology_servers['qos_src_vm']['floating_ips'][0] src_vm_ip_dict = self.topology_servers['qos_src_vm']['floating_ips'][0]
filter_string = ('tshark -r %s -Y ' filter_string = ('tshark -r %s -Y '
'\"ip.dsfield.dscp != %s && udp.dstport == 49162 ' '\"ip.dsfield.dscp != %s && udp.dstport == 49162 '
@ -295,7 +293,8 @@ class TestQosOps(feature_manager.FeatureManager):
(dscp_filename, str(dscp_value), (dscp_filename, str(dscp_value),
src_vm_ip_dict['fixed_ip_address'], src_vm_ip_dict['fixed_ip_address'],
self.topology_servers['qos_dst_vm'])) self.topology_servers['qos_dst_vm']))
p = Popen(filter_string, shell=True, stdout=PIPE, stderr=STDOUT) p = subprocess.Popen(filter_string, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout, stderr = p.communicate() stdout, stderr = p.communicate()
LOG.info(stdout) LOG.info(stdout)
LOG.info(stderr) LOG.info(stderr)

View File

@ -77,7 +77,7 @@ class DHCPUnidimensionalScaleTest(feature_manager.FeatureManager):
self.assertIsNotNone(len(scale_switches), error_msg) self.assertIsNotNone(len(scale_switches), error_msg)
dhcp_servers = self.nsx.get_logical_dhcp_servers() dhcp_servers = self.nsx.get_logical_dhcp_servers()
scale_dhcp_servers = [ds for ds in dhcp_servers scale_dhcp_servers = [ds for ds in dhcp_servers
if ls['display_name'].startswith('uniscale-')] if ds['display_name'].startswith('uniscale-')]
error_msg = ("Logical DHCP servers on backend doesn't match the " error_msg = ("Logical DHCP servers on backend doesn't match the "
"number of networks on OpenStack") "number of networks on OpenStack")
self.assertIsNotNone(len(scale_dhcp_servers), scale, error_msg) self.assertIsNotNone(len(scale_dhcp_servers), scale, error_msg)