Skip to content

Commit

Permalink
minor changes; remove file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan Donowitz committed Oct 4, 2021
1 parent 708ba57 commit 722d0ce
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 109 deletions.
102 changes: 0 additions & 102 deletions tokenserver_rs.sql

This file was deleted.

12 changes: 7 additions & 5 deletions tools/integration_tests/tokenserver/test_authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,10 @@ def test_kid_change_during_gradual_tokenserver_rollout(self):
}
# They sync again, but hit a tokenserver node that isn't updated yet.
# This would trigger the allocation of a new user, so we simulate this
# by adding a new user.
uid = self._add_user(generation=2345, client_state='626262')
# by adding a new user. We set keys_changed_at to be the last-used
# value, since we are simulating a server that doesn't pay attention
# to keys_changed_at.
uid = self._add_user(generation=2345, keys_changed_at=1200, client_state='626262')
user2 = self._get_user(uid)
self.assertNotEqual(user1['uid'], user2['uid'])
self.assertEqual(user1['nodeid'], user2['nodeid'])
Expand All @@ -384,11 +386,11 @@ def test_kid_change_during_gradual_tokenserver_rollout(self):

def test_update_client_state(self):
uid = self._add_user(generation=0, keys_changed_at=None,
client_state='616161')
client_state='')
user1 = self._get_user(uid)
# The user starts out with no client_state
self.assertEqual(user1['generation'], 0)
self.assertEqual(user1['client_state'], '616161')
self.assertEqual(user1['client_state'], '')
seen_uids = set((uid,))
orig_node = user1['nodeid']
# Changing client_state allocates a new user, resulting in a new uid
Expand Down Expand Up @@ -445,7 +447,7 @@ def test_update_client_state(self):
oauth_token = self._forge_oauth_token(generation=1236)
headers = {
'Authorization': 'Bearer %s' % oauth_token,
'X-KeyID': '1236-YWFh'
'X-KeyID': '1236-YmJi'
}
res = self.app.get('/1.0/sync/1.5', headers=headers, status=401)
expected_error_response = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_new_user_allocation(self):
res = self.app.get('/1.0/sync/1.5', headers=headers)
# The user should have been allocated to the least-loaded node
# (computed as current_load / capacity) that has backoff and downed
# set to false
# set to 0
user = self._get_user(res.json['uid'])
self.assertEqual(user['nodeid'], node_id)
# The selected node should have current_load incremented and available
Expand Down
2 changes: 1 addition & 1 deletion tools/integration_tests/tokenserver/test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class TestCase:
SYNC_1_1_SERVICE_ID = 1
SYNC_1_5_SERVICE_ID = 2
SYNC_1_5_SERVICE_NAME = 'sync-1.5'
TOKENSERVER_HOST = os.environ['TOKENSERVER_HOST']
TOKEN_SIGNING_SECRET = 'secret'
TOKENSERVER_HOST = os.environ['TOKENSERVER_HOST']

def setUp(self):
self.database = mysql.connector.connect(
Expand Down

0 comments on commit 722d0ce

Please sign in to comment.