373 Commits

Author SHA1 Message Date
Zuul
dd14501c12 Merge "tox: Hide deprecation warnings" 2018-11-27 20:58:28 +00:00
Zuul
8418ecdbc6 Merge "Add python 3.6 unit test job" 2018-11-21 03:38:45 +00:00
Lajos Katona
db06d24414 tox: Hide deprecation warnings
Running tox targets on python3 write out a lot of DeprecationWarning,
the idea to hide them comes from this patch:
https://review.openstack.org/611884 from Stephen Finucane.

Change-Id: Id002ced641bba9833a633b331a3aa82ff0252f47
2018-11-20 17:46:37 +01:00
Bernard Cafarelli
e67d99b654
Make neutron-fullstack job run py3
In the Neutron CI meeting on 2018-10-02 [1] we decided on the proper
approach for fullstack testing of Neutron in Zuul.  The approach is:

1. There should be only one fullstack CI job, named "neutron-fullstack"
2. The neutron-fullstack job should invoke python3 in tox.ini

This change implements the agreed-upon approach.
Switching the nodeset to newer OS will be handled in a separate step

[1] http://eavesdrop.openstack.org/meetings/neutron_ci/2018/neutron_ci.2018-10-02-16.00.html

Co-Authored-By: Nate Johnston <nate.johnston@redhat.com>
Change-Id: I37c1cb42b3a94532e7b7fea21a929a39fe63f00b
2018-11-13 14:31:19 +01:00
Nguyen Hai Truong
13b7f4f7da Add python 3.6 unit test job
This is a mechanically generated patch to add a unit test job running
under Python 3.6 as part of the python3-first goal.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Change-Id: I08e6b9fb4223569c3db04b54137d9092062c22ea
2018-11-08 23:41:08 +07:00
Brian Haley
fc95db987d Fix flake8 N534 untranslated exception message
Fix N534 untranslated exception message warnings and
enable enforcement.

Trivialfix

Change-Id: I9e2b51c768cbb6fcf5588070d1b9e9835775b374
2018-10-19 15:46:04 -04:00
Zuul
8c05cd31ef Merge "Fix flake8 H404 errors" 2018-10-09 07:00:33 +00:00
Brian Haley
2b57f08576 Fix flake8 H404 errors
Fix H404 error and start enforcing it.

Trivialfix

Change-Id: Iaa6fb4f1f07dee32a944259ab65204360d9db7ea
2018-10-05 21:48:41 +00:00
Doug Hellmann
1307cb7587 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I9530cd2433e0e34f05667d33bd6469b2592f8738
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-04 18:04:02 +00:00
Slawek Kaplonski
82224347de Update list of skipped bandit plugins
Plugin B111 "Test for the use of rootwrap running as root"
was removed from bandit in [1].
Blacklist call of hashlib.sha1 was blacklisted in bandit
with [2] and it is now added to list of skipped tests in
Neutron.
This commit adds also plugin B604 to list of skipped plugins.

[1] d93eed5492
[2] 35e35446b0

Change-Id: I33d6089b497fccfca4b212e2a62fb881cae9cb94
2018-08-17 09:36:11 +02:00
IWAMOTO Toshihiro
0f180d8e2e Adopt hacking 1.1.0
This incorporates flake8 2.6.x and pycodestyle will be used
instead of older pep8.  This ensures future python3 compatibility
and a bit better code styling.

Change-Id: Ia7c7c5a44727f615a151e1e68dd94c7ed42f974f
2018-07-05 11:31:40 +09:00
Doug Hellmann
5c89506181 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: Id3804896efc11de24d5e13500cdce7571e6d3314
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-13 15:02:25 -04:00
Slawek Kaplonski
ec537c49e9 Switch to stestr
According to Openstack summit session [1] stestr is
maintained project to which all Openstack projects
should migrate.
Let's switch it then.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: If3383707c9baf69e03bcccc50970da748a834141
2018-06-02 13:03:33 +02:00
Zuul
e89678b28f Merge "Add a debug env for unit tests" 2018-05-05 02:26:21 +00:00
Brian Haley
7cfdf4aa81 Fix all pep8 E129 errors
Fixed all pep8 E129 errors and changed tox.ini to no longer
ignore them.

Change-Id: I0b06d99ce1d473b79a4cfdd173baa4f02e653847
2018-05-03 13:44:04 +09:00
Brian Haley
c3b83a9ca6 Fix all pep8 E265 errors
Fixed all pep8 E265 errors and changed tox.ini to no longer
ignore them.  Also removed an N536 comment missed from a
previous change.

Change-Id: Ie6db8406c3b884c95b2a54a7598ea83476b8dba1
2018-04-30 16:35:52 -04:00
Zuul
0aeccc5500 Merge "Remove N536 ignore in tox.ini" 2018-04-29 16:09:31 +00:00
Manjeet Singh Bhatia
dd8aea24bd Add a debug env for unit tests
Debugging unit tests locally with pdb ends in failure with tox.
this patch adds debug environment to debug tests with pdb
break points by following below steps.

1. set break point in code by adding import pdb;pdb.set_trace
2. run tox -e debug test_regex

Change-Id: I088a558a1fb68b3bc2a218ccda0911ed1389f91f
2018-04-28 00:08:43 +00:00
Brian Haley
a8ab93b846 Increase lower-constraints job timeout to 60 minutes
The openstack-tox-lower-constraints job is timing out
a lot at the 40 minute mark, increase to 60 minutes
to try and stabilize it.

Change-Id: I5becda7dd3d2a2ff4883fc4265eb35882173b1c0
2018-04-26 11:45:18 -04:00
Brian Haley
f38b7b9dca Remove N536 ignore in tox.ini
Seems we already comply, so don't ignore.

Change-Id: I5c6b1800105aa2f78577d0b5383905064e06fb7f
2018-04-25 17:32:09 -04:00
Zuul
5e1ddc7247 Merge "Eliminate possible insecure usage of temp file/directory" 2018-04-25 20:24:55 +00:00
Max Pavlukhin
f6b0f7635c Eliminate possible insecure usage of temp file/directory
This patch is a fix for the issue B108: hardcoded_tmp_directory
found by bandit scanner.

The main reasoning for that is the need for safely creating
a temporary file or directory.

Change-Id: I4277e9196b9b707b83bb298faeccb59f07d6f10b
Related-Bug: #1759250
2018-04-24 17:57:30 +04:00
Brian Haley
de243a3513 Fix E402 pep8 errors
Fix E402 (module level import not at top of file) pep8 errors
and no longer ignore new failures.

Trivialfix

Change-Id: If9a202f1f322b5b03966c692e33e94b7c872079b
2018-04-20 18:13:07 +00:00
Brian Haley
90cd939047 Fix W503 pep8 warnings
Fix W503 (line break before binary operator) pep8 warnings
and no longer ignore new failures.

Trivialfix

Change-Id: I7539f3b7187f2ad40681781f74b6e05a01bac474
2018-04-17 14:22:58 +00:00
Zuul
4ec9fae6af Merge "Replace assert to raise AssertionError" 2018-04-11 20:10:35 +00:00
Akihiro Motoki
7a714aeb13 Fix pep8 errors
Recent pep8 upgrade and corresponding pycodestyle update break
pep8 job due to the new rules.

This commit fixes the following new errors:
- E266 too many leading '#' for block comment
- E501 line too long
- H903  Windows style line endings not allowed in code

The following errors are added to the ignore list
as there are many errors:
- E402 module level import not at top of file
- E731 do not assign a lambda expression, use a def
- W503 line break before binary operator

Change-Id: I1fd3357479bb2ba3d89de92739ffac99900761b6
2018-04-11 01:10:49 +09:00
Max
6e6166bda4 Replace assert to raise AssertionError
This patch is a fix for the issue B101 assert_used found by bandit
scanner:
https://docs.openstack.org/bandit/latest/plugins/b101_assert_used.html
As assert functionality could be turned off by the -O option for python
interpreter, assert statements were replaced to raise AssertionError.

The main reasoning for that is rest code after assert could be not
ready for values that assert filters.

Change-Id: I92a871b1b496c96c0c76cb37e4dda51bfc007e38
Related-Bug: #1759250
2018-04-10 16:01:48 +04:00
Zuul
bfefbaf1c7 Merge "add lower-constraints job" 2018-03-25 23:43:45 +00:00
Nguyen Hai
0556a2ab73 Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:
https://governance.openstack.org/tc/reference/project-testing-interface.html
http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Remove the '[build_sphinx]' as described in:
http://lists.openstack.org/pipermail/openstack-dev/2018-March/128594.html

Change-Id: Id3d7065028b4c0831e6b5c2363b19626734817a3
2018-03-24 13:23:33 +09:00
Doug Hellmann
3c85a1e140 add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.

Add openstack-tox-lower-constraints job to the zuul configuration.

See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.

Change-Id: I78f0beea8f78aa635b59bc80c97fec41412049e0
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-22 16:27:44 -04:00
Zuul
1f2a5b34de Merge "Update upper-constraints consumption" 2018-03-09 19:49:30 +00:00
Monty Taylor
4a0200a2d4 Update upper-constraints consumption
In order to deal with neutron going into the upper-constraints file so
that neutron plugins can consume it normally, we need to align the
constraints invocation in neutron's tox.ini. This means putting the -C
argument into the dependencies list rather than the pip install line so
that it doesn't get appended to tox installing neutron itself.

Needed-By: https://review.openstack.org/550475
Change-Id: I014177c8afcadd3e6acb20bd38bb9d9fcc778ed6
2018-03-08 14:58:33 +00:00
Luong Anh Tuan
0d3ffa6ebc Enable more extensions in pep8
This patch enable extensions:
-[H204] Use assert(Not)Equal to check for equality.
-[H205] Use assert(Greater|Less)(Equal) for comparison.

Change-Id: I9ad51e006561251030b5a6759c930b87ff94a861
2018-03-05 02:25:23 +00:00
Sławek Kapłoński
f5d9890c8d [Fullstack] Limit number of test workers to 4
By default there is as many test workers running fullstack
tests as cores on host.
On gate tests it is 8 cores so 8 test workers.
Each such workers spawns own neutron-server and agents.
That cause quite big load on such test node. From my tests
it looks that it can be up to 25.
By lowering number of test workers to 4 I observed that
load is at max about 10.
Overall time of tests is longer for about 10-15 minutes
(about 45-50 minutes with 8 workers and about 60-65 minutes
with 4 workers).

Change-Id: I58cb2ade598e8dc2377e6187483cb39881a9dc3c
2018-02-23 12:40:53 +00:00
Boden R
fc6e9a71d8 add doc link validation to release checklist and tox
This patch updates our doc conf.py to support the linkcheck builder in
addition to adding a new 'linkcheck' target in tox to run the builder.
Also the release checklist is updated suggesting the linkcheck tox
target be run prior to a release.

Change-Id: Ia7c282b7331f0b624bb3324f27dfec223cf414f7
Closes-Bug: #1716005
2017-09-21 15:24:03 -06:00
Mike Bayer
67589fbf99 Allow OS_TEST_TIMEOUT to be configurable from env
the OS_TEST_TIMEOUT of 180 is too short for
some test servers.  Allow it to be modified from the
outside via environment.  Currently I have to sed the tox.ini
file to fix this.

Change-Id: Ib0e9aa0fff4cd26be115cc4b12036e9ee5e737f3
2017-09-12 15:11:03 -04:00
Jenkins
5d2017efc3 Merge "Hook bandit security linter to pep8 target" 2017-08-24 06:10:40 +00:00
Inessa Vasilevskaya
7322bd6efb Make code follow log translation guideline
Since Pike log messages should not be translated.
This patch removes calls to i18n _LC, _LI, _LE, _LW from
logging logic throughout the code. Translators definition
from neutron._i18n is removed as well.
This patch also removes log translation verification from
ignore directive in tox.ini.

Change-Id: If9aa76fcf121c0e61a7c08088006c5873faee56e
2017-08-14 02:01:48 +00:00
Armando Migliaccio
85a3e93537 Hook bandit security linter to pep8 target
This helps catch a number of potential issues with the neutron
code in advance. A false positive can be skipped with #nosec
at the offending line, just like #noqa can be added on
offending module imports.

Change-Id: I3e4cbc94539dd2cce61bfa5cd0265e75d7336311
2017-08-09 19:48:05 -07:00
Armando Migliaccio
bd4c2c9760 Add bandit target to tox
Change-Id: I3ca2f77e026167bf6828072ccd02872e7c504c1c
2017-07-28 17:49:28 -07:00
YAMAMOTO Takashi
af4bfb35a2 Stop using non-ascii characters
Namely, Replace U+2019 RIGHT SINGLE QUOTATION MARK
with U+0027 APOSTROPHE where appropriate.

Change-Id: Iec9e8f85bcddeb90e9a7fb8f845a7923cac38f52
2017-07-18 17:11:23 +09:00
Akihiro Motoki
f64110f652 Use flake8-import-order plugin
In reviews we usually check import grouping but it is boring.
By using flake8-import-order plugin, we can avoid this.
It enforces loose checking so it sounds good to use it.
This flake8 plugin is already used in tempest.

Note that flake8-import-order version is pinned to avoid unexpected
breakage of pep8 job.

Setup for unit tests of hacking rules is tweaked to disable
flake8-import-order checks. This extension assumes an actual file exists
and causes hacking rule unit tests.

Change-Id: Ib51bd97dc4394ef2b46d4dbb7fb36a9aa9f8fe3d
2017-07-05 03:15:27 +00:00
Jenkins
f0aaffc2f3 Merge "Add fullstack-python35 testenv in tox.ini" 2017-06-29 21:20:34 +00:00
Sławek Kapłoński
970488a8b0 Add fullstack-python35 testenv in tox.ini
Change-Id: Iebb36f050ae6831ff03d74079d98b2fa2f67b6ec
2017-06-29 07:38:14 +00:00
lingyongxu
c68e2a19aa Enable some off-by-default checks
Some of the available checks are disabled by default, like:
[H106] Don’t put vim configuration in source files
[H203] Use assertIs(Not)None to check for None

Change-Id: Ie38ec248651b57f2f2886cf90366cbf13673ffaf
2017-06-23 09:51:01 +08:00
Maciej Józefczyk
db9ac80072 Update minimum tox version to 2.3.2
After latest changes on tox.ini we need to change minimum
version of tox to 2.3.2. Problem is described in tox changelog
as #issue279. Without this change tests are unable to run.

Change-Id: I458cf0d5e8927cf11a44b49ecfb5178a228aafaf
Closes-Bug: #1695888
2017-06-05 14:17:23 +00:00
Hunt Xu
927646e03a Configure root_helper and root_helper_daemon in fullstack tests
Fullstack tests are similar to non-test environments, so rootwrap and
rootwrap-daemon should be used instead of plain sudo.

L3 agents and DHCP agents used in fullstack tests should be guaranteed
to be eventlet monkey patched to avoid race conditions when two threads
are trying to issue commands via rootwrap daemon at the same time.

Closes-Bug: #1557168

Change-Id: Ida5a45420a8f58c1f5a36eb3fc546a7ea053a661
Signed-off-by: Hunt Xu <mhuntxu@gmail.com>
2017-06-04 06:31:13 +00:00
Ihar Hrachyshka
20ec08f43f Renamed tox targets for functional with python3
The rename is needed to match what
gate-neutron-dsvm-functional-python35-ubuntu-xenial-nv currently calls.

Change-Id: Ibda203a20a17d7e16217b19e5b83b38741ffb834
2017-05-24 13:13:39 -07:00
Jenkins
0479f0f9d2 Merge "fullstack: Don't let dhcp agents failover" 2017-04-21 17:56:46 +00:00
Jakub Libosvar
bc979efdb8 fullstack: Don't let dhcp agents failover
It turned out dhcp tests work only because agents are considered dead
after 10 seconds while they report to server every 60 seconds. This led
to calling network resync after agent revival and hiding the fact dhcp
agent is not capable of receiving any amqp messages.

This patch sets the report interval of agents to the half of
agent_down_time on server side and uses eventlet dhcp agent in order to
trigger eventlet monkey patching code.

Eventlet was behind the failure with messages not getting processed. As
[1] notes: "Note: If the “eventlet” executor is used, the threading and
time library need to be monkeypatched."

Because each port calls dhclient to obtain IP address and each dhclient
instance overwrites /etc/resolv.conf there was added a script that
generates fullstack-dhclient-script from an existing dhclient-script
before starting fulltstack tests. This generated script is passed to
each dhclient process running in fake fullstack machine using -sf
parameter.

[1] https://docs.openstack.org/developer/oslo.messaging/server.html

Related-bug: 1453350

Change-Id: I0336176b9c364fe3a95be5cef9e7a3af1ef9d7e9
2017-04-20 14:04:50 +00:00