144 Commits

Author SHA1 Message Date
Brant Knudson
0545ccf667 Clean up bandit profiles
The profile that we run for the gate run is renamed to "gate"
from "keystone_conservative".
This will be the standard configuration for OpenStack projects.

Removed the keystone_verbose profile since this isn't used.

Change-Id: I828afc5402ab15c615bfd7955a578d055ce4aa8a
2015-09-21 09:45:02 -05:00
Jamie Lennox
766f051856 Group tox optional dependencies
Group the additional dependencies for tox. The way they are specified
now means that the working directory is copied into /tmp 3 times, one
for each . which can cause space issues.

Also removes specifically installing requirements.txt as this will be
handled for the dependencies of .

Change-Id: Ia2c86c70f059c6352586221e13857e5bd17ae37c
Closes-Bug: #1490354
2015-08-31 10:44:38 +10:00
Brant Knudson
fab1cb6beb Change mongodb extras to lowercase
There's a bug[1] in setuptools where extra names with mixed case
aren't handled correctly. Rather than wait for a fix in setuptools
just change the name to lowercase.

[1] https://bitbucket.org/pypa/setuptools/issues/362/case-sensitive-extras-not-handled-for-dist

DocImpact

Related-Bug: 1479962
Change-Id: I605f1769d85eb18d24783ea25d4c6bedd27cb42d
2015-08-26 09:22:31 -05:00
David Stanek
55e9514cbd Remove all traces of oslo incubator
- removes run_tests.sh since it's rarely used and an alternative exists
- removes all the remaining incubator files since nothing uses them

The real value of run_tests.sh over tox is that run_tests.sh enables
running tests against against any virtualenv or Python installation. tox
is just a tool that runs testr commands in a specific virtualenv. testr
can be used directly as a run_tests.sh replacement for running tests in
an arbitrary virtualenv or against any Python installation.

blueprint remove-oslo-incubator
Change-Id: I9d4ef8bf935eb565af1c8d53d1ed71be9a94a975
2015-08-20 20:16:42 +00:00
Brant Knudson
2d96d3467a Extras for bandit
Rather than put bandit in test-requirements.txt, put it in its
own section in [extras].

Change-Id: I53ac219ac8b7be077edb2a2ce5d4ed5f69d0a8e4
2015-08-18 09:40:05 -05:00
Brant Knudson
62058ae458 Use extras for memcache and MongoDB packages
This allows deployers to install packages that are required for
memcache and MongoDB using keystone['memcache'] and
keystone['MongoDB'], respectively.

Change-Id: Ie11a3017664015f1048cbedd5f727dd50f704055
Partial-Bug: 1479962
2015-08-18 09:38:58 -05:00
Jenkins
e31ef58051 Merge "Use extras for ldap dependencies" 2015-08-07 19:34:54 +00:00
Jenkins
bf2e355907 Merge "Fix test_utils for py34" 2015-08-03 21:34:52 +00:00
Brant Knudson
87ebedc136 Use extras for ldap dependencies
This allows installing ldap dependencies using keystone[ldap].

pbr documentation:

 http://docs.openstack.org/developer/pbr/#environment-markers

Partial-Bug: 1479962
Change-Id: Id8e30bdcc16d99b0fb5dc995665d2ddeba19309f
2015-07-31 19:19:04 +00:00
Brant Knudson
64e340ee4a Ensure database options registered for tests
DeprecatedTestCase and DeprecatedOverrideTestCase use options in the
database section, but these options won't be registered unless
keystone.common.sql.initialize() is called.

This caused the python34 tests to fail with

 oslo_config.cfg.NoSuchOptError: no such option: database

bp python3

Closes-Bug: 1474491
Change-Id: Ic6376142e5e14f1b25cc203c5b37751dc0a25981
2015-07-28 20:55:41 -05:00
Jenkins
ac04350ad8 Merge "Fix s3.core for py34" 2015-07-24 00:52:26 +00:00
Jenkins
04b1f3d1d8 Merge "test_base64utils works with py34" 2015-07-24 00:52:16 +00:00
Jenkins
103f0a7c9a Merge "Fix test_exception.py for py34" 2015-07-24 00:49:52 +00:00
Jenkins
62303a35a5 Merge "Moves keystone.hacking into keystone.tests" 2015-07-23 11:57:53 +00:00
Brant Knudson
21b0abb7c3 Fix test_exception.py for py34
test_exception.py was failing on py34 because the test assumed that
UnicodeDecodeError would happen, but on python 3 the replacement
doesn't fail.

bp python3

Change-Id: Ia778c3ea39260a29670488d32f63cfdb032911c2
2015-07-22 21:07:54 -05:00
Brant Knudson
a977148c9f Fix s3.core for py34
check_signature was failing with an error since hmac.new expects
bytes for the key. Also, base64.encodestring is deprecated in favor
of base64.encodebytes.

bp python3

Change-Id: I36bcf0e020b98ffa0e34464fee22a949b872c08f
2015-07-22 20:42:01 -05:00
Brant Knudson
4dab1424db Fix test_utils for py34
test_utils was failing on py34 with an error like:

 testtools.testresult.real._StringException: Traceback (most recent call last):
   File "/opt/stack/keystone/keystone/tests/unit/common/test_utils.py", line 154, in test_pki_encoder
     self.assertEqual(expected_json, json)
 ...
 testtools.matchers._impl.MismatchError: b'{"field":"value"}' != '{"field":"value"}'

bp python3

Change-Id: I944f7fe37fccfa978493730d3fd17147e4f4ddd7
2015-07-22 18:04:20 +00:00
Brant Knudson
835368473a test_base64utils works with py34
test_base64utils was failing on py34 with the error

 ...
   File "/opt/stack/keystone/keystone/common/base64utils.py", line 60, in <module>
     _base64_to_base64url_trans = string.maketrans('+/', '-_')
 nose.proxy.AttributeError: 'module' object has no attribute 'maketrans'

bp python3

Change-Id: If7df8e2800dcf94d62c17acced54f1b1092c3d9c
2015-07-22 18:02:22 +00:00
Steve Martinelli
e36ca5bf4b Clean up docs before creating new ones
The lingering output from building docs has burned me enough times
that i'm willing to take the performance hit in rebuilding them
from scratch every time. This patch removes the generated folders
doc/build and doc/source/api, before triggering a new doc build.

Change-Id: I1ea61fafb772552cac4081204751390324a239e3
2015-07-20 22:31:45 -07:00
David Stanek
721d191e79 Moves keystone.hacking into keystone.tests
At the Liberty mid-cycle we talked about cleaning up some of the cruft
from the keystone package. Since this is used in the testing phase
(tox -e pep8), let's just put it in the keystone.tests package.

Change-Id: I9e054c8adc7708b5a161c093bec9eeb6ffdc501f
2015-07-17 06:17:30 +00:00
Victor Stinner
c7069c0633 Fix tox -e py34
Use a whitelist of tests known to pass on Python 3. With a working
tox -e 34 command, it becomes possible to add a py34 non-voting gate,
and then make the py34 gate voting to avoid Python 3 regressions.

Remove the py33 test environment since OpenStack is now focused on
Python 3.4 (Python 3.3 is no more tested by the OpenStack infra).

Blueprint python3

Change-Id: I47677bc457bcabcd6432cad18b05b3f181ec49ab
2015-07-03 01:12:09 +02:00
Robert Collins
7efc3df630 Update requirements by hand.
This folds the py3 versions (which infra were not linting until
recently) into the requirements files they should now use.

Note that the -e line for ldap wasn't meant to ever merge, and
I'm not sure it can be merged now, so I've dropped it and we'll
see what happens on test.

Change-Id: Idbd162d70620f683d1bc664193b2a5fe64c159b9
2015-07-02 11:40:01 +12:00
Yuiko Takada
2e0f0aafd9 Pass environment variables of proxy to tox
When a development environment is under a proxy, tox is failed even if
environment variables of the proxy are set.

This patch fix this problem.

See:
https://review.openstack.org/#/c/189569

Change-Id: I9f88235c58422c420bbd6ba4a3d8c4a5c60db246
2015-06-15 10:10:50 +09:00
Robert Collins
a167d0b1b0 Consolidate test-requirements files.
The bandit and functional files don't add much and aren't updated by
update.py, nor are they standard where we'd want to teach update.py
about them.

Change-Id: Ibf28825a6ed50871b707703366c67f2c15a47b02
2015-06-04 07:17:52 +12:00
Brant Knudson
87f4985ad1 Update functional tox env requirements
The functional tox env requirements were in tox.ini, so they weren't
being updated automatically and were out of date.

The functional tox env requirements are moved to
test-requirements-functional.txt so that they'll be updated
automatically and the requirements are updated to the
requirements as of 8cb51513 .

Change-Id: I90ff294914487d6beee5564c2c541f7f77bb3361
2015-05-31 11:26:06 -05:00
Brant Knudson
2a3d4b30a7 Rename sample_config to genconfig
Most OpenStack projects use genconfig, so use that as our tox
venv.

Change-Id: I2edb5503a114b38fc4c719140fbee935b6b757e6
2015-05-15 10:16:42 -05:00
Brant Knudson
eaed64fd4f Move bandit requirement to test-requirements-bandit.txt
The deps in tox.ini wouldn't get updated automatically by the
openstack proposal bot. By moving the bandit requirements into
test-requirements-bandit.txt it will get updated automatically
when global-requirements changes.

Change-Id: Ifb0ec6ce4044adb38a1754521984f9900c612970
2015-05-11 09:30:47 -05:00
David Stanek
f599a768fd Ignore multiple imports per line for six.moves
In the transition to Python3 we'll be heavily using six.move to import
builtins that have changed and modules that have moved. Having them all
on one line will, in many cases, make the code look cleaner. There is
exactly what we already do with the i18n translation helpers.

bp python3
Change-Id: I5c56a1cf36749d9f190e4360d5a12616380b6598
2015-04-25 00:02:33 +00:00
David Stanek
71ac3cc972 adds a tox target for functional tests
bp functional-testing

Change-Id: I68cc48d760b4b676b07f4a0d2060a286428ac7f2
2015-04-18 12:35:15 -05:00
Brant Knudson
cc68797668 Tox env for Bandit
Run `tox -e bandit` to run bandit on the keystone codebase.

Change-Id: Idcdd7887710120e7ed0a2e93a2743bba4ad00d32
2015-03-24 14:12:16 -05:00
Brant Knudson
8c76fbe02d Use subunit-trace from tempest-lib
This makes the test output look like nova's, for consistency.

Change-Id: I24887521d5a3c7d768d77e07e40ab4468e77c9b9
2015-02-13 07:45:31 -06:00
Brant Knudson
43ba76f5f8 Remove test PYTHONHASHSEED setting
The tests are all corrected to work with any PYTHONHASHSEED, so this
setting in tox.ini can be removed. This will ensure that new tests
work with any hash seed.

Change-Id: Ibb118d9b7ba6984797e3f258e4116542e31f74fb
Closes-Bug: #1348818
2015-02-09 19:30:02 -06:00
Jenkins
32d2267b2c Merge "Move test_utils to keystone/tests/unit/" 2015-01-28 15:10:57 +00:00
Brant Knudson
02ec2dbb2f Correct failures for H238
The new H238 "old style class declaration, use new style (inherit
from `object`)" rule was failing and ignored. Now it's enforced.

Change-Id: I9f616d74e4777640cc9441e96f2bd8c1873aaaca
2015-01-11 17:33:21 -06:00
Brant Knudson
12b6538fcc Move to hacking 0.10
Release notes:
http://git.openstack.org/cgit/openstack-dev/hacking/tag/?id=0.10.0

Per the release notes, H803 has been removed.

Change-Id: Ifaf62839a4b6da62a3b380396158b463c1381026
2015-01-11 17:29:45 -06:00
Jenkins
52738c6f5a Merge "switch from sample_config.sh to oslo-config-generator" 2015-01-05 19:51:07 +00:00
Dolph Mathews
083d1cd522 switch from sample_config.sh to oslo-config-generator
This switches keystone to use oslo-config-generator, where the contents
of our sample configuration file are configured using a configuration
file in config-generators/, because the only way to have tox create
files is to have configuration files for your configuration files
(seriously, it chokes when redirects are included in the command for a
test environment).

This also takes advantage of oslo-config-generator's ability to set the
line wrap width, which is done at 79 chars here to match the rest of our
code.

Also update the actual sample file under etc/

Change-Id: I9f9a157c7802c56a2c7484f6f4adec4aeb4071b8
Closes-Bug: 1324610
2015-01-02 15:04:20 -06:00
ZhiQiang Fan
1233ee1ce7 Enable hacking rule H302
H302: import only modules.

Hacking rule H302 is broken since oslo.concurrency-0.3.0 issue,
see bug: https://bugs.launchpad.net/hacking/+bug/1398472
Since we've already fix this problem in
Change-Id: I86629a81d55d88b67cdf0639dc9995887b516cca
we can enable it again.

Change-Id: Ib1e5732d2228a2bba846b3aeaa9e6db857cbce74
2014-12-30 00:53:24 +08:00
David Stanek
c7451d7b55 Be more precise with flake8 filename matches
In upcoming patchsets I'll be introducing filenames that include
"keystone-" as part of the name. These filenames should not be checked
with flake8 because they do not contain Python code.

bp functional-testing

Change-Id: I8330f0dca0d6c1db601ddecd71c6c92cef260c99
2014-12-19 17:59:30 +00:00
David Stanek
e00db6a064 Use bashate to run_tests.sh
Change-Id: I542cae190845cbb98c030423aa6e2a747dc07263
2014-12-19 16:25:39 +00:00
Lance Bragstad
32d44a6d06 Move test_utils to keystone/tests/unit/
This commit moves the unit tests that are in the test_utils.py module to
keystone/tests/unit/ directory. There was also a duplicate module that
tested keystone.common.utils so those tests were refactored so that they all
live in the same test module.

Change-Id: Ie1d84ae50faf25319099a224639ed27826b612ad
2014-12-19 15:27:28 +00:00
Jenkins
d82a3caa32 Merge "drop developer support for OS X" 2014-12-03 08:14:08 +00:00
Dolph Mathews
d6cb3c6898 drop developer support for OS X
Due to an increasing number of incompatibilities between Keystone
dependencies and OS X (openssl, ldap, eventlet), this drops support for
Keystone development on OS X.

Change-Id: I3c8b3b165487e460a06b43dd44d701995fa3b655
2014-12-02 14:52:46 -05:00
Morgan Fainberg
a8106b1ff4 Ignore H302 - bug 1398472
Due to bug 1398472 ignore H302 (import only modules).

Change-Id: I777dabe622f96dc6f0e2c6df605fd86ad8a7387c
Related-Bug: 1398472
2014-12-02 11:11:14 -08:00
Jenkins
6fb51edfc5 Merge "Use _ definition from keystone.i18n" 2014-11-26 00:56:38 +00:00
Jenkins
9d4f4be914 Merge "Remove Python 2.6 classifier" 2014-11-25 21:43:35 +00:00
James Carey
ec490a4a51 Use _ definition from keystone.i18n
Currently there is one case where the _ builtin is being used
instead of the translation function defined in keystone.i18n.

This will cause the messages to not support lazy translation.

This was not being checked by pep8 because the _ was specified
as a builtin in tox.ini's flake8 section.

This patch updates tox.ini to remove the builtin specification in
the flake 8 section to enable this check.

'from keystone.i18n import _' was added to the file that was
identified by the updated pep8 checking.

Change-Id: If30e394bde4b75fa1067e910a1e73a95e8e6c5dc
2014-11-25 17:44:00 +00:00
Julien Danjou
579498e3a9 Remove Python 2.6 classifier
Keystone does not support Python 2.6 anymore starting with Kilo and
might not work correctly with it, so remove the classifier.

Change-Id: Iafe029d962e8ec6960efc6b61bdd2ac86ad980b7
2014-11-25 17:03:07 +01:00
ZhiQiang Fan
fdd10a0320 Enable hacking rule H904
H904 Wrap long lines in parentheses instead of a backslash

Change-Id: Ifc1ff3acd07c63fecb0e3482ae6683bcf3e18cb2
2014-11-06 23:11:06 +08:00
ZhiQiang Fan
cbe2b0716c Enable hacking rule H104 File contains nothing but comments
Change-Id: I49f774b6f2ef0bc0ae4822459f0ea5bf7896a9d4
2014-11-06 01:47:31 +08:00