Adds Bandit testing environment to tox.ini
Enable the bandit test env in manila-ui Execute tox -e bandit to run it and also include zuul continous integration Getting rid of mark_safe()from the utils.py. This fix the issues in the utils.py Change-Id: Id75cbd8ce7e33ab4d920bdf389ac66f8d93f19dc
This commit is contained in:
parent
5c150c8cf4
commit
119c906ba6
16
.zuul.yaml
16
.zuul.yaml
@ -12,6 +12,7 @@
|
|||||||
voting: false
|
voting: false
|
||||||
- manila-ui-integration-tests:
|
- manila-ui-integration-tests:
|
||||||
voting: false
|
voting: false
|
||||||
|
- manila-ui-tox-bandit
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
- manila-ui-integration-tests:
|
- manila-ui-integration-tests:
|
||||||
@ -87,3 +88,18 @@
|
|||||||
devstack_services:
|
devstack_services:
|
||||||
horizon: true
|
horizon: true
|
||||||
tox_envlist: integration
|
tox_envlist: integration
|
||||||
|
|
||||||
|
|
||||||
|
- job:
|
||||||
|
# Security testing for known issues
|
||||||
|
name: manila-ui-tox-bandit
|
||||||
|
parent: openstack-tox
|
||||||
|
timeout: 2400
|
||||||
|
vars:
|
||||||
|
tox_envlist: bandit
|
||||||
|
irrelevant-files:
|
||||||
|
- ^.*\.rst$
|
||||||
|
- ^doc/.*$
|
||||||
|
- ^manila-ui/tests/.*$
|
||||||
|
- ^releasenotes/.*$
|
||||||
|
- ^tox.ini$
|
||||||
|
@ -96,7 +96,7 @@ def metadata_to_str(metadata, meta_visible_limit=4, text_length_limit=25):
|
|||||||
meta_str = "<br/>".join(meta)
|
meta_str = "<br/>".join(meta)
|
||||||
if len(metadata.keys()) > meta_visible_limit and meta_str[-3:] != "...":
|
if len(metadata.keys()) > meta_visible_limit and meta_str[-3:] != "...":
|
||||||
meta_str += '...'
|
meta_str += '...'
|
||||||
return mark_safe(meta_str)
|
return mark_safe(meta_str) # nosec B308
|
||||||
|
|
||||||
|
|
||||||
def get_nice_security_service_type(security_service):
|
def get_nice_security_service_type(security_service):
|
||||||
|
4
tox.ini
4
tox.ini
@ -31,6 +31,10 @@ commands =
|
|||||||
pip install {env:HORIZON_REPO:git+https://opendev.org/openstack/horizon}
|
pip install {env:HORIZON_REPO:git+https://opendev.org/openstack/horizon}
|
||||||
{[testenv]commands}
|
{[testenv]commands}
|
||||||
|
|
||||||
|
[testenv:bandit]
|
||||||
|
deps = bandit
|
||||||
|
commands = bandit -r manila_ui -x manila_ui/tests/* -n5 -ll
|
||||||
|
|
||||||
[testenv:integration]
|
[testenv:integration]
|
||||||
# Run integration tests only
|
# Run integration tests only
|
||||||
passenv = AVCONV_INSTALLED
|
passenv = AVCONV_INSTALLED
|
||||||
|
Loading…
Reference in New Issue
Block a user