Commit Graph

39 Commits

Author SHA1 Message Date
Takashi Kajinami e91dadeaf0 tox: Drop envdir
tox now always recreates an env although the env is shared using envdir
options.
~~~
$ tox -e genpolicy
genpolicy: recreate env because env type changed from
{'name': 'genconfig', 'type': 'VirtualEnvRunner'} to
{'name': 'genpolicy', 'type': 'VirtualEnvRunner'}
~~~

According to the maintainer of tox, this functionality is not intended
to be supported.
https://github.com/tox-dev/tox/issues/425#issuecomment-1011944293

Change-Id: Ib73364b71234d25d50920495f91e1a3e18c96bcd
2024-02-02 23:56:56 +09:00
Balazs Gibizer 2f31947393 Make tox.ini tox 4.0.0 compatible
* removed skipdist=True to make sure os-vif is available in the virtual
  env
* removed basepython = python3 as we assume all developer switched to
  python3 in their env already
* removed ignore_basepython_conflict = True as without the basepython
  definition generative targets now work without conflict

Also squashed in the commit fixing the functional target as both fix is
needed to unblock the gate:

add CAP_DAC_OVERRIDE to test privsep contexts

This change modifes the privsep contexts used by the test
code to create inteface without using the os-vif plugins.

The os-vif functional tests actully create ovs and linux
brdiges and dummy netdevs. to ensure the drier work correctly
the functional tests have a simpler test only version of the
port/brige management commands that are used to prepare
and validate the test env. The simpler implementation uses
standard linux commandline tools like "ip" or "ovs-vsctl"
which on ubuntu 22.04 require the addtion of CAP_DAC_OVERRIDE
to work around socket/file ownership issues.

To avoid  adding capablities at runtime that are not required
this change modifes the existing test only context in
the os_vif.tests.functional.privsep module and add a new test
context for the vif_plug_ovs plugin

Change-Id: Ide357cb64a8d128ff8ad978abae6a039e814d8a9
2023-01-09 12:30:15 +01:00
Sean Mooney b0298b5350 adapt to stestr 4.0 release
This change removes usage of --black-regex which is no longer supported
as of stestr 4.0.0. The min version of stestr is increased to 3.1.0
which adds --exclude-regex as a replacement.

Change-Id: I24424aeeb178fd9ab1b736cb689a73f7bd8bd572
2022-10-12 12:09:27 +01:00
Ghanshyam Mann 1651a730c1 Drop lower-constraints.txt and its testing
As discussed in TC PTG[1] and TC resolution[2], we are
dropping the lower-constraints.txt file and its testing.
We will keep lower bounds in the requirements.txt file but
with a note that these are not tested lower bounds and we
try our best to keep them updated.

[1] https://etherpad.opendev.org/p/tc-zed-ptg#L326
[2] https://governance.openstack.org/tc/resolutions/20220414-drop-lower-constraints.html#proposal

Change-Id: I38a41071ac540e3b58f9d18ead88b86203a4c843
2022-06-16 13:46:59 +09:00
Takashi Natsume 95fbe6abc8 Change minversion of tox to 3.18.0
The patch bumps min version of tox to 3.18.0 in order to
replace whitelist_externals with allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: I38c2a7277f33203f3a8b51f01d75ce15730a969f
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2022-03-04 17:04:06 +00:00
Stephen Finucane 44d8937148 Resolve dependency issues
This is totally broken with the pip 20.3 resolver. Attempts to fix the
lower-constraints file manually didn't work out, so start specifying
only the direct dependencies here, relying on upper-constraints for the
given release to restrict everything else.

Two dependencies, python-subunit and testrepository, are removed as
these are no longer necessary. Another, hacking, is moved to 'tox.ini'
since we're not managing this via the u-c system and don't need this
here.

Change-Id: I4bdc0d422813ecee1566256ec237d34f200406ee
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-02-10 15:47:11 +00:00
Stephen Finucane 4e6c16037c tox: Rename 'UPPER_CONSTRAINTS_FILE' -> 'TOX_CONSTRAINTS_FILE'
This is the new name recommended by the base zuul jobs [1]:

  Path to a pip constraints file. Will be provided to tox via
  ``TOX_CONSTRAINTS_FILE`` (deprecated but currently still supported
  name is ``UPPER_CONSTRAINTS_FILE``) environment variable if it exists.

While we're here, we remove a wholly unnecessary layer of environment
variable-based indirection.

[1] https://opendev.org/zuul/zuul-jobs/raw/branch/master/roles/tox/README.rst

Change-Id: Ic82672f5376988ef6c40d2aaebf1a9e59d3538ad
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-10-05 18:14:27 +01:00
Sean Mooney 68c4edba14 update tox envs and support pdf docs
- adds support for building PDF docs.
- adds a bindep.txt file with required deps for pdf docs
- groups the tox envs into logicaly related sections.
- This change updates the default set of jobs so that
  runing tox with out any arguments should run the
  default set of jobs that should pass before pushing
  changes for review.

Change-Id: Id5df8afe576881cba58b3288acd79501ef1de511
2020-08-18 14:13:03 +00:00
Ghanshyam Mann 041ce67619 [goal] migrate testing to ubuntu focal
As per victoria cycle testing runtime and community goal[1]
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).

Fixing:
- bug#1886298
Bump the lower constraints for required deps which added python3.8 support
in their later version.

Also adding bindep file for libffi packages.

Story: #2007865
Task: #40200

Change-Id: I8d9b8d9e19ca7b94f1ce1f2b95aeafc9f7127ea3
2020-08-06 16:58:28 +00:00
Stephen Finucane ba9d4ca956 trivial: Remove some rules from flake8 ignore list
Most of these were either unnecessary or trivial to resolve.

Change-Id: I2952e4906a511f6ffc6c53dc1c582464000e22de
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-03-31 11:05:27 +01:00
Andreas Jaeger d57a5f39ed Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found by updated hacking version.

Change-Id: I8d4a0fc1b7c4e0c1e474a707aa900d09181ba11f
2020-03-31 06:44:56 +00:00
Eric Fried 7bad0f93bb Drop python2 support and testing
Change-Id: I1ce77e223674013754408b2db42b1fb6e80bb32b
2020-01-03 12:07:39 +00:00
pengyuesheng 12f1590e37 Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: I5f05aa66d3c2ce5b6e09efa3836aee3faefce38a
2019-09-23 16:27:56 +08:00
Sean Mooney e0712563c1 set ignore_basepython_conflict = True in tox.ini
os-vif sets the base python version globally in the
base testenv and relies on tox to pick up the
correct python version form the env name for standard
envs like py27.

This behavior only work reliably if
ignore_basepython_conflict = True is set.

Change-Id: I458cf6cf88d9ee672d6cce59e1d86ed888957042
Closes-Bug: #1832652
2019-06-13 00:42:16 +01:00
caoyuan 9fb828291c Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I2125f9e2912aa7ac5346292d23643fdea003d7c0
Closes-Bug: #1826826
2019-04-29 13:24:37 +08:00
Sean Mooney 5ab2ee6ed0 make functional tests run on python 3
- This change updates sanitize_log_path to
  use replace instead of string.translate so that
  it works across both python 2.7 and python 3.
- This change modifies the functional tests to run under
  python 3 by default. A new functional-py27 env is
  also added.

Change-Id: Id8127ae68cb5aeebdba73bd14fc0481cd9b773d9
2019-02-25 14:37:16 +00:00
Charles Short 387307a26c Change python3.5 job to python3.7 job on Stein+
python3.5 was the only supported python3 version on Xenial, now that we have
Bionic Beaver nodes that support python3.7, lets switch to testing with
python3.7 in addition with python3.6 in Stein and beyond.
See ML discussion here [1] for context.

[1] http://lists.openstack.org/pipermail/openstack-dev/2018-October/135632.html

Change-Id: If1c57e2e13b6a5af5a0e05f1299e013a8c5386b8
Signed-off-by: Charles Short <chucks@redhat.com>
Story: #2004073
Task: #27433
2019-02-19 16:07:46 +00:00
Vieri 8df626b671 Update min tox version to 2.0
The commands used by constraints need at least tox 2.0.  Update to
reflect reality, which should help with local running of constraints
targets.

Change-Id: Ie0972eb2f0aa9aceb93b9dc4fbe0919a67556697
Closes-Bug:  #1801485
2018-11-03 07:29:30 +00:00
Rodolfo Alonso Hernandez 3eded6ba37 Fix upper-constraints link in tox file
In some environments, if the upper-constraints file is not joined to the
"-c" option in tox, an error is raised when executing tox.

Change-Id: I715fe6dd91d3b860212b2368fdb2b9f610926908
Closes-Bug: #1793562
2018-09-20 17:37:17 +01:00
Doug Hellmann a42648b8de switch documentation job to new PTI
This is a mechanically generated patch to switch the documentation
jobs to use the new PTI versions of the jobs 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

Fix tox.ini docs environment to build html and push to correct output
paths so that openstack-tox-docs jobs works.

Change-Id: Ib957e03d6b16d5fdb945e2be02ed75f0c7fa160b
Story: #2002586
Task: #24315
2018-09-11 08:38:38 +02:00
Sean Mooney 96b5a11d35 add upper_constraints support
- This change enforces the use of upper_constraints
  in tox envs.

Change-Id: I2badb5a3cd5f1ab2a66d3ebd97432b77985ada1b
2018-07-19 08:22:45 +00:00
Sean Mooney 9679783616 convert os-vif docs to follow PTI
- This change converts os-vif to use
  sphinx-build and doc/requirements.txt to
  be inline with new PTI requirements.
- This change tests docs requirements as part
  of the lower-constraints env.

Change-Id: Ic136941a17f90d6a6a8432fec96f8612c4bca8a2
2018-07-18 08:24:37 +00:00
Zuul 09109d8b40 Merge "Remove [tox:jenkins] section from tox.ini" 2018-07-11 00:30:28 +00:00
Vu Cong Tuan 96da3fefb5 Remove [tox:jenkins] section from tox.ini
[tox:jenkins] section should be removed from tox.ini
because no one is using it [1]

[1] https://review.openstack.org/#/c/577686/3/tox.ini@17

Change-Id: Id6e0e41475d2a2874a1c21dd8fc974cc789abce6
2018-07-09 09:03:12 +07:00
Vu Cong Tuan a0f8c26b86 Remove unnecessary pyNN testenv sections
According to [1], the pyNN factors automatically set basepython
unless explicitly requested otherwise.
This patch moves 'commands' attribute up into the 'testenv' section,
"testenv:pyNN" sections are unnecessary and also should be removed.

[1] https://github.com/tox-dev/tox/issues/477

Change-Id: I535188debcf89c91c887d0026bbf2157333ae2a4
2018-07-09 08:58:05 +07:00
Doug Hellmann d08b147ea4 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: I7150a260a3b423b138a710edf71efaa8762cd849
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 15:27:01 -04:00
Sean Mooney 1edfcd9782 fix tox py27 job
- The current py27 tox env only runs the
  unit tests for core os-vif lib.
- This change removes --test-path="os_vif/tests"
  to renable the unit tests for all  in tree plugins.

Change-Id: Ife09b596d7bb009e623c8b9edbd424b8fc6f2556
2018-05-11 16:51:53 +00:00
Doug Hellmann b37f2ed539 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: I4e0053c833d821bb7086c8feb9e44eb927c23fab
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-17 17:21:09 -04:00
Rodolfo Alonso Hernandez dff9093ab6 Migrate from 'ip' commands to 'pyroute2'
This patch migrates the use of command line 'ip' commands
to pyroute2 library. A new class, 'IpCommand', is created
to wrap the use of the library, implementing the functionalities
needed in this project.

The new wrapper class is defined in 'os_vif' and is used in
'vif_plug_linux_bridge' and 'vif_plug_ovs'.

This patch also adds functional tests in 'os_vif'. The aim
of these functional tests is to check 'pyroute2' implementation
works correctly, by creating, modifying and deleting network
interfaces. 'ip' commands are used to execute additional actions,
not relying on the tested library to check its own results.

Co-Authored-By: Stephen Finucane <stephenfin@redhat.com>

Closes-Bug: #1677238
Change-Id: I18f7b3424a6c447ee89df1f0326ece75f2333bf2
2018-01-08 10:17:42 +00:00
Stephen Finucane a464a638a6 doc: Remove cruft from releasenotes conf.py
Looks like this was copied from Glance's config, and retains a lot of
unnecessary config for same. Remove it all.

Change-Id: I559c9615f0243290d1eb7c410afc0d7d3b705e28
2017-07-20 11:40:17 +01:00
loooosy 47da0aacae 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: Ib252f1efafddcf7d90ad67b85877285df06f044d
2017-07-11 10:53:10 +08:00
kavithahr efbd1b5974 The Python 3.5 is added
The Python 3.5 was missing in setup.cfg and tox.ini
hence added that version.

Change-Id: Ic1c24dc8604c5223efd82cab4f43c8b77ec3ca64
2017-03-08 11:29:35 +05:30
gecong1973 79bb9e9a7d Delete H803 from ignore list
The H803 rule have been removed from hacking since v0.10.0.
we can remove H803 from the ignore list.

Change-Id: Ib3de9f9e30eef33338f3c784d4b9ac81faeb45a5
2017-02-03 07:38:08 +00:00
Janonymous d1eaf2f914 Removing Deprecated hacking Check
H402 hacking check have been removed since hacking 0.10
https://github.com/openstack-dev/hacking/blob/master/setup.cfg.

Change-Id: I10fa23d92b1f1bd35d5f334c03633a8f0d70ee4c
2017-01-27 03:36:11 +03:00
ChangBo Guo(gcb) 57157de6c4 Trivial: clean up oslo-incubator related stuff
Oslo-incubator has retired, so don't keep oslo-incubator
related stuff in os-vif.

Change-Id: I4ea6b4342b2d5bf46abe6dc83185feb2d33c1be1
2016-08-03 13:56:05 +08:00
Daniel P. Berrange e5227ecbc0 Start using reno for release notes
Depends-on: I7174325294ba3cc978cbb1cff738b4b979adf9fb
Change-Id: Idc50dd5d408c67367256fb10efef5e772ffa83b1
2016-05-03 13:53:29 +01:00
Daniel P. Berrange faf3a0a029 tox: ignore E126, E127, E128 indentation checks
The flake8 E126, E127, E128 checks are all checking various
aspects of indentation, but they are mutually inconsistent
with each other - ie fixing one causes a violation in the
other. They are all counter to normal Nova coding style and
ignored in Nova, so kill them in os-vif too.

Change-Id: Ib28652de17329141d437a3354e60f3b0f5f53968
2016-01-28 16:12:21 +00:00
Sean Mooney 2deb99e644 reorder tox envlist to run python 3.4 before 2.7
- To resove a known issue with .testrepository where
  the db type cannont be determined if the 2.7 enviorment
  is run first. This change reorders the envlist to prevent
  this error.

Change-Id: I44bd372db7e944210e93d258fd4712e346b06619
Closes-Bug: #1534277
2016-01-14 19:45:08 +00:00
Jay Pipes 8023f33453 Import of code from https://github.com/jaypipes/os_vif
Initial commit using code imported from

  https://github.com/jaypipes/os_vif

This patch also includes the following fixes to make the import pass all
jenkins jobs:
 - add doc/source/conf.py and index.rst
 - sync with global requirements

Change-Id: Iac6a9d45ea799eaa71f895af115e966c28246a22
2016-01-13 12:56:01 -05:00