Merge lp:~corey.bryant/ubuntu/trusty/keystone/fix-for-1289935 into lp:~ubuntu-server-dev/keystone/icehouse

Proposed by Corey Bryant
Status: Merged
Merged at revision: 264
Proposed branch: lp:~corey.bryant/ubuntu/trusty/keystone/fix-for-1289935
Merge into: lp:~ubuntu-server-dev/keystone/icehouse
Diff against target: 142 lines (+85/-5) (has conflicts)
5 files modified
debian/changelog (+12/-0)
debian/keystone.postinst (+2/-2)
debian/patches/revoke-api.patch (+70/-0)
debian/patches/series (+1/-1)
debian/rules (+0/-2)
Text conflict in debian/changelog
Contents conflict in debian/patches/sql_connection.patch
To merge this branch: bzr merge lp:~corey.bryant/ubuntu/trusty/keystone/fix-for-1289935
Reviewer Review Type Date Requested Status
James Page Pending
Review via email: mp+210739@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-03-12 14:03:01 +0000
3+++ debian/changelog 2014-03-13 05:14:26 +0000
4@@ -1,9 +1,21 @@
5+<<<<<<< TREE
6 keystone (1:2014.1~b3+master-0ubuntu1) UNRELEASED; urgency=medium
7
8 * d/p/*: Refreshed
9
10 -- James Page <james.page@ubuntu.com> Wed, 12 Mar 2014 13:59:01 +0000
11
12+=======
13+keystone (1:2014.1~b3-0ubuntu3) UNRELEASED; urgency=medium
14+
15+ * debian/patches/*: Drop sql_connection.patch
16+ * debian/rules: Drop use of sql_connection.patch
17+ * debian/patches/revoke-api.patch: Add upstream patch (LP: #1289935)
18+ * debian/keystone.postinst: Fix db_sync logic (LP: #1290423)
19+
20+ -- Corey Bryant <corey.bryant@canonical.com> Wed, 12 Mar 2014 23:20:05 -0500
21+
22+>>>>>>> MERGE-SOURCE
23 keystone (1:2014.1~b3-0ubuntu2) trusty; urgency=medium
24
25 * Make test execution more verbose to avoid timeouts on buildds:
26
27=== modified file 'debian/keystone.postinst'
28--- debian/keystone.postinst 2014-03-06 18:09:17 +0000
29+++ debian/keystone.postinst 2014-03-13 05:14:26 +0000
30@@ -17,8 +17,8 @@
31 #su -s /bin/sh -c 'exec keystone database sync' keystone
32 ;;
33 configure)
34- if ! grep -q sql_connection /etc/keystone/keystone.conf
35- then
36+ if ! grep connection /etc/keystone/keystone.conf | grep -qv "connection = sqlite:////var/lib/keystone/keystone.sqlite"
37+ then
38 su -s /bin/sh -c 'exec keystone-manage db_sync' keystone
39 fi
40 su -s /bin/sh -c 'exec keystone-manage pki_setup' keystone
41
42=== added file 'debian/patches/revoke-api.patch'
43--- debian/patches/revoke-api.patch 1970-01-01 00:00:00 +0000
44+++ debian/patches/revoke-api.patch 2014-03-13 05:14:26 +0000
45@@ -0,0 +1,70 @@
46+Description: Call an existing method in sync cache for revoke events
47+Origin/Author: Morgan Fainberg <m@metacloud.com>
48+Bug: https://bugs.launchpad.net/keystone/+bug/1289935
49+Index: keystone/keystone/contrib/revoke/core.py
50+===================================================================
51+--- keystone.orig/keystone/contrib/revoke/core.py 2014-03-06 10:21:24.000000000 -0600
52++++ keystone/keystone/contrib/revoke/core.py 2014-03-12 13:23:35.636398973 -0500
53+@@ -76,7 +76,7 @@
54+ with self._store.get_lock(_TREE_KEY):
55+ for e in self._current_events:
56+ if e.revoked_at < cutoff:
57+- self.revoke_map.remove(e)
58++ self.revoke_map.remove_event(e)
59+ self._current_events.remove(e)
60+ else:
61+ break
62+Index: keystone/keystone/tests/test_revoke.py
63+===================================================================
64+--- keystone.orig/keystone/tests/test_revoke.py 2014-03-06 10:21:24.000000000 -0600
65++++ keystone/keystone/tests/test_revoke.py 2014-03-12 13:23:35.636398973 -0500
66+@@ -14,9 +14,12 @@
67+ import datetime
68+ import uuid
69+
70++import mock
71++
72+ from keystone.common import dependency
73+ from keystone import config
74+ from keystone.contrib.revoke import model
75++from keystone import exception
76+ from keystone.openstack.common import timeutils
77+ from keystone import tests
78+ from keystone.tests import test_backend_sql
79+@@ -137,6 +140,36 @@
80+ self.revoke_api.revoke(event)
81+ self.assertEqual(1, len(self.revoke_api.get_events()))
82+
83++ @mock.patch.object(timeutils, 'utcnow')
84++ def test_expired_events_removed_validate_token_success(self, mock_utcnow):
85++ def _sample_token_values():
86++ token = _sample_blank_token()
87++ token['expires_at'] = timeutils.isotime(_future_time(),
88++ subsecond=True)
89++ return token
90++
91++ now = datetime.datetime.utcnow()
92++ now_plus_2h = now + datetime.timedelta(hours=2)
93++ mock_utcnow.return_value = now
94++
95++ # Build a token and validate it. This will seed the cache for the
96++ # future 'synchronize' call.
97++ token_values = _sample_token_values()
98++
99++ user_id = _new_id()
100++ self.revoke_api.revoke_by_user(user_id)
101++ token_values['user_id'] = user_id
102++ self.assertRaises(exception.TokenNotFound,
103++ self.revoke_api.check_token,
104++ token_values)
105++
106++ # Move our clock forward by 2h, build a new token and validate it.
107++ # 'synchronize' should now be exercised and remove old expired events
108++ mock_utcnow.return_value = now_plus_2h
109++ self.revoke_api.revoke_by_expiration(_new_id(), now_plus_2h)
110++ #should no longer throw an exception
111++ self.revoke_api.check_token(token_values)
112++
113+
114+ class SqlRevokeTests(test_backend_sql.SqlTests, RevokeTests):
115+ def setUp(self):
116
117=== modified file 'debian/patches/series'
118--- debian/patches/series 2014-02-28 14:24:52 +0000
119+++ debian/patches/series 2014-03-13 05:14:26 +0000
120@@ -1,5 +1,5 @@
121 fix-ubuntu-tests.patch
122-sql_connection.patch
123 ubuntu-test-overrides.patch
124 #add-version-info.patch
125 ubuntu-oslo.sphinx.patch
126+revoke-api.patch
127
128=== renamed file 'debian/patches/sql_connection.patch' => 'debian/patches/sql_connection.patch.THIS'
129=== modified file 'debian/rules'
130--- debian/rules 2014-03-06 21:37:15 +0000
131+++ debian/rules 2014-03-13 05:14:26 +0000
132@@ -12,10 +12,8 @@
133
134 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
135 override_dh_auto_test:
136- patch -p1 -R < debian/patches/sql_connection.patch
137 mkdir -p $(CURDIR)/keystone/tests/tmp
138 ./run_tests.sh -N -P
139- patch -p1 < debian/patches/sql_connection.patch
140 endif
141
142 override_dh_auto_build:

Subscribers

People subscribed via source and target branches