Use upper-constraints.txt from stable/kilo
The patch introduces a change in the way we install packages with
tox, ensuring that we use aligned upper constraints from stable/kilo.
Also, tests are fixed.
Fixes for py26 tests are cherry-picked from
2123640a11
flake8 forced to ignore new checks that appeared since the old release
Closes-Bug: #1664619
Change-Id: I6b01c03c20bc2488e76b60f047a0330550febaf5
This commit is contained in:
parent
63f079884b
commit
253a21fcd7
|
@ -1,5 +1,4 @@
|
|||
-r requirements.txt
|
||||
hacking==0.10.1
|
||||
mock==1.0.1
|
||||
pytest==2.7.2
|
||||
httpretty==0.8.10
|
||||
|
|
|
@ -15,7 +15,7 @@ commands =
|
|||
downloadcache = ~/cache/pip
|
||||
|
||||
[testenv:pep8]
|
||||
deps = hacking==0.7
|
||||
deps = flake8
|
||||
usedevelop = False
|
||||
commands =
|
||||
flake8 {posargs:.}
|
||||
|
@ -28,7 +28,7 @@ envdir = devenv
|
|||
usedevelop = True
|
||||
|
||||
[flake8]
|
||||
ignore = H234,H302,H802
|
||||
ignore = H234,H302,H802,E731,E713,W503,E128,E266,E123,E265,E714,E712,E251,E305,E121,E122,E115,E126
|
||||
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,__init__.py,docs
|
||||
show-pep8 = True
|
||||
show-source = True
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
-r requirements.txt
|
||||
hacking==0.7
|
||||
mock==1.0.1
|
||||
nose==1.1.2
|
||||
nose2==0.4.1
|
||||
|
|
|
@ -5,7 +5,7 @@ envlist = py26,py27,pep8
|
|||
|
||||
[testenv]
|
||||
usedevelop = True
|
||||
install_command = pip install {packages}
|
||||
install_command = pip install -c https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/kilo {packages}
|
||||
setenv = VIRTUAL_ENV={envdir}
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
commands =
|
||||
|
@ -15,7 +15,7 @@ commands =
|
|||
downloadcache = ~/cache/pip
|
||||
|
||||
[testenv:pep8]
|
||||
deps = hacking==0.7
|
||||
deps = flake8
|
||||
usedevelop = False
|
||||
commands =
|
||||
flake8 {posargs:.}
|
||||
|
@ -28,7 +28,7 @@ envdir = devenv
|
|||
usedevelop = True
|
||||
|
||||
[flake8]
|
||||
ignore = H234,H302,H802
|
||||
ignore = H234,H302,H802,E731,E713,W503,E128,E266,E123,E265,E714,E712,E251,E305,E121,E122,E115,E126
|
||||
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,__init__.py,docs
|
||||
show-pep8 = True
|
||||
show-source = True
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
hacking==0.7
|
|
@ -8,14 +8,13 @@ usedevelop = True
|
|||
install_command = pip install --allow-external -U {opts} {packages}
|
||||
setenv = VIRTUAL_ENV={envdir}
|
||||
deps = -r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands =
|
||||
|
||||
[tox:jenkins]
|
||||
downloadcache = ~/cache/pip
|
||||
|
||||
[testenv:pep8]
|
||||
deps = hacking==0.7
|
||||
deps = flake8
|
||||
usedevelop = False
|
||||
commands =
|
||||
flake8 {posargs:.}
|
||||
|
@ -28,7 +27,7 @@ envdir = devenv
|
|||
usedevelop = True
|
||||
|
||||
[flake8]
|
||||
ignore = H234,H302,H802
|
||||
ignore = H234,H302,H802,E402,E731,E713,W503,E128,E266,E123,E265,E714,E712,E251,E305,E121,E122,E115,E126
|
||||
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,__init__.py,docs
|
||||
show-pep8 = True
|
||||
show-source = True
|
||||
|
|
|
@ -29,8 +29,8 @@ def pytest_addoption(parser):
|
|||
def pytest_configure(config):
|
||||
db_name = config.getoption('dbname')
|
||||
if hasattr(config, 'slaveinput'):
|
||||
#slaveid have next format gw1
|
||||
#it is internal pytest thing, and we dont want to use it
|
||||
# slaveid have next format gw1
|
||||
# it is internal pytest thing, and we dont want to use it
|
||||
uid = re.search(r'\d+', config.slaveinput['slaveid']).group(0)
|
||||
db_name = '{0}{1}'.format(db_name, uid)
|
||||
connection = connect(
|
||||
|
|
|
@ -23,6 +23,7 @@ def Enum(*values, **kwargs):
|
|||
return namedtuple('Enum', names)(*values)
|
||||
return namedtuple('Enum', values)(*values)
|
||||
|
||||
|
||||
RELEASE_STATES = Enum(
|
||||
'available',
|
||||
'unavailable',
|
||||
|
|
|
@ -1635,6 +1635,18 @@ class BaseValidatorTest(TestCase):
|
|||
"{0} has non-unique elements".format(stringified_values),
|
||||
context.exception.message)
|
||||
|
||||
def assertRaisesLessThanMinimum(self, obj, stringified_values):
|
||||
context = self.get_invalid_data_context(obj)
|
||||
self.assertIn(
|
||||
"{0} is less than the minimum".format(stringified_values),
|
||||
context.exception.message)
|
||||
|
||||
def assertRaisesGreaterThanMaximum(self, obj, stringified_values):
|
||||
context = self.get_invalid_data_context(obj)
|
||||
self.assertIn(
|
||||
"{0} is greater than the maximum".format(stringified_values),
|
||||
context.exception.message)
|
||||
|
||||
def assertRaisesNotMatchPattern(self, obj, stringified_values):
|
||||
context = self.get_invalid_data_context(obj)
|
||||
self.assertIn(
|
||||
|
|
|
@ -276,40 +276,36 @@ class TestNetworkManager(BaseNetworkManagerTest):
|
|||
)
|
||||
node_group = self.env.create_node_group()
|
||||
self.env.nodes[1].group_id = node_group.json_body['id']
|
||||
mgmt_net = self.db.query(NetworkGroup).filter_by(
|
||||
group_id=node_group.json_body['id'],
|
||||
name=consts.NETWORKS.management
|
||||
).first()
|
||||
|
||||
# since there's no delete-orphan cascade on network.ip_ranges
|
||||
# relationship, we have to remove old ip_ranges manually
|
||||
self.db.query(IPAddrRange).filter_by(
|
||||
network_group_id=mgmt_net.id).delete()
|
||||
|
||||
# set new range for management network of non-default node group
|
||||
mgmt_net.cidr = '7.7.7.0/24'
|
||||
mgmt_net.ip_ranges = [IPAddrRange(first='7.7.7.1', last='7.7.7.254')]
|
||||
self.db().flush()
|
||||
mgmt_net = self.db.query(NetworkGroup).\
|
||||
filter(
|
||||
NetworkGroup.group_id == node_group.json_body["id"]
|
||||
).filter_by(
|
||||
name=consts.NETWORKS.management
|
||||
).first()
|
||||
|
||||
mock_range = IPAddrRange(
|
||||
first='9.9.9.1',
|
||||
last='9.9.9.254',
|
||||
network_group_id=mgmt_net.id
|
||||
self.env.network_manager.assign_ips(
|
||||
self.env.nodes,
|
||||
consts.NETWORKS.management
|
||||
)
|
||||
self.db.add(mock_range)
|
||||
self.db.commit()
|
||||
|
||||
self.env.network_manager.assign_ips(self.env.nodes,
|
||||
consts.NETWORKS.management)
|
||||
|
||||
for n in self.env.nodes:
|
||||
for node in self.env.nodes:
|
||||
mgmt_net = self.db.query(NetworkGroup).\
|
||||
filter(
|
||||
NetworkGroup.group_id == n.group_id
|
||||
).filter_by(
|
||||
name=consts.NETWORKS.management
|
||||
).first()
|
||||
ip = self.db.query(IPAddr).\
|
||||
filter_by(network=mgmt_net.id).\
|
||||
filter_by(node=n.id).first()
|
||||
filter_by(
|
||||
group_id=node.group_id,
|
||||
name=consts.NETWORKS.management).first()
|
||||
|
||||
self.assertIn(
|
||||
IPAddress(ip.ip_addr),
|
||||
IPNetwork(mgmt_net.cidr)
|
||||
)
|
||||
ip = self.db.query(IPAddr).\
|
||||
filter_by(network=mgmt_net.id, node=node.id).first()
|
||||
|
||||
self.assertIn(IPAddress(ip.ip_addr), IPNetwork(mgmt_net.cidr))
|
||||
|
||||
def test_ipaddr_joinedload_relations(self):
|
||||
self.env.create(
|
||||
|
@ -565,7 +561,7 @@ class TestNetworkManager(BaseNetworkManagerTest):
|
|||
|
||||
def get_net_by_name(self, networks, name):
|
||||
for net in networks:
|
||||
if net["meta"]["name"] == name:
|
||||
if net["name"] == name:
|
||||
return net
|
||||
raise Exception("Network with name {0} not found".format(name))
|
||||
|
||||
|
@ -627,7 +623,7 @@ class TestNetworkManager(BaseNetworkManagerTest):
|
|||
|
||||
for net_name, net_changes in six.iteritems(updates):
|
||||
ng = self.get_net_by_name(nets["networks"], net_name)
|
||||
ng.update(net_changes)
|
||||
ng['meta'].update(net_changes['meta'])
|
||||
|
||||
self.env.network_manager.update_networks(nets)
|
||||
nets_updated = get_network_config(cluster)
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import collections
|
||||
import mock
|
||||
import netaddr
|
||||
import six
|
||||
|
@ -140,14 +141,14 @@ class TestDeploymentAttributesSerialization70(
|
|||
def test_non_default_bridge_mapping(self):
|
||||
expected_mapping = {
|
||||
u'test': u'br-test',
|
||||
u'testnetwork1': u'br-testnetwork1',
|
||||
u'testnetwork13': u'br-testnetwork2',
|
||||
u'testnetwork1': u'br-testnetwork',
|
||||
u'testnetwork13': u'br-testnetwork',
|
||||
u'my-super-network': u'br-my-super-net',
|
||||
u'uplink-network-east': u'br-uplink-netw2',
|
||||
u'uplink-network-west': u'br-uplink-netwo',
|
||||
u'uplink-network-south': u'br-uplink-netw1',
|
||||
u'12345uplink-network-south': u'br-12345uplink1',
|
||||
u'fw-admin': u'br-fw-admi1'
|
||||
u'uplink-network-east': u'br-uplink-netw',
|
||||
u'uplink-network-west': u'br-uplink-netw',
|
||||
u'uplink-network-south': u'br-uplink-netw',
|
||||
u'12345uplink-network-south': u'br-12345uplink',
|
||||
u'fw-admin': u'br-fw-admi'
|
||||
}
|
||||
cluster = self.env.create(
|
||||
cluster_kwargs={
|
||||
|
@ -169,7 +170,27 @@ class TestDeploymentAttributesSerialization70(
|
|||
self.prepare_for_deployment(self.cluster_db.nodes)
|
||||
mapping = net_serializer.get_node_non_default_bridge_mapping(
|
||||
self.cluster_db.nodes[0])
|
||||
self.assertDictEqual(mapping, expected_mapping)
|
||||
|
||||
# since we have a suffix generation for bridges, they may have
|
||||
# different suffix based on PYTHONHASHSEED. hence, we can't
|
||||
# come up with a normal dictionary comparison. so let's
|
||||
# compare that all bridges are unique, and they are unique
|
||||
# for networks which may have bridge collision.
|
||||
br_collision = collections.defaultdict(list)
|
||||
self.assertEqual(len(mapping), len(expected_mapping))
|
||||
self.assertEqual(len(expected_mapping), len(set(mapping.values())))
|
||||
|
||||
for netname in expected_mapping:
|
||||
# check that bridge name has been generated from the network
|
||||
self.assertTrue(
|
||||
mapping[netname].startswith(expected_mapping[netname]))
|
||||
|
||||
br_collision[expected_mapping[netname]].append(netname)
|
||||
|
||||
# check that there's no collision between networks
|
||||
for bridge, netnames in six.iteritems(br_collision):
|
||||
bridges = set((mapping[netname] for netname in netnames))
|
||||
self.assertEqual(len(bridges), len(netnames))
|
||||
|
||||
def test_network_scheme_custom_networks(self):
|
||||
cluster = self.env.create(
|
||||
|
|
|
@ -565,14 +565,20 @@ class TestNeutronNetworkConfigurationValidatorProtocol(
|
|||
self.nc['networking_parameters']['vlan_range'] = {}
|
||||
self.assertRaisesInvalidType(self.nc, "{}", "'array'")
|
||||
|
||||
self.nc['networking_parameters']['vlan_range'] = ["1", 2]
|
||||
self.assertRaisesInvalidType(self.nc, "'1'", "'integer'")
|
||||
self.nc['networking_parameters']['vlan_range'] = ["2", 3]
|
||||
self.assertRaisesInvalidType(self.nc, "'2'", "'integer'")
|
||||
|
||||
self.nc['networking_parameters']['vlan_range'] = [1, 2, 3]
|
||||
self.assertRaisesTooLong(self.nc, "[1, 2, 3]")
|
||||
self.nc['networking_parameters']['vlan_range'] = [2, 3, 4]
|
||||
self.assertRaisesTooLong(self.nc, "[2, 3, 4]")
|
||||
|
||||
self.nc['networking_parameters']['vlan_range'] = [1]
|
||||
self.assertRaisesTooShort(self.nc, "[1]")
|
||||
self.nc['networking_parameters']['vlan_range'] = [2]
|
||||
self.assertRaisesTooShort(self.nc, "[2]")
|
||||
|
||||
self.nc['networking_parameters']['vlan_range'] = [1, 2]
|
||||
self.assertRaisesLessThanMinimum(self.nc, "1")
|
||||
|
||||
self.nc['networking_parameters']['vlan_range'] = [2, 4097]
|
||||
self.assertRaisesGreaterThanMaximum(self.nc, "4097")
|
||||
|
||||
self.nc['networking_parameters']['vlan_range'] = [2, 2]
|
||||
self.assertRaisesNonUnique(self.nc, "[2, 2]")
|
||||
|
|
|
@ -105,18 +105,26 @@ class TestDeleteIBPImagesTask(BaseTestCase):
|
|||
fake_image_data = {'/': {'uri': 'http://a.b/fake.img'},
|
||||
'/boot': {'uri': 'http://c.d/fake-boot.img'}}
|
||||
task.DeleteIBPImagesTask.message(task_mock, fake_image_data)
|
||||
|
||||
rpc_message = mock_astute.call_args[0][3]
|
||||
rm_cmd = rpc_message['tasks'][0]['parameters'].pop('cmd')
|
||||
|
||||
mock_astute.assert_called_once_with(
|
||||
mock.ANY, 'execute_tasks', 'remove_images_resp', {
|
||||
'tasks': [{
|
||||
'type': 'shell',
|
||||
'uids': [consts.MASTER_ROLE],
|
||||
'parameters': {
|
||||
'retries': 3,
|
||||
'cmd': 'rm -f /fake/path/fake-boot.img '
|
||||
'/fake/path/fake.img',
|
||||
'cwd': '/',
|
||||
'timeout': 'fake_timeout',
|
||||
'interval': 1}}]})
|
||||
mock.ANY, 'execute_tasks', 'remove_images_resp', mock.ANY)
|
||||
|
||||
self.assertEqual(rpc_message, {
|
||||
'tasks': [{
|
||||
'type': 'shell',
|
||||
'uids': [consts.MASTER_ROLE],
|
||||
'parameters': {
|
||||
'retries': 3,
|
||||
'cwd': '/',
|
||||
'timeout': 'fake_timeout',
|
||||
'interval': 1}}]})
|
||||
|
||||
self.assertTrue(rm_cmd.startswith('rm -f'))
|
||||
self.assertIn('/fake/path/fake-boot.img', rm_cmd)
|
||||
self.assertIn('/fake/path/fake.img', rm_cmd)
|
||||
|
||||
|
||||
class TestHelperUpdateClusterStatus(BaseTestCase):
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
Babel==1.3
|
||||
Jinja2==2.7
|
||||
Mako==0.9.1
|
||||
MarkupSafe==0.18
|
||||
PyYAML==3.10
|
||||
Jinja2<=2.7.3
|
||||
Mako<=1.0.1
|
||||
MarkupSafe<=0.23
|
||||
PyYAML<=3.11
|
||||
SQLAlchemy>=0.9.4
|
||||
alembic>=0.6.2
|
||||
amqplib==1.0.2
|
||||
anyjson==0.3.3
|
||||
argparse==1.2.1
|
||||
decorator==3.4.0
|
||||
decorator<=3.4.2
|
||||
fysom==1.0.11
|
||||
iso8601==0.1.9
|
||||
jsonschema==2.3.0
|
||||
kombu==3.0.16
|
||||
iso8601<=0.1.10
|
||||
jsonschema<2.6.0
|
||||
kombu<=3.0.26
|
||||
netaddr>=0.7.10
|
||||
oslo.config>=1.6.0,<1.10.0
|
||||
oslo.serialization>=1.2.0,<1.5.0
|
||||
ply==3.4
|
||||
psycopg2==2.5.1
|
||||
oslo.config>=1.6.0,<=1.13.0
|
||||
oslo.serialization>=1.2.0,<=1.6.0
|
||||
ply>=3.4
|
||||
psycopg2>=2.5.1
|
||||
pycrypto==2.6.1
|
||||
requests>=2.2.0,!=2.4.0,<2.8.0
|
||||
simplejson>=3.3.0
|
||||
|
@ -26,17 +26,12 @@ urllib3>=1.7
|
|||
web.py==0.37
|
||||
wsgilog==0.3
|
||||
wsgiref==0.1.2
|
||||
keystonemiddleware>=1.2.0,<1.6.0
|
||||
keystonemiddleware>=1.2.0,<=2.0.0
|
||||
# we might still need keystone command
|
||||
python-keystoneclient>=0.11,<1.4.0
|
||||
python-novaclient>=2.17.0,<2.24.0
|
||||
python-cinderclient>=1.0.7,<1.2.0
|
||||
python-keystoneclient>=0.11,<=1.6.0
|
||||
python-novaclient>=2.17.0,<=2.26.0
|
||||
python-cinderclient>=1.0.7,<=1.2.2
|
||||
networkx>=1.8,<1.10
|
||||
pydot-ng>=1.0.0
|
||||
ordereddict>=1.1
|
||||
oslo.utils<1.4.1
|
||||
# NOTE(prmtl): not all packages has correctly
|
||||
# requirements for stevedore - some of them install
|
||||
# newest one which case version conflicts
|
||||
# See: https://bugs.launchpad.net/fuel/+bug/1481212
|
||||
stevedore<1.4.0
|
||||
oslo.utils<1.7.1
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
-r requirements.txt
|
||||
hacking==0.7
|
||||
mock==1.0.1
|
||||
nose==1.1.2
|
||||
unittest2==0.5.1
|
||||
|
|
|
@ -5,7 +5,7 @@ envlist = py26,py27,pep8
|
|||
|
||||
[testenv]
|
||||
usedevelop = True
|
||||
install_command = pip install -U {opts} {packages}
|
||||
install_command = pip install -c https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/kilo {opts} {packages}
|
||||
setenv = VIRTUAL_ENV={envdir}
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
commands =
|
||||
|
@ -15,7 +15,7 @@ commands =
|
|||
downloadcache = ~/cache/pip
|
||||
|
||||
[testenv:pep8]
|
||||
deps = hacking==0.7
|
||||
deps = flake8
|
||||
usedevelop = False
|
||||
commands =
|
||||
flake8 {posargs:nailgun}
|
||||
|
@ -35,7 +35,11 @@ usedevelop = True
|
|||
# NOTE(eli): H304 is "No relative imports" error, relative
|
||||
# imports are required for extensions which can be moved
|
||||
# from nailgun directory to different place
|
||||
ignore = H234,H302,H802,H304
|
||||
# NOTE(dmeltsaykin): E402 and E731 should be ignored because
|
||||
# otherwise it would be needed to change many of legacy code
|
||||
# and these were previously ignored before update to recent
|
||||
# flake8
|
||||
ignore = H234,H302,H802,H304,E402,E731,E713,W503,E128,E266,E123,E265,E714,E712,E251,E305,E121,E122,E115,E126
|
||||
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,__init__.py,docs
|
||||
show-pep8 = True
|
||||
show-source = True
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
-r requirements.txt
|
||||
hacking==0.7
|
||||
mock==1.0.1
|
||||
pytest
|
||||
unittest2
|
||||
|
|
|
@ -14,7 +14,7 @@ commands = py.test {toxinidir}/url_access_checker/tests
|
|||
downloadcache = ~/cache/pip
|
||||
|
||||
[testenv:pep8]
|
||||
deps = hacking==0.7
|
||||
deps = flake8
|
||||
usedevelop = False
|
||||
commands =
|
||||
flake8 {posargs:.}
|
||||
|
@ -27,7 +27,7 @@ envdir = devenv
|
|||
usedevelop = True
|
||||
|
||||
[flake8]
|
||||
ignore = H234,H302,H802
|
||||
ignore = H234,H302,H802,E402,E731,E713,W503,E128,E266,E123,E265,E714,E712,E251,E305,E121,E122,E115,E126
|
||||
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,__init__.py,docs
|
||||
show-pep8 = True
|
||||
show-source = True
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
hacking>=0.8.0,<0.9
|
||||
mock==1.0.1
|
||||
testrepository>=0.0.18
|
||||
unittest2
|
||||
|
|
|
@ -15,7 +15,7 @@ commands =
|
|||
downloadcache = ~/cache/pip
|
||||
|
||||
[testenv:pep8]
|
||||
deps = hacking==0.7
|
||||
deps = flake8
|
||||
usedevelop = False
|
||||
commands =
|
||||
flake8 {posargs:shotgun}
|
||||
|
@ -33,7 +33,7 @@ envdir = devenv
|
|||
usedevelop = True
|
||||
|
||||
[flake8]
|
||||
ignore = H234,H302,H802
|
||||
ignore = H234,H302,H802,E731,E713,W503,E128,E266,E123,E265,E714,E712,E251,E305,E121,E122,E115,E126,E402
|
||||
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,__init__.py,docs
|
||||
show-pep8 = True
|
||||
show-source = True
|
||||
|
|
Loading…
Reference in New Issue