2012-10-29 17:47:14 -04:00
|
|
|
Shindo.tests('Fog::Identity[:openstack] | EC2 credential requests', ['openstack']) do
|
|
|
|
|
|
|
|
@credential_format = {
|
|
|
|
'access' => String,
|
|
|
|
'tenant_id' => String,
|
|
|
|
'secret' => String,
|
|
|
|
'user_id' => String,
|
|
|
|
}
|
|
|
|
|
2013-01-26 17:34:18 -05:00
|
|
|
@user_id = OpenStack::Identity.get_user_id
|
|
|
|
@tenant_id = OpenStack::Identity.get_tenant_id
|
|
|
|
|
2012-10-29 17:47:14 -04:00
|
|
|
tests('success') do
|
|
|
|
tests('#create_ec2_credential').
|
|
|
|
formats({'credential' => @credential_format}) do
|
|
|
|
response =
|
|
|
|
Fog::Identity[:openstack].
|
2013-01-26 17:34:18 -05:00
|
|
|
create_ec2_credential(@user_id, @tenant_id)
|
2012-10-29 17:47:14 -04:00
|
|
|
|
|
|
|
@ec2_credential = response.body['credential']
|
|
|
|
|
|
|
|
response.body
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('#get_ec2_credential').
|
|
|
|
formats({'credential' => @credential_format}) do
|
|
|
|
Fog::Identity[:openstack].
|
2013-01-26 17:34:18 -05:00
|
|
|
get_ec2_credential(@user_id, @ec2_credential['access']).body
|
2012-10-29 17:47:14 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests('#list_ec2_credentials').
|
|
|
|
formats({'credentials' => [@credential_format]}) do
|
|
|
|
Fog::Identity[:openstack].
|
2013-01-26 17:34:18 -05:00
|
|
|
list_ec2_credentials(@user_id).body
|
2012-10-29 17:47:14 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests('#delete_ec2_credential').succeeds do
|
|
|
|
Fog::Identity[:openstack].
|
2013-01-26 17:34:18 -05:00
|
|
|
delete_ec2_credential(@user_id, @ec2_credential['access'])
|
2012-10-29 17:47:14 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|