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
This commit is contained in:
parent
067b816732
commit
2f31947393
@ -17,5 +17,5 @@ os_vif_pctxt = priv_context.PrivContext(
|
|||||||
'os_vif',
|
'os_vif',
|
||||||
cfg_section='os_vif_privileged',
|
cfg_section='os_vif_privileged',
|
||||||
pypath=__name__ + '.os_vif_pctxt',
|
pypath=__name__ + '.os_vif_pctxt',
|
||||||
capabilities=[c.CAP_NET_ADMIN],
|
capabilities=[c.CAP_NET_ADMIN, c.CAP_DAC_OVERRIDE],
|
||||||
)
|
)
|
||||||
|
5
tox.ini
5
tox.ini
@ -1,11 +1,8 @@
|
|||||||
[tox]
|
[tox]
|
||||||
minversion = 3.18.0
|
minversion = 3.18.0
|
||||||
envlist = py3,pep8,docs,releasenotes,cover
|
envlist = py3,pep8,docs,releasenotes,cover
|
||||||
skipsdist = True
|
|
||||||
ignore_basepython_conflict = True
|
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
basepython = python3
|
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
setenv =
|
setenv =
|
||||||
deps =
|
deps =
|
||||||
@ -88,5 +85,7 @@ import_exceptions = os_vif.i18n
|
|||||||
# system dependencies are missing, since it's used to tell you what system
|
# system dependencies are missing, since it's used to tell you what system
|
||||||
# dependencies are missing! This also means that bindep must be installed
|
# dependencies are missing! This also means that bindep must be installed
|
||||||
# separately, outside of the requirements files.
|
# separately, outside of the requirements files.
|
||||||
|
skipsdist=True
|
||||||
|
usedevelop=False
|
||||||
deps = bindep
|
deps = bindep
|
||||||
commands = bindep test
|
commands = bindep test
|
||||||
|
@ -20,5 +20,16 @@ vif_plug = priv_context.PrivContext(
|
|||||||
"vif_plug_ovs",
|
"vif_plug_ovs",
|
||||||
cfg_section="vif_plug_ovs_privileged",
|
cfg_section="vif_plug_ovs_privileged",
|
||||||
pypath=__name__ + ".vif_plug",
|
pypath=__name__ + ".vif_plug",
|
||||||
capabilities=[c.CAP_NET_ADMIN],
|
capabilities=[
|
||||||
|
c.CAP_NET_ADMIN,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
vif_plug_test = priv_context.PrivContext(
|
||||||
|
"vif_plug_ovs",
|
||||||
|
cfg_section="vif_plug_ovs_privileged",
|
||||||
|
pypath=__name__ + ".vif_plug_test",
|
||||||
|
capabilities=[
|
||||||
|
c.CAP_NET_ADMIN, c.CAP_DAC_OVERRIDE,
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
@ -32,7 +32,7 @@ from vif_plug_ovs.tests.functional import base
|
|||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
|
|
||||||
|
|
||||||
@privsep.vif_plug.entrypoint
|
@privsep.vif_plug_test.entrypoint
|
||||||
def run_privileged(*full_args):
|
def run_privileged(*full_args):
|
||||||
return processutils.execute(*full_args)[0].rstrip()
|
return processutils.execute(*full_args)[0].rstrip()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user