105 Commits

Author SHA1 Message Date
Jenkins
23d064f134 Merge "Add 'rm -f .testrepository/times.dbm' command in testenv" 2017-05-02 09:20:28 +00:00
rajat29
2e655d90c2 Add 'rm -f .testrepository/times.dbm' command in testenv
Running py2* post py3* tests results in error. Add
'rm -f .testrepository/times.dbm' command in testenv to
resolve this.
Closes-Bug: #1565928

Change-Id: I876d2169fa6e3e1239056e891ad49c530d3a0c69
2017-05-01 10:43:55 +00:00
Jenkins
7f9839707a Merge "Fixes for Running Functional Tests with Python 3.5" 2017-04-28 21:40:32 +00:00
Dave McCowan
2909fda016 Fixes for Running Functional Tests with Python 3.5
Fixing the standard things when making code py27/p35 compatible.

Also, removing the logging of the passed value of an HTTP
header.  If the value could not be encoded to log, then there
are Tracebacks that showed up with Python 3.5.  Since the value
can be passed by a user, it should either be scrubbed before logging
or not logged, to prevent possible content injection in the log
stream.

Change-Id: I8df1553acb6c7e5f75a1b50f024dc032ca982a93
2017-04-27 13:06:14 -04:00
Jenkins
0750dd884f Merge "Initial commit for Barbican api-ref" 2017-04-05 13:35:01 +00:00
Thomas Bechtold
06b76aa6e8 Use oslo-config-generator to generate barbican.conf.sample
Currently etc/barbican/barbican.conf is maintained by hand and can not
be regenerated based on the config settings defined in the code.
A common pattern for OpenStack projects is to use oslo-config-generator
for that task.

Co-Authored-By: Randall Burt <randall.burt@rackspace.com>
Depends-On: I90870dcb49cd96f6bf0fe353fa6e779ffd87a5af
Closes-Bug: #1584789
Change-Id: I5f3dcd2fc982f1178ef7dd662c24d3166f91b266
2017-04-05 08:02:35 +02:00
Jenkins
d1a9d91272 Merge "Fix coverage gate" 2017-02-28 17:00:17 +00:00
Jeremy Liu
6300e730d2 Initial commit for Barbican api-ref
Change-Id: Ie67aae021efc835d4a1fb5bbfffb8761ea41a3b4
Closes-Bug: #1667053
2017-02-28 22:56:27 +08:00
Dave McCowan
b7e5dc2835 Fix coverage gate
The "coverage combine --append" command was failing and it does
not seem to be required here.  The coverage gate works correctly
when this command is removed.

Change-Id: I62da8c5b2013aaa21a1b7819bc1ae73fe412fe32
2017-02-24 15:32:27 -05:00
Cao Xuan Hoang
e82957d1d5 Remove support for py34
The gating on python 3.4 is restricted to <= Mitaka. This is due to
the change from Ubuntu Trusty to Xenial, where only python3.5 is
available. There is no need to continue to keep these settings.

Change-Id: I4373f5ee1a7addfe981818ef059c73a57594d624
2017-02-08 16:48:10 +07:00
Jenkins
4089edc177 Merge "Adds true functional tests for db_manage script" 2017-02-01 13:07:17 +00:00
Jeremy Liu
7e7a52d5cd Add build dir to flake8 exclude list
The `build` directory is generated from command `python setup.py install`,
we need to add that to flake8 exclude list in case pep8 test fails.

Change-Id: I3906ac973a9c1f73d1917c0bd0bc3bd81199a31f
2016-12-23 18:01:04 +08:00
Jenkins
00ef966ca9 Merge "Add Apache 2.0 license header to the alembic_migrations/script.py.mako" 2016-12-08 12:36:43 +00:00
Jeremy Liu
dea8754c6d Introduce hacking check to Barbican
Add hacking check to ensure we use proper rules and follow
community guideline [1].

[1] http://docs.openstack.org/developer/hacking/

Change-Id: I61e366969385aa044aea9d9678fbc91d32325497
2016-12-03 19:28:29 +08:00
Jeremy Liu
b483bba7fb Add Apache 2.0 license header to the alembic_migrations/script.py.mako
This patch can generate the new alembic_migrations/versions files that
include Apache 2.0 license header. All alembic version files are python
syntax, should be checked by flake8.

Change-Id: I7f00312dcad78e6ef80b260ccc31d0a193071c11
2016-11-22 09:58:22 +08:00
Jenkins
76413b24a6 Merge "Add bindep environment to tox" 2016-11-18 04:42:19 +00:00
Jeremy Liu
98602af12e Add bindep environment to tox
This is helpful for listing any missing system requirements [1].
And also add skipsdist/usedevelop to tox to ensure that barbican
is installed into virtualenv using 'python setup.py develop' instead
of creating a sdist everytime, the latter may lead to performance issue.

[1] http://docs.openstack.org/infra/manual/drivers.html#package-requirements

Change-Id: I7570ac7ec4686e347d0e11294e94fc6404a71169
2016-11-12 19:43:40 +08:00
Jenkins
139dd64c56 Merge "delete python bytecode including pyo before every test run" 2016-10-30 13:35:45 +00:00
pawnesh.kumar
1878ccfc6f Fix warning when running tox -e docs
WARNING:test command found but not installed in testenv
  cmd: /bin/rm
  env: /openstack/barbican/.tox/docs
Maybe you forgot to specify a dependency? See also the
whitelist_externals envconfig setting.

Change-Id: Ic4e1ed0bbca4fc6e10473a0f4fd55aa82d9234da
Depends-On: I1e303a87493ecc4874ca43e96433d311aa7fe0e0
2016-10-29 02:51:10 +00:00
Jenkins
5702b3bcbd Merge "Don't include openstack/common in flake8 exclude list" 2016-10-20 16:40:09 +00:00
Jiong Liu
c7bf059032 Fix coverage test failure
Add --append to 'coverage combine' command

Change-Id: Ie7aae8288de4dc1b9f85520e98faff88d75cfac3
2016-10-19 05:16:53 +00:00
pawnesh.kumar
3f92aa58e9 Don't include openstack/common in flake8 exclude list
The directory openstack/common was used to keep codes from
oslo-incubator, we have retired oslo-incubator,so don't use
this directory any more.

Change-Id: I0750b2f3aa25b079ca9ab95d28353dfdce7a3428
2016-10-09 02:29:21 +05:30
Lucky samadhiya
49cd835714 delete python bytecode including pyo before every test run
Change-Id: Ic5eaee3c70bdd9011c9f71a1ff0eba6f32d4dee9
2016-09-16 13:46:55 +05:30
Tony Breeds
7a80895381 Support upper-constratints.txt in tox environments
Change-Id: I1af65c599f139304878c0de2d01808c7f95a1a41
2016-08-22 15:33:49 +10:00
Ade Lee
edb2c18be6 Add install guide
Install Guides are maintained within the project and are linked
to the official docs.

This commit adds the framework and some initial content.

Change-Id: Iff18f0e866d95ff4b8b490511c2acf3209690b69
2016-08-19 10:05:09 -04:00
Jenkins
46b1a11868 Merge "Add Python 3.5 classifier and venv" 2016-08-16 20:51:57 +00:00
Thomas Dinkjian
79726607c1 Adds true functional tests for db_manage script
As the db manage script will be run primarily in
production enviroments as a means to cleanup old
data. True functional tests are needed to verify
that it does not falsely delete valid information
and that it properly removes the needed informaion

This is the start of any functional tests that are
needed for our cmd support scripts.

Change-Id: Ib6c9309c4ee95d10e124869a31590cfe983e13ec
2016-08-05 16:28:52 -05:00
Eric Brown
bf19558e02 Add Python 3.5 classifier and venv
Now that there is a passing gate job, we can claim support for
Python 3.5 in the classifier. This patch also adds the convenience
py35 venv.

Review that added the gate jobs:
https://review.openstack.org/#/c/336272/

Change-Id: I97ef7eef2d6adaec6bd1cd978b7e357c8560eba0
2016-08-05 05:56:31 +00:00
liujiong
7af28c8d16 Fix jenkins failing on coverage report
Coverage combine deletes reports and thus jenkins failed
saying `no data to report`, this change fixes it.

Change-Id: Ideab0ed3b3aaa8deef46b09770237055ec7f9ec4
2016-08-01 16:08:03 +08:00
Victor Stinner
c5012af5f2 Port last test (test_secrets) to Python 3
* normalize_before_encryption(): on Python 3, unencrypted is already a Unicode
  string (no need to decode).
* test_secrets: don't pass bytes string but native string (py2: bytes,
  py3: Unicode) as payload
* test_secrets: Decode HTTP bytes from UTF-8 for comparison
* test_get_secret_is_decoded_for_binary(): expect a binary string,
  not a Unicode string
* test_secrets: replace map() with a reglar loop (for) to execute
  child.delete() on Python 3. On Python 3, map() is now lazy and only
  execute the expression when the map is consumed.
* Remove tests-py3-blacklist.txt and the testenv:py34 section from
  tox.ini since all unit tests now pass on Python 3.4

Partially implements: blueprint barbican-py3
Change-Id: Ief8531c3b7201f884d5d4ca7a47a381d0bb9cb2c
2016-06-21 12:07:58 +02:00
Jenkins
312a8753f9 Merge "Python 3: replace the whitelist with a blacklist" 2016-05-20 14:35:32 +00:00
Jenkins
b4cafdb3dd Merge "Added KMIP Secret Store to Devstack" 2016-05-19 22:09:38 +00:00
Victor Stinner
6cba20e1fe Python 3: replace the whitelist with a blacklist
tox.ini: run Python 3 tests using ostestr rather than testtools.run
to ensure that all tests can be at least imported on Python 3.
Replace also the whitelist of tests with a blacklist to see more
easily which tests must be ported.

Partially implements: blueprint barbican-py3

Change-Id: Ibf42d57de3a41d2e32d47c0931a91e64104ebe86
2016-05-19 17:19:41 -04:00
Nathan Reller
5ef6c3e2e4 Added KMIP Secret Store to Devstack
Added code to devstack libraries to allow KMIP secret store to be
enabled. This edits barbican.conf to enable the KMIP secret store.

The Barbican PyKMIP client can be configured to connect to an existing
KMIP device or use PyKMIP's server. If the client configuration is all
that is needed then enable the 'barbican-pykmip' service in the
devstack configuration and set the appropriate key, certificate, and
CA path variables. This will allow the Barbican KMIP secret store to
connect to an existing KMIP server.

If a KMIP server is requested then also enable the 'pykmip-server'
service in the devstack configuration. This will install, configure,
and start the KMIP server. This option requires the 'barbican-pykmip'
service be configured as well.

Added passenv command to tox to allow the KMIP_PLUGIN_ENABLED
environment variable to be passed to the underlying command. Without
this the environment variable will not be seen by the tox command.

Change-Id: Ib804fa97545f14ed866bfd73bb251e85923a2e4e
Depends-On: Ifda13a84607bb199b794dc24f5dbba0ee8108dbf
2016-05-06 12:02:35 -04:00
Fernando Diaz
6ed906c6bb Cleanup py34 tox tests
Runs top level directory of tox test for py34. Currently separate
directories for tests are run.

Change-Id: I982f8a4d45ce445377c7909ac9076183c6e99976
2016-04-29 16:21:18 +00:00
Cyril Roelandt
a88e95aa1a Python 3: fix barbican.tests.plugin.test_store_crypto
This was just a matter of fixing a few bytes vs str issues.

Partially implements: blueprint barbican-py3

Change-Id: Ia41d2579f24d3ea738dad0af35f11529b84b9528
2016-04-26 20:34:41 +02:00
Cyril Roelandt
ea8c4bbe97 Python3: fix barbican.tests.plugin.test_kmip
- do not use the 'cmp' function, which no longer exists in Python 3;
- pass bytes to base64.b64encode;

Partially implements: blueprint barbican-py3
Change-Id: I9e179d96c6c95567063f0ca3a1ca4417a9a03991
2016-04-26 19:42:35 +02:00
Cyril Roelandt
c0f68faa5e Python3: add tests that are already working
These two tests were forgotten in the list of working tests.

Partially implements: blueprint barbican-py3

Change-Id: I3fba9993beb45c3eed464367bcd03d1fb1a52395
2016-04-26 17:57:48 +02:00
Cyril Roelandt
64e3fe4cd0 Python3: fix barbican.tests.plugin.crypto.test_crypto
SimpleCryptoPlugin.encrypt complained because of a string vs bytes issue, that
could be easily fixed.

Partially implements: blueprint barbican-py3

Change-Id: Ief442a643229119cae0b0ae934655b75d1fa5dbb
2016-04-26 17:49:37 +02:00
Cyril Roelandt
0c02b9c99d Python 3: use a string rather than bytes for "kek"
This is perfectly OK, and prevents a failure.

This patch fixes:
- barbican.tests.api.controllers.test_acls
- barbican.tests.api.controllers.test_secretmeta
- barbican.tests.tasks.test_keystone_consumer

Partially implements: blueprint barbican-py3
Change-Id: I7bf1fa79e5c54f79b517e5bb42c825d194e88a4d
2016-04-26 17:17:42 +02:00
Cyril Roelandt
eaf542c163 Python3: fix barbican.tests.api.controllers.test_cas
In Python 3, Response.body must be set to bytes.

Partially implements: blueprint barbican-py3

Change-Id: I913d55bea89788b9ca4ad83fec8d96dc9ccd073c
2016-04-26 15:45:28 +02:00
Cyril Roelandt
47d87754ec Python3: HTTPServerError no longer has a "message" argument in its constructo
This fixes barbican.tests.api.test_resources_policy.
Partially implements: blueprint barbican-py3

Change-Id: I683cc37278b27f0eb4899279ae1a27312eb711d2
2016-04-26 15:30:17 +02:00
Cyril Roelandt
a9d9055222 Python3: base64.b64encode expects bytes.
This fixes barbican.tests.plugin.test_resource.
Partially implements: blueprint barbican-py3

Change-Id: I6aedd864c3e57bf55ee7c31a99ba806d8e203b33
2016-04-26 15:12:36 +02:00
Cyril Roelandt
71561316c7 Python3: exceptions no longer have a 'message' attribute.
This patch fixes theses tests:
- barbican.tests.api.test_init
- barbican.tests.plugin.interface.test_certificate_manager

Partially implements: blueprint barbican-py3

Change-Id: Ib0b057b1e503afadd1dae8edba45160cd0dea350
2016-04-26 14:49:10 +02:00
Andreas Jaeger
c52ee37ce2 Fix publishing of api-guide
The api-guide needs to generate html in api-guide/build/html so that the
infra scripts can publish it. Fix tox.ini for this.

Change-Id: Ie47fb9788fe918a5a8aad7e5e8743fe890cbf0d7
2016-03-21 21:23:47 +01:00
Priti Desai
953e45e88e Publishing API Guide to OpenStack site
Moving files from doc/source/api/userguide/*.rst
to api-guide/source/*.rst,
also add api-guide/source/conf.py for building api-guide,
add a new tox target named api-guide
Taking a reference from this patch which was used for the
similar migration of Nova api guide:
https://review.openstack.org/#/c/230186

Change-Id: I725e7939f9a88185de6ef32b311159b0924b7183
Partial-Bug: #1540665
Needed-By: I7b7c623e6299c803930e41d72510f1a67d909fa3
2016-03-16 12:44:50 -07:00
Eric Brown
15256e42ad Remove use of old bandit.yaml
The bandit.yaml in use by Barbican was very old. This patch removes
it and just uses the default provided by Bandit itself. Some issues
needed to be fixed or ignored as a result.

Change-Id: If35c5d8173b9d86617647028a30b0548bb03d3c0
2016-03-08 16:12:42 -08:00
Andreas Jaeger
25c04e3bf3 Make bandit voting as part of pep8
Run security linter bandit as part of pep8. Pep8 is the usual linter
target and thus let's use it there instead of starting another node for
this short-running job.

The job is running stable and thus this can be made voting.

A followup change will remove the non-voting bandit job.

Change-Id: I6f2cf3902a4e786a5d31a06bf66d19bc33a60b55
2016-02-26 19:21:35 +01:00
Daniel Gonzalez
5bf06f973f Replace None comparisons in SQLAlchemy code
SQLAlchemy requires '==' to compare to None, but using '== None'
comparisons triggers the pep8 error E711. Another way to do '=='
comparisons for SQLAlchemy is using its is_() method.

This patch replaces all '== None' comparisons with 'is_(None)', which
does not trigger the pep8 error. Because there are no more E711
vialotions left, this patch also removes E711 from the pep8 ignore list
in tox.ini.

Change-Id: I96bd835688176c87d3f8079421c3394c1d431d43
2016-01-17 17:53:53 +01:00
Kenji Yasui
2acc1f4911 Fix db error when running python34 Unit tests
If tests for py27 is executed before py34 tests, then
there is a chance that py34 related tests may fail.
The following patch fixes it.

Ref: https://review.openstack.org/#/q/status:merged++topic:bug/1489059,n,z

TrivialFix

Change-Id: I397fe9c6847f3e6d4640adbb2712f2197e72ae47
Closes-bug: #1489059
2015-12-07 04:00:22 +00:00