213 Commits

Author SHA1 Message Date
Sachi King
44905578fd Add -constraints sections for base CI jobs
Using factors with sections is not a thing and likely will not be for
a while, as such we are going to have to duplicate sections to be able
to set the constraints based install_command.

Implements Blueprint: Requirements-Management

Change-Id: Ie679904330a83e4b7eb75c189b48afef127b0d22
2015-10-14 10:48:05 +00:00
Cyril Roelandt
477fcca1c0 Add the functional-py34 and dsvm-functional-py34 targets to tox.ini
This will allow us to run the functional tests on the gates using Python 3.

Change-Id: I218c73398c6ed6cff776b65a66cb9336219cba77
Partial-Bug: #1500400
2015-10-07 11:43:19 +02:00
armando-migliaccio
8ce04529e2 Fix db error when running python34 Unit tests
Follow fixes [1] to address this potential issue.

Closes-bug: #1489059

[1] https://review.openstack.org/#/q/status:merged++topic:bug/1489059,n,z

Change-Id: Ica389978869ae47c262cd797e85a7d7874254df7
2015-09-30 20:50:13 -07:00
Jenkins
35a9d72f46 Merge "Enable most unit tests for py34 job" 2015-09-04 20:55:18 +00:00
Jenkins
ab8ed7597e Merge "Add constraint target to tox.ini" 2015-09-04 09:33:18 +00:00
Ihar Hrachyshka
ef409d9da2 Enable most unit tests for py34 job
* Skip TestWSGIServerWithSSL[1] for Python 3 since it seems wsgi + ssl +
  eventlet setup does not behave correctly now,
* Skip test_json_with_utf8[2] until we solve unicode/utf8 encode/decode,
* Fix some more tests to pass for py3,
* Replace print by print() in docs/docstrings.

[1] neutron.tests.unit.test_wsgi (bug 1482633)
[2] neutron.tests.unit.test_wsgi.JSONDictSerializerTest (bug 1491824)

Related-Bug: #1482633
Related-Bug: #1491824
Blueprint: neutron-python3
Co-Authored-By: Cyril Roelandt <cyril@redhat.com>
Co-Authored-By: Cedric Brandily <zzelle@gmail.com>
Co-Authored-By: sonu.kumar <sonu.kumar@nectechnologies.in>
Change-Id: I26e513d4dcf473f4cd79728382fc94af3d901b5d
2015-09-04 08:30:22 +00:00
Sachi King
c029954c8a Add constraint target to tox.ini
This adds a pip install command to tox.ini that is only used when the
tox env is passed with the 'constraints' factor appended onto it.
As such this will not effect developer workflows or current unit tests.

The initial use of this will be in a non-voting job, to verify that the
constrained checks with tox are stable.  DevStack is already running
constrained jobs, as such problems are no expected.

To run a tox with pip using constraints on a developer system a
developer should run the desired tox environment with -constraints.
For example: $(tox -epy27-constraints)
Pip will pull the current version of the upper-constraints.txt file down
from the git.openstack.org, however this method can be overriden to use
a local file setting the environment variable "UPPER_CONSTRAINTS_FILE"
to the local path or a different URL, it is passed directly to pip.

This is currently not enabled in the default tox run, however it is
possible to enable it as a default by adding it to 'envlist' in tox.ini

Change-Id: I13579599dfdf846d06d8c39f33265e8b46db6e68
Depends-On: I17ac389f78af241917b6da7f049085f2b13d30f2
Implements Blueprint: Requirements-Management
2015-09-02 09:10:31 +10:00
Pavel Bondar
7ea38a14bd Enable py34 tests for pluggable ipam backend
Enable neutron.tests.unit.db.test_ipam_pluggable_backend.
It was disabled after extending ipam tests to run db_base_plugin tests,
which are not py34 compatible yet.

Change-Id: I3ae491fa79d4c3311a86e98db3fb2f7d5926a0ba
2015-09-01 11:57:11 +03:00
Cedric Brandily
99c9af8f7a Python 3: use a hash to sort dictionaries
Dictionaries are unorderable in py3K. This change defines the method
safe_sort_key[1] which could be used a sort function for list of
dictionaries and non-dictionaries.

[1] neutron.common.utils

Change-Id: I9c9fae53bb3ac5b8611c92164c9630c82c2d0ceb
Blueprint: neutron-python3
2015-08-31 22:53:27 +02:00
Clark Boylan
b68236d32b Run py34 tests with testr
This doesn't use os-testr but it results in html reports built from
the subunit logs.

A note from amuller: tox -e py27 uses ostestr. The primary difference
between testr and ostestr (For my money) is that ostestr spits out
progression. After a conversation with mtreinish (The author of ostestr)
it doesn't seem to be possible to use tox with ostestr for our py34
tests because we use a long regex that is split on newlines. ostestr
supports the --regex flag as such (regex_a|regex_b), however it's not
possible to use that with newlines and to play nice with tox.
Since I think that we do want to use ostestr (Just like the py27 venv),
I'll work with mtreinish to introduce a white list regex file in to
ostestr. The file will be maintained in the repo and passed in to
ostestr via tox.

Change-Id: I1f1030cca4fd356e468d15126a730725ac9c099c
2015-08-25 19:03:38 -04:00
armando-migliaccio
255ef14146 Allow py34 to run tests individually
Prior to this patch, when I do:

 tox -epy34 <my-test>

the argument is ignored and all whitelisted tests are executed.
This is not in line with the other testenv's. This patch ensures
that posargs are processed if available, and that we fall back on
the lot of tests when not specified.

Change-Id: I176d7bba690b1c7e0c64d11528d9c851472b503b
2015-08-25 04:04:16 +00:00
Oleg Bondarev
4bbd854740 Move db agent schedulers test to a more appropriate place
Current placing is confusing as in fact the tests have little to do
with ml2 and openvswitch.
This was triggered by discussion on https://review.openstack.org/199514
Next step should be to separate dhcp and l3 schedulers tests.

Change-Id: Ie05874fdc1c3070ed319e8f624c8217c5c0bb646
2015-08-24 15:14:13 +03:00
Jenkins
9274277ff4 Merge "Python 3: use __code__ instead of func_code" 2015-08-22 19:19:04 +00:00
Cyril Roelandt
6f76ca6b90 Python 3: fix test_ovs_tunnel
In Python 3, __bool__ should be used instead of __nonzero__.

Change-Id: I04b688a6ac079a161bd888c53b8b98b574171ea9
Blueprint: neutron-python3
2015-08-21 12:19:30 +02:00
Cyril Roelandt
4af5ee82e3 Python 3: use __code__ instead of func_code
The former works with both Python 2 and 3.

Change-Id: Id2f6d313bf90777e02b20b7f6f4fb99e79e85aff
Blueprint: neutron-python3
2015-08-21 11:51:09 +02:00
Jenkins
40576ae09c Merge "Python 3: hmac requires bytes key/msg" 2015-08-21 03:48:47 +00:00
Jenkins
0c80f3f3d1 Merge "Python 3: fix test_utils" 2015-08-18 21:00:13 +00:00
Jenkins
c6abc6890c Merge "Python 3: fix neutron.tests.unit.api.test_extensions" 2015-08-18 20:57:03 +00:00
Cyril Roelandt
5afd046d53 Python 3: fix test_utils
In Python 3, the error message returned when unpacking too many values is a bit
different from the one we see in Python 2:

Python 2:
  ValueError: too many values to unpack

Python 3:
  ValueError: too many values to unpack (expected <number of values>)

Blueprint: neutron-python3
Change-Id: Ib607a526c007567a370c521fd7e2e4f8b504b934
2015-08-18 15:13:18 +02:00
Salvatore Orlando
09324277ae Quota enforcement: python3 compatibility
This patch does a simple fix to the quota DB driver in order
to ensure its compatibility with python3 and adds the quota
enforcement unit tests to the list of those executed as a part
of the py34 test environment.

Change-Id: I9b5601632866e1fb42f860d1cca5f77b5f14f2c8
Related-blueprint: better-quotas
2015-08-17 23:01:12 +00:00
Cyril Roelandt
0a4812d6e8 Python 3: fix neutron.tests.unit.api.test_extensions
Change-Id: I4db43d93ae22c4a480aa1d103c8e7cf1427d49db
2015-08-13 16:01:07 +02:00
Cedric Brandily
60a9f4a6f8 Python 3: hmac requires bytes key/msg
This change encodes hmac key/msg inputs because py3K requires it.

Change-Id: I54a6789aee2fb707c0d753f569d0b2d5fd460682
Blueprint: neutron-python3
2015-08-13 12:30:42 +02:00
Jenkins
711806cdb6 Merge "Python 3: specify a bytes to an argument for a format type 's' of struct.pack()" 2015-08-13 08:10:40 +00:00
fumihiko kakuma
9744ef78e6 Python 3: specify a bytes to an argument for a format type 's' of struct.pack()
In python 3, a format type 's' of struct.pack() requires a bytes object to an argument.

Change-Id: Ia4640b31c31b5b7454cd1582af46562fb1885726
Blueprint: neutron-python3
2015-08-13 07:55:50 +09:00
Cedric Brandily
7809f1574c Python 3: compare response.body to bytes in namespace_proxy test
WebOb response bodies should be compared to bytes not string.

Change-Id: I2c17d39cc394a1d583b4f4971c0db9ba1875a0d0
Blueprint: neutron-python3
2015-08-12 10:07:14 +00:00
Cedric Brandily
07d3d69663 Python 3: encode unicode response bodies
WebOb disallows in py3K to set webob.Response.body to a unicode object,
we should encode unicode bodies in such case.

Change-Id: Ie0dc57fbe3ed9b19dac2e958de14387bc4c1a260
Blueprint: neutron-python3
2015-08-11 00:33:06 +02:00
Cyril Roelandt
1d0eea7540 Python 3: Fix test_security_groups_db
In Python 3, Exception() is not iterable.

Change-Id: I89ffefeebb18f967129245936270318014f17f3f
Blueprint: neutron-python3
2015-08-03 11:56:41 +02:00
Jenkins
bb38f6f823 Merge "Remove unneeded OS_TEST_DBAPI_ADMIN_CONNECTION" 2015-08-02 03:20:13 +00:00
Jenkins
7b3abffc2c Merge "Arista Drivers decomposition part II" 2015-08-01 00:48:44 +00:00
Sukhdev Kapur
50eb8041bd Arista Drivers decomposition part II
As a part of vendor driver decomposition,
this patch moves the remaining Arista specific
code to openstack/networking-arista

Change-Id: Ie16b5ed936b116043dea36ec967bb5ae9cdacbdf
Partial-Implements: blueprint core-vendor-decomposition
2015-07-31 12:38:40 -07:00
Cyril Roelandt
99f9ec3e38 Python3: pass bytes to binascii.crc32
In Python3, binascii.crc32 must be given bytes. This commit does not change the
behaviour in Python 2.

Change-Id: I91607ced4ab26d1d2e3eb31a3e4b2a4b2131b7bd
Blueprint: neutron-python3
2015-07-31 17:41:53 +02:00
Jenkins
94dea10828 Merge "Python 3: fix test_attributes" 2015-07-30 15:30:01 +00:00
Jenkins
50d662d95a Merge "Create packages for quota modules" 2015-07-29 22:21:29 +00:00
Salvatore Orlando
1663f5c197 Create packages for quota modules
This patch simply renames quota modules introducing two
new packages:
1) neutron.quota
2) neutron.db.quota

This paves the way for adding more quota related modules.
Unit tests paths are changed accordingly, as well as references
to moved modules.
This patch hovewer preserves the ability of importing
neutron.db.quota_db in order to avoid breaking repositories which
use neutron as a requirement.

Change-Id: I946e87f1b2ebb3e80d64aecfe58aeff9f81896f3
Related-blueprint: better-quotas
2015-07-28 11:55:01 -07:00
Cyril Roelandt
237fa342f9 Python 3: fix test_attributes
In Python 3, strings have an __iter__ method, which makes convert_to_list fail.

Change-Id: I2411ecd31d7d05ff6f0f004180edffc76d28573b
Blueprint: neutron-python3
2015-07-28 17:12:21 +02:00
Cyril Roelandt
1f76a9061d Python 3: fix test_dhcp
In Python 3, dhcp.LOG.process is not called when calling dhcp.LOG.debug. Since
what we really want to know is whether dhcp.LOG.debug is called, tweak the test
a little.

Change-Id: I9c9d9a6162181d6e518a603193013c28e218cdee
Blueprint: neutron-python3
2015-07-28 17:02:44 +02:00
Jenkins
6b0ab7fd63 Merge "Python 3: do not index dict_values objects" 2015-07-27 21:33:36 +00:00
Jenkins
6735500d40 Merge "Python 3: fix test_context" 2015-07-27 21:33:21 +00:00
Cyril Roelandt
619ac1c91a Python 3: fix test_context
In Python 3, b'...'.startswith must be given bytes.

Change-Id: I4e83685ac6119db6f16d693df37955620271082f
Blueprint: neutron-python3
2015-07-27 16:57:08 +02:00
Ivar Lazzaro
e0ba53a09a Decompose Apic ML2 mechanism driver
As a part of the vendor decomposition effort, the
apic ML2 driver code is removed and replaced by
its version in the openstack/networking-cisco
repo.

Change-Id: Iffb5245b4c88b65afe62dd7435ee80489a654fee
Partial-implements: blueprint core-vendor-decomposition
2015-07-24 19:32:49 +00:00
Cyril Roelandt
257020a777 Python 3: do not index dict_values objects
Change-Id: I7260468b81d42415ac08ecda09973720b5b263a4
Blueprint: neutron-python3
2015-07-24 21:00:52 +02:00
Jenkins
20f099150f Merge "Add Pluggable IPAM Backend Part 2" 2015-07-24 17:18:14 +00:00
Pavel Bondar
2921f6dfa2 Add Pluggable IPAM Backend Part 2
Introduces new Pluggable IPAM backend.
IP/subnet allocation calls are sent to IPAM driver.
Calls to IPAM Driver are considered as call to third-party
environment, so if any action fails, rollback action is called.

Removes associate_neutron_subnet step from interface and reference
driver. It is not needed any more because foreign key relationship
between IPAM subnet and neutron subnet was removed.
So IPAM subnet can store id of neutron subnet,
which is not created yet.

For now only reference IPAM driver is available.

Temporarily disabled test_ipam_pluggable_backend from
gate-neutron-python34. Current patch adds executing
parts of test_db_base_plugin_v2, which is not py34 compatible yet.
Might be enabled back once 204791 is merged.

Partially-Implements: blueprint neutron-ipam

Change-Id: Ic18461cf19d2eebf8fad5535eee0eb034959800e
2015-07-24 10:31:39 +03:00
Jenkins
5ba4fa846d Merge "Python 3: fix neutron.tests.unit.agent.dhcp.test_agent" 2015-07-24 05:52:05 +00:00
Cyril Roelandt
7033960d34 Python 3: fix neutron.tests.unit.agent.dhcp.test_agent
A simple "list vs dict_keys" issue was preventing two tests from succeeding.

Change-Id: I9386ddc600005ebb1b3f5382f6e43c19d31d4213
Blueprint: neutron-python3
2015-07-23 17:37:33 +02:00
Jenkins
9d03b11837 Merge "Python 3: fix neutron.tests.unit.agent.linux.test_async_process" 2015-07-23 14:12:06 +00:00
Cyril Roelandt
3e168be46a Python 3: enable more tests
Now that Routes 2.2 has been released, we can run some tests that were
previously commented out.

Change-Id: I46d8479ae4f29dc8b26143e7a49f88ff35198e9d
Blueprint: neutron-python3
2015-07-22 15:06:16 +02:00
Jenkins
6780c304aa Merge "Python 3: fix test_provider_configuration" 2015-07-22 04:45:31 +00:00
Cyril Roelandt
6226fb73a4 Python 3: fix neutron.tests.unit.agent.linux.test_async_process
In Python 3, one cannot compare an integer to None.

Change-Id: I8de3ea3752be837540ea65f1bb254a095927de44
Blueprint: neutron-python3
2015-07-20 17:02:14 +02:00
Jenkins
486c0ee522 Merge "Use oslo_log.helpers.log_method_call" 2015-07-18 00:53:47 +00:00