Skip to content
Snippets Groups Projects
Commit f2975326 authored by Riccardo Pittau's avatar Riccardo Pittau
Browse files

Fix rbac tests

Fix the exceptions got from test_reader_cannot_get_indicator_state
and test_reader_cannot_ipa_heartbeat.

Also get_indicator_state takes only 2 arguments since the get_one()
function takes only 2 positional arguments besides self, node_uuid
and indicator.

Change-Id: I4b5399562ffddb6e603f457aef1423f1fe7ba93e
parent e121d9a9
No related branches found
No related tags found
No related merge requests found
......@@ -44,10 +44,10 @@ class TestNodeProjectReader(base.BaseBaremetalRBACTest):
def test_reader_cannot_create_node(self):
try:
resp, body = self.reader_client.create_node(self.chassis['uuid'])
except lib_exc.ServerFault as e:
except lib_exc.Forbidden as e:
resp = e.resp
self.assertEqual(500, resp.status)
self.assertEqual(403, resp.status)
def test_reader_cannot_get_node(self):
"""Reader cannot get node
......@@ -388,7 +388,7 @@ class TestNodeProjectReader(base.BaseBaremetalRBACTest):
"""
try:
resp, body = self.reader_client.get_node_indicator_state(
self.node['uuid'], 'system', 'alert')
self.node['uuid'], 'system')
except lib_exc.NotFound as e:
resp = e.resp
......@@ -660,10 +660,10 @@ class TestNodeProjectReader(base.BaseBaremetalRBACTest):
resp, body = self.reader_client.ipa_heartbeat(
self.node['uuid'], callback_url='http://foo/',
agent_token=uuidutils.generate_uuid(), agent_version='1')
except lib_exc.NotFound as e:
except lib_exc.BadRequest as e:
resp = e.resp
self.assertEqual(404, resp.status)
self.assertEqual(400, resp.status)
class TestNodeSystemReader(base.BaseBaremetalRBACTest):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment