332 Commits

Author SHA1 Message Date
Ihar Hrachyshka
380e384f18 Revert "Revert "Revert "Remove TEMPEST_CONFIG_DIR in the api tox env"""
This reverts commit be63289c273fa02159a6958e0b456d5fda217431.

Yes, it's a third order revert. Ain't it cool?

Now that tox 2.3.1 is used in gate, and it is expected to fix the issue
that we originally hacked around here, let's revert to the previous
code.

For the least, it makes API target executable locally without the need
to set TEMPEST_CONFIG_DIR in the external environment.

Also bump minimal tox version to 2.3 to avoid users hitting the old
issue with their tox 2.2.* package.

Change-Id: Ic64cb466d117ad39436cb1d079c8f5657260da2c
Related-Bug: #1515335
2016-01-06 16:14:26 +00:00
Martin Hickey
074268f74c Add test for Neutron object versions
Adds a test to Neutron to check object versions for any changes
to objects. It prompts the developer to update the version of the
changed object. It uses oslo.versionedobjects.

Change-Id: I99454b28ae0b5fa663354eeccdf709d4030a280b
Co-Authored-By: Ryan Rossiter <rlrossit@us.ibm.com>
2016-01-06 10:34:03 +00:00
gong yong sheng
240facf9e6 Allow tox to pass more arguments to ostestr command
Co-Authored-By: Kevin Benton <blak111@gmail.com>
Change-Id: Ie9969e0a5254ab5dd33b287f6d3120362b73edd7
Closes-bug: #1490389
2016-01-05 14:53:19 -08:00
armando-migliaccio
fce50f3beb Run functional gate jobs in a constrained environment
This patch modifies the gate hooks to run jobs with upper constraints.

Change-Id: I9eb1eb8e61381e9bb45678af8a24fa88a99e2c8f
2015-12-22 19:31:59 -08:00
Jenkins
899a2ba26c Merge "Improve tox to show coverage report on same window" 2015-12-17 11:32:26 +00:00
Manjeet Singh Bhatia
f9b3edb97d Improve tox to show coverage report on same window
with this patch coverage report will be shown with the results when
tox -e cover will be run

Change-Id: Ic975e65f1b3abadd90075e7f040c605e3740990f
2015-12-15 21:36:45 +00:00
Ondřej Nový
9b0bc3e5b3 Deprecated tox -downloadcache option removed
Caching is enabled by default from pip version 6.0

More info:
https://testrun.org/tox/latest/config.html#confval-downloadcache=path
https://pip.pypa.io/en/stable/reference/pip_install/#caching

Change-Id: I1778135d68a4bf96da3a0c0e4660172d1f13d16b
2015-12-11 21:34:32 +01:00
Assaf Muller
dd5a8e4166 Tox: Remove fullstack env, keep only dsvm-fullstack
In the functional tests we have 'functional' and 'dsvm-functional'
venvs. The difference is that dsvm-functional requires can run
rootwrap commands on the machine. In the fullstack context,
not running rootwrap commands doesn't make sense, as fullstack
tests are explicitly and solely integration tests.

Change-Id: I1e85537d137a1b773198facbb835a65b6d0ce9b4
2015-12-05 17:17:13 -05:00
Doug Wiegley
14e7b932fc Allow multiple imports for both ways of doing i18n
Disallowing the old way makes the transition period messier than
it needs to be.

Change-Id: I687f18f0f0554f3198320a94f2e664896e88fbfc
2015-12-03 12:53:55 -07:00
Doug Wiegley
dd726ed494 Move i18n to _i18n, as per oslo_i18n guidelines
- This does NOT break other projects that rely on neutron.i18n,
  as this change includes a debtcollector shim to maintain those
  older entry points, until they can migrate.
- Also updates _i18n.py to the latest pattern defined by oslo_i18n
- Guidance and template are from the reference:
  http://docs.openstack.org/developer/oslo.i18n/usage.html

Partially-Closes-Bug: #1519493
Change-Id: I1aa3a5fd837d9156da4643a367013c869ed8bf9d
2015-12-01 19:29:10 -07:00
Martin Hickey
71190773e1 Automatically generate neutron core configuration files
This adds a new tox environment, genconfig, which generates sample
neutron core configuration file using oslo-config-generator.

Updates to some configuration option help messages to reflect useful
details that were missing in the code but were present in config files.

It also adds details to devref on how to update config files.

Partially-Implements: blueprint autogen-neutron-conf-file

DocImpact

Change-Id: I1c6dc4e7d479f1b7c755597caded24a0f018c712
Closes-bug: #1199963
Co-Authored-By: Louis Taylor <louis@kragniz.eu>
2015-11-27 15:22:59 +00:00
Doug Hellmann
54c390cb32 force releasenotes warnings to be treated as errors
Change-Id: I48ecfbd8992a81fe13838e6c353195188f7cb3cd
Related-Bug: #1519912
2015-11-25 18:32:17 +00:00
Ihar Hrachyshka
143b3dc286 tox: pass TEMPEST_CONFIG_DIR envvar into api target environment
Currently, API job skips all tests because TEMPEST_CONFIG_DIR is not set
properly. The environment variable was hardcoded to
/opt/stack/tempest/etc before, and since that's the location for tempest
configuration files that was used in gate, it worked fine there.

But after we were forced to remove the hardcoded value from the file due
to regression in tox 2.2.0+ (If3742b6eabe295a5aaeb4901c55909a70c451698),
it was neither hardcoded, nor passed from the external gate environment.

Note that since tox 2.0.0, the tool does not pass all envvars into tox
targets, but require explicit specification of the list of variables
that should be allowed into the target environment, using passenv
directive.

So that's what the patch does: it allows TEMPEST_CONFIG_DIR to get into
api tox target, which should be enough to make the API job avoid
skipping all tests.

Users are still required to set TEMPEST_CONFIG_DIR variable locally if
they want to execute the suite locally.

Closes-Bug: #1518632
Change-Id: Ia7dcc6785390a6012c7ba16a14573aa44f2b6fb5
2015-11-24 15:19:07 +01:00
Jenkins
7286260f85 Merge "Require tox >= 2.0" 2015-11-13 19:06:55 +00:00
Ihar Hrachyshka
be63289c27 Revert "Revert "Remove TEMPEST_CONFIG_DIR in the api tox env""
This reverts commit a3154b03ac60df586bd8fd67f03c20327f2dde41.

The revert was merged too quickly, without waiting for tox project to fix us.
The gate passed for the revert only because infra folks removed images
that had new tox in them. We will be broken by the next images though.

Change-Id: I148c80e5b9512fee280ecbf3ca7498ddf1cfd96d
2015-11-12 21:57:16 +00:00
Ihar Hrachyshka
497932466c Require tox >= 2.0
We use passenv in the file, and as per [1], it's introduced in tox 2.0.

[1] https://testrun.org/tox/latest/config.html#confval-passenv=SPACE-SEPARATED-GLOBNAMES

Change-Id: I97f1f903dec10b4a91fc27d62990ab974c5831bf
2015-11-12 22:22:28 +01:00
Ihar Hrachyshka
a3154b03ac Revert "Remove TEMPEST_CONFIG_DIR in the api tox env"
This reverts commit a32e31a624cf5190ed267effed8f7db2c9919949.

We should be able to merge the revert back once tox project fixes the
bug* on their side.

* https://bitbucket.org/hpk42/tox/issues/285/tox-220-breaks-some-toxini-config-files

Change-Id: Ic1f5391c687b2683cbaab210c543022aa1f26e83
Related-Bug: #1515335
2015-11-11 20:18:14 +01:00
rossella
a32e31a624 Remove TEMPEST_CONFIG_DIR in the api tox env
Setting TEMPEST_CONFIG_DIR in tox.ini is breaking the gate,
probably because of a tox bug [1].
Removing the line to unblock the gate. This implies that
for local execution of the tests TEMPEST_CONFIG_DIR
should be set manually.

[1] https://bitbucket.org/hpk42/tox/issues/285/tox-220-breaks-some-toxini-config-files

Change-Id: If3742b6eabe295a5aaeb4901c55909a70c451698
Closes-bug: #1515335
2015-11-11 19:18:45 +00:00
Kyle Mestery
271d3c1fae Add reno for release notes management
Change-Id: I0c9b6d9a0e77b57e3637260b6e73edfe78afe5ae
Signed-off-by: Kyle Mestery <mestery@mestery.com>
2015-11-04 22:27:56 +00:00
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