Commit Graph

39 Commits

Author SHA1 Message Date
Ghanshyam Mann b540700061 Retire patrole
Patrole project is not active anymore and its gate is broken.
We waited for couple of cycle to see if there is any interest
in this project and anyone can maintain it. But we did not get any
new maintainers and current QA team does not have bandwidth/interest
to continue maintaining it.

This project was for RBAc testing which is moving towards unit/functional
tests on service side as well as tempest plugins tests.

In QA 2023.2 PTG, we decided to retire this project

- https://etherpad.opendev.org/p/qa-bobcat-ptg

Change-Id: I7721cf06104e5871ec27cdd87d4608dace60a8b7
2023-04-10 22:29:00 -05:00
zhangboye e3a7ce27a2 Use py3 as the default runtime for tox
Moving on py3 as the default runtime for tox to avoid to update
this at each new cycle.

Change-Id: Ie18dd47beef0d15e168c3284c4cf0d3564467eff
2021-04-20 16:54:05 +08:00
tushargite96 9ec7c46562 Changed minversion in tox to 3.18.0
The patch bumps min version of tox to 3.18.0 python in order to
replace tox's whitelist_externals by allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: Iad89625e7514d1046e0340db96a73960a17023cf
2021-02-25 22:29:38 +05:30
maaoyu a1e1ddc91c Remove install unnecessary packages
The docs requirements migrated to doc/requirements.txt
we need not install things from requirements.txt.

Change-Id: I6a50c553779a2d185da1a82898541adb35130f69
2020-09-23 17:18:33 +08:00
Doug Schveninger ff2fba20db Clean up tox.ini and document zuul.yaml settings
I tried to remove --sitepacakges and the gate failed
so I added comment and in the .zuul.yaml so future people
will understand why.

I Updated the tox.ini environment description so if someone
does a tox -av it will list all command supportted and a
small description of what

While dcoumenting the zuul.yaml I noticed that I made
patrole-reader a job and I feel that we should also
have it as a gate.

I also saw that extension and multi-node non-voting jobs
where missing reader versions so I added them.

Change-Id: I7b8e4c06ece6b32cab4d7238d0bc250334a3adb3
2020-09-08 23:44:07 -05:00
Vishakha Agarwal 15d8f26965 Switch testing to Victoria testing runtime
Upating the testing template from ussuri to victoria
testing runtime
- https://governance.openstack.org/tc/reference/runtimes/victoria.html

Change-Id: Ifd65c0359509a4b59f3e876c42cef7cbf6f9ef93
2020-05-05 13:23:05 +05:30
Andreas Jaeger d69a6367a1 Cleanup py27 support
This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove python 2.7 stanza from setup.py
- Remove obsolete sections from setup.cfg
- Update classifiers
- Use newer openstackdocstheme and Sphinx versions
- Cleanup */source/conf.py to remove now obsolete content.
- Remove install_command from tox.ini, the default is fine
- Remove hacking requirements from lower-constraints, they
  are not needed for install

Change-Id: I150a5ee2cd08abf5ce9cf9daf2835007dea0dffd
2020-04-21 10:16:21 +00:00
Andreas Jaeger 2aad808184 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Update hacking extension for newer flake8. Remove vi header check, this
is enabled as H106 already.

Fix problems found.

Change-Id: Ie4ccf0a1075995f5624a838388b6b0b46343129a
2020-04-02 15:56:12 +00:00
Zuul f75396ceac Merge "[ussuri][goal] Drop python 2.7 support and testing" 2020-03-03 17:04:52 +00:00
Ghanshyam Mann 51368ef31c [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

patrole is ready with python 3 and ok to drop the
python 2.7 support.

Complete discussion & schedule can be found in
- http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: Ied5cfb29363401d713c21fc579f30e1ef9c1210f
2020-02-28 01:22:58 +00:00
pengyuesheng 8c23e7a65a Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: Iab28fdeb5d9d7c877435e40ee04683d665e7e6cb
2019-09-29 10:18:46 +08:00
Masayuki Igawa 94e6b1875a
Add PDF building
This commit add PDF building tox.ini environment and options for LaTeX
output. The chapter header in README.rst has been changed because "Team
and repository tags" is not appropriate for the title of this document.
And, this commit also updates repository URLs to opendev.org.

Change-Id: I1337f3185d72108eef2968cca3cb81d52e742e90
Story: #2006070
Task: #35469
2019-09-24 15:32:25 +09:00
Ghanshyam Mann 35062ad415 Dropping the py35 testing
All the integration testing has been moved to
Bionic now[1] and py3.5 is not tested runtime for
Train or stable/stein[2].

As per below ML thread, we are good to drop the py35
testing now:
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/005097.html

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004647.html
[2]
https://governance.openstack.org/tc/reference/runtimes/stein.html
https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: I09222df09e6c6618a06a08479638be3953e19ed4
2019-04-29 00:09:55 +00:00
Manik Bindlish 4e79004730 Add py36 and py37 tox envs
With python3.6 and python3.7 jobs added to the Zuul jobs, it makes sense
to add this to the tox config too.

Change-Id: If43229826b4860e39eb3334609a77be13f0df5fe
2019-03-08 07:21:38 +00:00
Felipe Monteiro 47c43cb6ca docs: Use sphinx-apidoc library for autodoc generation
This package is used for automatic generation of autodoc
documentation which offers the following advantages:

* the Patrole framework for all modules is always built
  and kept up to date
* it is isolated in its own page layout
* it can still be linked to by other documentation pages
  easily

Change-Id: I101557efe47293f88ee65b99275fdc8424c02e35
2018-11-14 09:02:11 -06:00
Manik Bindlish d771e34d24 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: I343da220ef68a56448042046bf644b964ef71f62
2018-11-02 05:04:09 +00:00
Gage Hugo 0f73e7ca9f Add bandit python security scanning to pep8
This change adds bandit python security code scanning to the
pep8 zuul check.

Change-Id: I8b6c52bd3fae87c5b49f3cde8bb9e63526155973
2018-08-21 15:51:08 -05:00
huang.zhiping 68f4c2f382 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: I6e73db41d64343dc76ef33bed4638c93b131bd88
2018-06-09 20:27:40 +08:00
Zuul dd79eb232f Merge "Update docs building" 2018-03-29 18:52:39 +00:00
Doug Hellmann 8669a51af5 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: I6aa7ffba825c9186198f691992199f51f8804823
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-22 17:42:03 -04:00
ghanshyam 932b81d9d1 Update docs building
We need to move to new docs buidling structure as
per the Project Testing Interface (PTI) [0] for doc
build in OpenStack-Infra. More details [1].

[0] https://governance.openstack.org/tc/reference/project-testing-interface.html#documentation
[1] http://lists.openstack.org/pipermail/openstack-dev/2017-November/124815.html

Change-Id: I699095c2eb2c818354fe0502cbbbadd3b9ef2656
2018-03-22 20:31:53 +00:00
melissaml 686e0d94a9 Replace curly quotes with straight quotes
Curly quotes usually input from Chinese input method.
When read from english context, it makes some confusion.

Change-Id: I46c0c3bfc49fb657eb5c6fbad24682f1d579a121
2018-02-05 16:13:34 +00:00
Felipe Monteiro 5fa20f7e63 Switch to use stestr for unit tests directly
This commit switches to use stestr command to run unit tests directly.
Recently, the latest ostestr command uses stestr instead of testr.
However, we should use stestr directly because it's simple and
straight forward. There is no reason to use ostestr for unit tests
anymore.

Modeled after Iff4abef50178bdc83b868eed4a906e22d790762b

Change-Id: Ie50cd57e87bc049c29b86fce67cc1a2061dad690
2017-12-01 17:35:44 +00:00
Zuul 68d6c4ffb1 Merge "Auto-generate sample config file" 2017-10-30 18:03:36 +00:00
Felipe Monteiro 098a8cd057 Auto-generate sample config file
This PS auto-generates the sample config file using
oslo-config-generator which is how every project should reliably
produce a config file.

In addition, the Patrole documentation was updated to link to the
generated config file, so that the documentation accurately
shows config options.

Change-Id: Ib3c39084b4c2b5a0078d1293d882cf9a9050b29b
Closes-Bug: #1709490
2017-10-04 01:17:13 +00:00
Felipe Monteiro b18a3f6524 [flake8] Enable extra, optional hacking checks
Update test-requirements.txt to use latest version of:
    * hacking

Enable the following off-by-default checks:
    * [H203] Use assertIs(Not)None to check for None.
    * [H204] Use assert(Not)Equal to check for equality.
    * [H205] Use assert(Greater|Less)(Equal) for comparison.
    * [H210] Require ‘autospec’, ‘spec’, or ‘spec_set’ in
             mock.patch/mock.patch.object calls
    * [H904] Delay string interpolations at logging calls.

Made necessary unit test changes to work with these checks.

Change-Id: I9db3445caa2883563fd7271d6bf0b24800e06c01
2017-09-27 03:31:32 +01:00
Felipe Monteiro f6eb862105 Deprecate [rbac] configuration group.
The [rbac] configuration group has been deprecated
and will be removed in the next release. It has been
renamed to the [patrole] group which contains
the exact same options.

This commit makes necessary deprecation changes,
along with renaming changes to documentation, unit
tests and framework.

Change-Id: I71198506b97b98ac18a969b7e6b13b664579c081
2017-08-15 21:45:27 -04:00
Felipe Monteiro 7de1905c96 Update tox to correctly use OS_TEST_PATH
Currently, to run unit tests, Patrole relies on a whitelist file
to separate unit tests from API tests so that tox -e py27/35 works.
However, this approach is hackish and has been abandoned in
favor of the following standard approach:

  - Use OS_TEST_PATH to .testr.conf
  - Override OS_TEST_PATH for unit test jobs in tox.ini
  - Remove the whitelist file as it's no longer needed

Change-Id: Iedbd01b539d24dc57e3c8bc1bb0dbb3ea9127ef4
2017-08-06 05:47:27 +01:00
Felipe Monteiro 4bf66a2285 Hacking: enable extensions H106, H203 and H904
[H106] Don't put vim configuration in source files.
[H203] Use assertIs(Not)None to check for None.
[H904] Delay string interpolations at logging calls.

This change makes Patrole's hacking consistent with
Tempest's [0][1].

[0] https://review.openstack.org/#/c/408211/
[1] https://review.openstack.org/#/c/408066/

Change-Id: Ia56f66b4ab7e1eea6a8bfea05bf52865be13430c
2017-05-17 15:36:16 +00:00
Felipe Monteiro 0854dedaec Adds initial hacking checks to Patrole
This patch:
  - Adds hacking check to Patrole (executed via tox -e pep8)
  - Corrects a few hacking errors
  - Adds hacking documentation to Patrole

Change-Id: Id43e24060a5290df91c594df6a38ba0cb239bbaf
2017-05-09 17:58:38 +00:00
Joseph Abad ae7d7bb2ca Fix: the tox cover job was not updating coverage report.
This patch updates the cover command to remove older coverage
reports before running.

Change-Id: I31f8d11c2c1fd9f8b36ee8090f321020e48c60d3
2017-04-20 17:09:46 -04:00
Jeremy Liu 78b192553a Fix check-uuid not working
'check-uuid' and 'check-uuid --fix' are not working because we do not
set package name for them. This patch fixes that.

Change-Id: I553c364e3fc0d640620a01046dd7f70bdb704be2
Closes-Bug: #1678407
2017-04-02 06:50:04 +00:00
Jenkins cccc225c71 Merge "Fix oslo_debug_helper not running" 2017-03-23 18:39:43 +00:00
HaiJieZhang ae9db6fd2b Fix oslo_debug_helper not running
Specify test directory so that tox won't complain
`ImportError: Start directory is not importable`.

Change-Id: I03108f71254e8cc99fb0fcab7d4f1f8614b4e60e
Closes-Bug: #1666560
2017-03-23 11:29:16 +08:00
Jeremy Liu e1014befad Standardize tox
Change-Id: If59a61ac449c8b65abeb5900d5c5e0005fbc0186
2017-03-22 18:38:31 -07:00
Felipe Monteiro 1ee5f4d912 Fix test coverage tox command for patrole.
Currently, tox -ecover doesn't work. This patch simply uses
nosetests and nosecover to generate a correct coverage report for
unit tests.

Change-Id: Ib7093796ead2bbef5c588c304336582f06ddd1c3
2017-03-04 23:27:31 +00:00
Felipe Monteiro df958705cd Changes tox to only run unit tests and moves unit tests to tests/unit.
Currently, the api and scenario tests are skipped when tox is run,
i.e. when tox -e py27 and tox -e py35 are executed. This is not ideal,
because an error could be thrown when trying to import modules into
the api and scenario tests. Instead, these tests should never
be discovered by ostestr. This will resolve issues with the new
framework changes [0].

This change simply creates a new file called test-whitelist.txt
which is used by the parameter --whitelist-file in the
command under [testenv] in tox.ini. It ensures that only
the regexes specified in test-whitelist.txt are executed [1] --
so only the unit tests are executed with tox (as currently
no functional tests are in Patrole).

Also added check-uuid to pep8 in tox.ini.

[0] https://review.openstack.org/#/c/433741/
[1] https://docs.openstack.org/developer/os-testr/ostestr.html

Change-Id: I1c6bca9044a74e8909754f106880636739e5a822
2017-02-28 16:03:08 -05:00
DavidPurcell 029d8c3126 Initial functionality framework.
Includes:
rbac_util - Utility for switching between roles for tests.
rbac_auth - Determines if a given role is valid for a given api call.
rbac_rule_validation - Determines if a allowed proper access and denied improper access (403 error)
rbac_role_converter - Converts policy.json files into a list of api's and the roles that can access them.

One example rbac_base in tests/api/rbac_base
One example test in tests/api/images/test_images_rbac.py

New config settings for rbac_flag, rbac_test_role, and rbac_roles

Implements bp: initial-framework
Co-Authored-By: Sangeet Gupta <sg774j@att.com>
Co-Authored-By: Rick Bartra <rb560u@att.com>
Co-Authored-By: Felipe Monteiro <felipe.monteiro@att.com>
Co-Authored-By: Anthony Bellino <ab2434@att.com>
Co-Authored-By: Avishek Dutta <ad620p@att.com>

Change-Id: Ic97b2558ba33ab47ac8174ae37629d36ceb1c9de
2017-01-13 11:37:30 -05:00
DavidPurcell 663aedfe46 Initial Cookiecutter commit
Change-Id: Iceff2531f4f7de21dcbb91ee893a8205b6c85107
2017-01-04 15:11:34 -05:00