diff options
author | Bernhard M. Wiedemann <bwiedemann@suse.de> | 2019-05-08 14:00:26 +0200 |
---|---|---|
committer | Guang Yee <guang.yee@suse.com> | 2020-01-21 22:46:05 -0800 |
commit | 89af8f0192a3446e416efe2215b47c4e3a89809d (patch) | |
tree | 7c0799b2654f977d5c1d06646beae96d550ffea9 | |
parent | 9c4cc10e647a59fa4a3b3673f6f4e0107ef334aa (diff) | |
download | keystonemiddleware-89af8f0192a3446e416efe2215b47c4e3a89809d.tar.gz |
Make tests pass in 2022stein-em6.0.1stable/stein
Background:
As part of my work on reproducible builds for openSUSE, I check that software still gives identical build results in the future.
The usual offset is +15 years, because that is how long I expect some software will be used in some places.
This showed up failing tests in our package build.
See https://reproducible-builds.org/ for why this matters.
This makes it expire 1 year in the future to model realistic tokens.
NOTE: in addition to the orginal backport, this patch adds the following
changes. The changes has to be combined into a single patch in order to
avoid circular dependencies.
1. fixed the hadcoded token expiration date in
keystonemiddleware/tests/unit/client_fixtures.py. This is using the same
technique in the original backport.
2. fixed bandit complains in keystonemiddleware/auth_token/_request.py.
The request environment variable names are not tokens. We'll need to
mark them as false positives so bandit can stop chirping.
3. updated the lower constraint for python-memcached to 1.59 to be
consistent with openstack/requirements
4. combined with cherry pick from commit
0a65b1420799e7c7f8736e9f6c234f755ab5ac6b to avoid circular dependency. Without
combining them, neither backport will pass all the gates.
5. combined with cherry pick from commmit
e93d078958047ebc15159224e2068acdd8e6b768 to avoid circular dependency. Without
combining them, neither backport will pass all the gates.
Change-Id: I73bde68be53afff4e8dff12d756b8381f34b2adb
(cherry picked from commit 0a65b1420799e7c7f8736e9f6c234f755ab5ac6b)
(cherry picked from commit e93d078958047ebc15159224e2068acdd8e6b768)
(cherry picked from commit 4a4c96ce9b28ed54f93a21ca405c5b34ef3c3429)
-rw-r--r-- | doc/requirements.txt | 6 | ||||
-rw-r--r-- | doc/source/conf.py | 2 | ||||
-rw-r--r-- | keystonemiddleware/auth_token/_request.py | 4 | ||||
-rw-r--r-- | keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py | 3 | ||||
-rw-r--r-- | keystonemiddleware/tests/unit/client_fixtures.py | 4 | ||||
-rw-r--r-- | lower-constraints.txt | 3 | ||||
-rw-r--r-- | releasenotes/notes/raise-lower-constraint-for-python-memcached-d96d96fe769f3419.yaml | 5 | ||||
-rw-r--r-- | test-requirements.txt | 5 |
8 files changed, 22 insertions, 10 deletions
diff --git a/doc/requirements.txt b/doc/requirements.txt index 6e62d8d..dde63f5 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -6,7 +6,8 @@ doc8>=0.6.0 # Apache-2.0 openstackdocstheme>=1.18.1 # Apache-2.0 reno>=2.5.0 # Apache-2.0 -sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD +sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD +sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD sphinxcontrib-apidoc>=0.2.0 # BSD # For autodoc builds @@ -14,6 +15,7 @@ mock>=2.0.0 # BSD oslotest>=3.2.0 # Apache-2.0 requests-mock>=1.2.0 # Apache-2.0 testresources>=2.0.0 # Apache-2.0/BSD -python-memcached>=1.56 # PSF +python-memcached>1.55;python_version=='2.7' # PSF +python-memcached>1.57;python_version>='3.4' # PSF WebTest>=2.0.27 # MIT oslo.messaging>=5.29.0 # Apache-2.0 diff --git a/doc/source/conf.py b/doc/source/conf.py index 9e8aaff..aa3c72d 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -161,7 +161,7 @@ html_theme = 'openstackdocs' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +#html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. diff --git a/keystonemiddleware/auth_token/_request.py b/keystonemiddleware/auth_token/_request.py index 33df7a9..269c3d3 100644 --- a/keystonemiddleware/auth_token/_request.py +++ b/keystonemiddleware/auth_token/_request.py @@ -105,8 +105,8 @@ class _AuthTokenRequest(webob.Request): _SYSTEM_SCOPE_HEADER = 'OpenStack-System-Scope' _SERVICE_CATALOG_HEADER = 'X-Service-Catalog' - _TOKEN_AUTH = 'keystone.token_auth' - _TOKEN_INFO = 'keystone.token_info' + _TOKEN_AUTH = 'keystone.token_auth' # nosec + _TOKEN_INFO = 'keystone.token_info' # nosec _CONFIRMED = 'Confirmed' _INVALID = 'Invalid' diff --git a/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py b/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py index 9ea8077..32ad403 100644 --- a/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py +++ b/keystonemiddleware/tests/unit/auth_token/test_auth_token_middleware.py @@ -90,7 +90,8 @@ BASE_URI = '%s/testadmin' % BASE_HOST FAKE_ADMIN_TOKEN_ID = 'admin_token2' FAKE_ADMIN_TOKEN = jsonutils.dumps( {'access': {'token': {'id': FAKE_ADMIN_TOKEN_ID, - 'expires': '2022-10-03T16:58:01Z'}}}) + 'expires': '%i-10-03T16:58:01Z' % + (1 + time.gmtime().tm_year)}}}) VERSION_LIST_v3 = fixture.DiscoveryList(href=BASE_URI) VERSION_LIST_v2 = fixture.DiscoveryList(v3=False, href=BASE_URI) diff --git a/keystonemiddleware/tests/unit/client_fixtures.py b/keystonemiddleware/tests/unit/client_fixtures.py index 9f56804..f9c8a2c 100644 --- a/keystonemiddleware/tests/unit/client_fixtures.py +++ b/keystonemiddleware/tests/unit/client_fixtures.py @@ -13,6 +13,7 @@ # under the License. import os +import time import uuid import fixtures @@ -205,7 +206,8 @@ class Examples(fixtures.Fixture): 'access': { 'token': { 'id': self.VALID_DIABLO_TOKEN, - 'expires': '2020-01-01T00:00:10.000123Z', + 'expires': '%i-01-01T00:00:10.000123Z' % + (1 + time.gmtime().tm_year), 'tenantId': PROJECT_ID, }, 'user': { diff --git a/lower-constraints.txt b/lower-constraints.txt index acf8d61..8afddf0 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -58,7 +58,8 @@ pyparsing==2.2.0 pyperclip==1.6.0 python-dateutil==2.7.0 python-keystoneclient==3.8.0 -python-memcached==1.56 +python-memcached==1.56;python_version=='2.7' +python-memcached==1.58;python_version>='3.4' python-mimeparse==1.6.0 python-subunit==1.2.0 pytz==2018.3 diff --git a/releasenotes/notes/raise-lower-constraint-for-python-memcached-d96d96fe769f3419.yaml b/releasenotes/notes/raise-lower-constraint-for-python-memcached-d96d96fe769f3419.yaml new file mode 100644 index 0000000..25740c2 --- /dev/null +++ b/releasenotes/notes/raise-lower-constraint-for-python-memcached-d96d96fe769f3419.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + The lower constraint for python-memcached must be raised to version 1.58 + in order to work with Python 3.4 and above. diff --git a/test-requirements.txt b/test-requirements.txt index 3153d81..4072a70 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -15,9 +15,10 @@ stevedore>=1.20.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0 testresources>=2.0.0 # Apache-2.0/BSD testtools>=2.2.0 # MIT -python-memcached>=1.56 # PSF +python-memcached>=1.56;python_version=='2.7' # PSF +python-memcached>=1.58;python_version>='3.4' # PSF WebTest>=2.0.27 # MIT oslo.messaging>=5.29.0 # Apache-2.0 # Bandit security code scanner -bandit>=1.1.0 # Apache-2.0 +bandit!=1.6.0,>=1.1.0 # Apache-2.0 |