adds bandit testing and Zuul CI job.

adds a job to project.yaml Zuul CI file to run the Bandit
test environment

Change-Id: I76bafa2a444e277e895e510bc53603da0295d88b
This commit is contained in:
annwesha.das 2024-02-14 00:33:15 +00:00 committed by Goutham Pacha Ravi
parent 8e777cb1b6
commit 1dceeb36bd
4 changed files with 14 additions and 2 deletions

View File

@ -129,8 +129,8 @@ class Manager(utils.HookableMixin):
# pair
username = cliutils.env('OS_USERNAME', 'MANILA_USERNAME')
url = cliutils.env('OS_URL', 'MANILA_URL')
uniqifier = hashlib.sha1(username.encode('utf-8') +
url.encode('utf-8')).hexdigest()
uniqifier = hashlib.sha256(username.encode('utf-8') +
url.encode('utf-8')).hexdigest()
cache_dir = os.path.expanduser(os.path.join(base_dir, uniqifier))

View File

@ -84,6 +84,10 @@ commands =
coverage xml -o cover/coverage.xml
coverage report
[testenv:bandit]
deps = bandit
commands = bandit -r manilaclient -x manilaclient/tests/* -n5 -ll
[flake8]
# F821: undefined name
# W503 line break before binary operator

View File

@ -8,6 +8,7 @@
check:
jobs:
- python-manilaclient-functional
- python-manilaclient-tox-bandit
- manila-rally-ss:
voting: false
- python-manilaclient-functional-fips:

View File

@ -92,3 +92,10 @@
vars:
configure_swap_size: 4096
nslookup_target: 'opendev.org'
- job:
name: python-manilaclient-tox-bandit
parent: openstack-tox
timeout: 2400
vars:
tox_envlist: bandit