<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi,<br>
<br>
I have written a code in nova and for that i have to write Unit Tests. I could do complete it and some of the functions in this Unit Test result in Success. One function is failing, because it is actually calling the code in Nova, in which it makes connection
to keystone (using keystoneclient.v3.client) to get some data. For making this connection it uses the auth_token. But in the unit test, i am creating a fake context and so i guess there is no auth_token. Due to this, a URL testing is failing.
<br>
<br>
For eg: In the Unit Test, i am calling <br>
<br>
req = fakes.HTTPRequestV3.blank('/v2/fake4/.........',<br>
use_admin_context=True)<br>
res_dict = self.controller.update(req, 'update_me', body)<br>
<br>
Now, in the nova code for this URL, i am using<br>
<br>
keystone = keystoneclient.v3.Client(token=context.auth_token,<br>
auth_url=auth_url,<br>
project_id=context.project_id)<br>
<br>
So, here the SSL authorization failed error coming up for the test.<br>
<br>
How can i solve this? How can i create a auth_token in the unit test and pass somehow to the actual nova, which it can use it in the keystoneclient api call to make the call successfully?<br>
<br>
Thanks & Regards,<br>
Vinod Kumar Boppanna<br>
<br>
</div>
</body>
</html>