don't allow get/update/delete subscirtions with wrong queue

A subscription is always belong to a queue. We should
not allow users to get/update/delete the subscription
if they provide wrong queue name.

Change-Id: I4728fa5139962aa621d0af6fb385613435d3b1be
Closes-bug: #1653847
This commit is contained in:
wangxiyuan 2017-01-04 10:12:26 +08:00
parent b88d46e3e6
commit 698e96f00e
1 changed files with 3 additions and 4 deletions

View File

@ -239,10 +239,9 @@ class TestSubscriptionsNegative(base.BaseV2MessagingTest):
subscription_id = results[0][1]["subscription_id"]
non_existent_queue = data_utils.rand_name('rand_queuename')
update_rbody = {'ttl': 1000}
resp, _ = self.client.update_subscription(non_existent_queue,
subscription_id,
update_rbody)
self.assertEqual('204', resp['status'])
self.assertRaises(lib_exc.NotFound, self.client.update_subscription,
non_existent_queue, subscription_id, update_rbody)
for result in results:
subscription_id = result[1]["subscription_id"]
self.delete_subscription(self.queue_name, subscription_id)