1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
Commit graph

81 commits

Author SHA1 Message Date
Dan Prince
c3dac20b6d Merge pull request from bvox/openstack-identity-test-fixes
[openstack|identity] user model tests fixes
2013-03-04 19:09:48 -08:00
Sergio Rubio
8bb3e60aea [openstack|compute] images collection should not return nil for #all
Fog::Compute[:openstack].images.all returns nil without the patch.
The patch should bring the images collection behaviour in-line with
other collections I think.

The added test should expose the issue.
2013-03-04 18:54:18 +01:00
Sergio Rubio
3cbb6f2622 [openstack|identity] cleanup the test role when no longer in use 2013-03-04 16:56:36 +01:00
Sergio Rubio
2381ed38be [openstack|identity] user model tests fixes
- update_tenant expects a tenant model or a tenant_id
- update_enabled expects a boolean
2013-03-04 16:47:40 +01:00
Sergio Rubio
d903af4562 [openstack|volume] Added missing service declaration
- Fixes regresion probably caused by eb0545b
- Added minimal test to catch the issue
- Fixes 
2013-02-27 16:58:03 +01:00
Dan Prince
8509d5c05d OpenStack: Add missing metadatum requests.
Add missing delete_meta and update_meta calls to the OpenStack
API. Also updates the model with some tests on these new calls.
2013-02-26 14:48:36 -05:00
Dan Prince
60fefe7b80 OpenStack Compute: Fix server model metadata
Updates the OpenStack compute server model so that it stores/handles
metadata correctly on Server create again.

This was a regression from 21499d8 (and should properly handle the
concern there too).

Includes an update to the test that fails without these fixes.
2013-02-25 13:49:23 -05:00
Sergio Rubio
8a47ca26c4 [openstack|network] Added missing Network model attributes
The following patch adds the following missing attributes:

+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| provider:network_type     | gre                                  |
| provider:physical_network |                                      |
| provider:segmentation_id  | 1                                    |
| router:external           | False                                |
+---------------------------+--------------------------------------+

Not sure if the code style I've used for the attributes is OK though,
I did it so I don't break the 80 col. barrier.

Added also a small test for the new and existing attributes.
2013-02-21 12:32:43 +01:00
Dan Prince
0a0b3ae9cf Merge pull request from rubiojr/openstack-storage
OpenStack Storage Service
2013-01-28 12:34:28 -08:00
Dan Prince
020d992b57 Drop 'extras' from tenant test validations. 2013-01-28 13:09:39 -05:00
Dan Prince
65a90fd655 OpenStack: get identity tests passing in real mode
Updates to the OpenStack identity tests to they pass in both real
and mock modes.

Also, fixes an issue in the delete_user_role request where it
was expecting 200 instead of 204 (which seems to match the
spec and implementation).
2013-01-28 13:07:22 -05:00
Dan Prince
cc1e019c32 Merge pull request from dprince/openstack_limit_test_update
OpenStack: update used limits tests.
2013-01-25 19:43:12 -08:00
Dan Prince
a27254badc OpenStack: update tenant_list tests
Updates the tenant_list tests to pass in *real* mode.
2013-01-25 21:48:52 -05:00
Dan Prince
ad6cd5489d OpenStack: update used limits tests.
Updates the get_limits request Mock and test so that it includes the
new totalFloatingIpsUsed limit.

Also, drops the totalKeyPairsUsed limit since it is no longer used
since https://bugs.launchpad.net/nova/+bug/1089877.
2013-01-25 20:35:41 -05:00
Sergio Rubio
74ce4467eb [openstack|storage] Added OpenStack Storage service tests
Mostly copy&paste from the Rackspace Storage service
2013-01-23 20:55:15 +01:00
Paul Thornthwaite
8ed3a056c7 [openstack|identity] Marks test as pending
Issue  conceals a bug in the #formats helper that allowed this to
pass such that the response of #delete_user_role does not match the
declared schema.

Response when mocked is an empty String which does not match the
declared schema of a Hash.
2013-01-23 15:24:21 +00:00
kanetann
a7df32a8cd deleted old files eg. floatingip.rb 2012-12-25 10:42:22 +09:00
kanetann
9ebd161e03 updated for ruby naming conventions. 2012-12-22 14:26:43 +09:00
kanetann
7e41a3ef5e fixed disassociate_floatingip bug and update floatingip-* mock values. 2012-12-19 16:09:26 +09:00
kanetann
54b85c26e3 deleted update_floatingip and changed variable name from floating_network_id to floatingip_id. 2012-12-19 14:58:26 +09:00
kanetann
920672fbb0 update associate_floatingip for real 2012-12-18 19:19:18 +09:00
kanetann
a4abfa3118 added associate_floatingip and disassosiate_floatingip mock test 2012-12-17 16:35:28 +09:00
kanetann
8329f16f8d added floatingip 2012-12-14 18:35:37 +09:00
Dan Prince
aee9f10d1a Merge pull request from CobyR/master
fix for tenant.users returning all users
2012-12-11 18:27:23 -08:00
Dan Prince
de80a97d7b Merge pull request from dprince/auth_improvements
OpenStack: Auth improvements
2012-12-10 19:43:04 -08:00
Coby Randquist
7f69c47b94 add failing test and update Mock list_users to filter based on tenant_id 2012-12-10 18:12:28 -08:00
Wesley Beary
c712a44619 Merge pull request from dprince/openstack_remove_server_requests_format
OpenStack: Drop unused server_format hash.
2012-12-10 11:05:19 -08:00
Dan Prince
ba26129001 OpenStack auth updates to select by service name.
This patch updates the OpenStack auth implementation so that
it supports selecting API service by both 'name' and 'type'.

Previously the implementation was confusing because it
used a config param called :openstack_service_name to
select the service 'type' from the catalog. This patch
swaps it so that :openstack_service_name actually selects
by 'name'.

The previous logic to select service by type ('compute' for example)
has been preserved in a new :openstack_service_type parameter.
This option is used just as it was before for backwards compatability.

This change is potentially breaking for anyone previously using
:openstack_service_name (which I don't think is that common but is
possible). As such we should probably make a release note saying
that previous users of :openstack_service_name should migrate to
use :openstack_service_type instead.
2012-12-10 07:55:54 -05:00
Dan Prince
c544610791 OpenStack custom exception cleanup.
Fixes an exception class name error for the custom
OpenStack ServiceUnavailable exception. Previously the wrong
class name was being used.

Also cleans up and simplifies some other exceptions in the OpenStack
implementation. (We can simply use NotFound from Fog::Errors instead)
2012-12-09 16:51:07 -05:00
Eric Hodel
e85428dcf0 OpenStack servers can now retrieve security groups
Added default security group to the OpenStack compute mocks.

OpenStack server creation mock now stores the security groups for the
created server.

OpenStack security group mock deletion now deletes created security
groups.

OpenStack security group mock list now accepts a server id like the real
implementation.
2012-12-08 14:03:13 -08:00
Dan Prince
a5c35dfa56 OpenStack: Drop unused server_format hash.
Updates the compute server request tests to drop an unused
hash.
2012-12-07 22:03:52 -05:00
Dan Prince
5cad89ddb6 Merge pull request from drbrain/openstack_mock_server_user_id
Improve OpenStack server creation mocks
2012-12-07 18:32:13 -08:00
Dan Prince
a1f13bb04f OpenStack server test updates for real mode.
Updates to the OpenStack server tests to get things running in *real*
test mode.

This patch also adds some useful helper functions which
are now used to:
 -get the flavor ref for testing
 -get the image ref for testing
 -get the resize flavor ref for testing (defaults to flavor + 1)
 -disable password testing (not all hypervisors support this in OS)
2012-12-07 16:45:01 -05:00
Eric Hodel
b430ec6a20 Added mock for Fog::Identity#get_user_by_name
OpenStack does not support filtering by name as in the real method so
the mock returns all users regardless of the name query parameter.  See:

http://docs.openstack.org/api/openstack-identity-service/2.0/content/GET_listUsers_v2.0_users_Admin_API_Service_Developer_Operations-d1e1356.html
2012-12-06 14:58:23 -08:00
Eric Hodel
398f706e7e OpenStack create_server mocks now match reality
Previously the mocks would return the same data as list_servers_detail.
OpenStack does not return all of this data so you must reload a server
after creation to get the necessary data when using fog for real.

Now the mock returns the same detail as the real call with the extra
detail stored in the mock data for retrieval by list_servers_detail.
2012-12-06 14:30:30 -08:00
Nelvin Driz
c054fcb841 [openstack|identity] Update User Role Membership Mocks
Signed-off-by: Nelvin Driz <nelvindriz@live.com>
2012-12-06 14:42:25 +08:00
Wesley Beary
b6b74566a0 Merge pull request from drbrain/openstack_ec2_credentials
Add OpenStack EC2 credential management
2012-12-05 16:21:09 -08:00
Eric Hodel
97d50bbeae Added OpenStack EC2 credential management models
Altered the paths for EC2 credential requests to remove an extra / in
the request URIs.

Altered Fog::Open::Identity::Real#request to retry only once when given
a 401 error response code.  The EC2 API returns 401 when attempting to
fetch nonexistent EC2 credentials instead of something sensible like
404, leading to an infinite loop.  Also, the "Bad username or password"
check was removed.  My version of OpenStack does not return this message
when a token is expired, but returns the same message as for a missing
EC2 credential.
2012-12-05 14:27:10 -08:00
Eric Hodel
8c76badfba Add OpenStack EC2 credentials requests.
This wraps API discovered from python-keystoneclient that allows CRUD
for EC2 credentials for an OpenStack service.  Unfortunately I haven't
been able to find documentation for this API.
2012-12-05 14:27:10 -08:00
Eric Hodel
64b08cbf12 Raise a NotFound exception for missing services
Previously a NoMethodError would be raised giving no information about
what was missing.  Now an appropriate exception with a useful message is
returned.
2012-12-05 14:20:46 -08:00
Eric Hodel
f15f54aff0 Added test for Fog::Openstack::authenticate_v2 2012-12-05 14:20:46 -08:00
Nelvin Driz
fbbe0f0447 [openstack|compute] Update Quota Mocks based on Folsom Stable
Basis:
https://github.com/openstack/nova/blob/stable/folsom/nova/quota.py#L34

Signed-off-by: Nelvin Driz <nelvindriz@live.com>
2012-12-03 15:38:54 +08:00
Dan Prince
db77300076 OpenStack: security group test fixes.
Update the OpenStack security group test to support the correct
format for create_security_group responses. This patch
removes the extra [] wrapping the response and makes it so the
real tests run once again.

Also updates the existing Mock for create_security_response so
it handles it properly as well.
2012-11-29 21:30:58 -05:00
Dan Prince
f80b21acf2 OpenStack: updates to quota tests.
Updates to the OpenStack quota tests to support the latest
changes in Folsom/Grizzly. With these changes I am able to run
the *real* tests again with the latest upstream OpenStack builds.

This change has no functional effect on Fog users for previous
releases of OpenStack (Folsom, etc,) but should allow us to
support the latest upstream codebase and run Fog *real* tests again.
2012-11-29 15:54:44 -05:00
Dan Prince
93086cee2a Merge pull request from dprince/openstack_limit_test_fixes
OpenStack: Remove volumes from limits tests.
2012-11-29 12:11:19 -08:00
Dan Prince
f8f22ea4e1 OpenStack: Remove volumes from limits tests.
OpenStack Grizzly no longer supports volumes. This removes
the volume settings from the OpenStack limits tests and Mock
.

This change has will has no effect on users of previous of
Fog for previous releases (Folsom, etc) but should allow
us to easily support the latest upstream codebase and run
Fog *real* tests.
2012-11-29 13:02:49 -05:00
Dan Prince
1bfc49fa71 OpenStack floating_ip (aka address) test fixes
Updates to the OpenStack address tests so that:

 * The tests cleanup after themselves when executed in Real mode.
   Previously running these tests in Real mode would leak servers
   and floating IPs.

 * DRY things up a bit.

 * Make use of the floating IP we create in subsequent tests. Previously
   the last floating IP in the full list was used. This could be
   problematic in some cases.

--

Also adds a missing Mock class for the release_address request so
that FOG_MOCK tests continue to pass.
2012-11-28 22:04:09 -05:00
Dan Prince
bae7186994 Sync with latest OpenStack flavors extensions.
Updates the OpenStack flavors model/request/and tests so
that they support the latest upstream flavor extensions in
Nova Folsom.

Also updated the Fog tests so they pass with both mocks and reals
(tested against OpenStack deployed on Fedora).
2012-11-27 13:50:05 -05:00
Nelvin Driz
a16a9fe12d [openstack|compute] Add get_limits request
Signed-off-by: Nelvin Driz <nelvindriz@live.com>
2012-11-26 22:42:59 +08:00
Eric Hodel
d8074357c6 Tested handling of Openstack server created and updated times 2012-10-22 17:58:40 -07:00