Merge "Tests for Client-ID validation"
This commit is contained in:
commit
bc186aeb1a
@ -284,6 +284,21 @@ class TestMessages(base.FunctionalTestBase):
|
||||
|
||||
test_get_messages_malformed_marker.tags = ['negative']
|
||||
|
||||
@ddt.data(None, '1234', 'aa2-bb3',
|
||||
'103e09c6-31b7-11e3-86bc-b8ca3ad0f5d81',
|
||||
'103e09c6-31b7-11e3-86bc-b8ca3ad0f5d')
|
||||
def test_get_messages_invalid_client_id(self, client_id):
|
||||
"""Get messages with invalid client id."""
|
||||
url = self.message_url
|
||||
|
||||
header = helpers.create_marconi_headers(self.cfg)
|
||||
header['Client-ID'] = client_id
|
||||
|
||||
result = self.client.get(url, headers=header)
|
||||
self.assertEqual(result.status_code, 400)
|
||||
|
||||
test_get_messages_invalid_client_id.tags = ['negative']
|
||||
|
||||
def tearDown(self):
|
||||
super(TestMessages, self).tearDown()
|
||||
self.client.delete(self.queue_url)
|
||||
|
@ -72,6 +72,7 @@ class TestInsertQueue(base.FunctionalTestBase):
|
||||
self.base_url = '{0}/{1}'.format(self.cfg.marconi.url,
|
||||
self.cfg.marconi.version)
|
||||
|
||||
self.header = helpers.create_marconi_headers(self.cfg)
|
||||
self.headers_response_empty = set(['location'])
|
||||
self.client.set_base_url(self.base_url)
|
||||
|
||||
@ -129,7 +130,7 @@ class TestInsertQueue(base.FunctionalTestBase):
|
||||
self.skipTest("Auth is not on!")
|
||||
|
||||
header = copy.copy(self.header)
|
||||
header["X-Auth-Token"] = 'invalid'
|
||||
header['X-Auth-Token'] = 'invalid'
|
||||
|
||||
result = self.client.put(self.url, headers=header)
|
||||
self.assertEqual(result.status_code, 401)
|
||||
@ -289,7 +290,7 @@ class TestQueueMisc(base.FunctionalTestBase):
|
||||
|
||||
test_list_queues_detailed.tags = ['smoke', 'positive']
|
||||
|
||||
@ddt.data(0, -1, 30)
|
||||
@ddt.data(0, -1, 1001)
|
||||
def test_list_queue_invalid_limit(self, limit):
|
||||
"""List Queues with a limit value that is not allowed."""
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user