fog 0.3.17 → 0.3.18
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +5 -5
- data/README.rdoc +16 -7
- data/fog.gemspec +102 -27
- data/lib/fog.rb +3 -2
- data/lib/fog/aws/cdn.rb +2 -1
- data/lib/fog/aws/compute.rb +3 -2
- data/lib/fog/aws/iam.rb +8 -0
- data/lib/fog/aws/models/compute/flavors.rb +2 -1
- data/lib/fog/aws/models/compute/server.rb +3 -0
- data/lib/fog/aws/models/compute/volume.rb +9 -8
- data/lib/fog/aws/models/storage/file.rb +24 -14
- data/lib/fog/aws/models/storage/files.rb +4 -14
- data/lib/fog/aws/parsers/cdn/distribution.rb +16 -1
- data/lib/fog/aws/parsers/cdn/get_distribution_list.rb +13 -0
- data/lib/fog/aws/parsers/compute/describe_volumes.rb +2 -0
- data/lib/fog/aws/parsers/iam/create_group.rb +2 -2
- data/lib/fog/aws/parsers/iam/create_user.rb +26 -0
- data/lib/fog/aws/parsers/iam/list_group_policies.rb +28 -0
- data/lib/fog/aws/parsers/iam/list_groups.rb +1 -1
- data/lib/fog/aws/parsers/storage/complete_multipart_upload.rb +24 -0
- data/lib/fog/aws/parsers/storage/initiate_multipart_upload.rb +24 -0
- data/lib/fog/aws/parsers/storage/list_multipart_uploads.rb +56 -0
- data/lib/fog/aws/parsers/storage/list_parts.rb +40 -0
- data/lib/fog/aws/requests/cdn/get_distribution.rb +11 -1
- data/lib/fog/aws/requests/cdn/get_distribution_list.rb +9 -1
- data/lib/fog/aws/requests/cdn/post_distribution.rb +16 -5
- data/lib/fog/aws/requests/cdn/put_distribution_config.rb +102 -0
- data/lib/fog/aws/requests/compute/describe_volumes.rb +1 -0
- data/lib/fog/aws/requests/compute/run_instances.rb +1 -1
- data/lib/fog/aws/requests/iam/add_user_to_group.rb +42 -0
- data/lib/fog/aws/requests/iam/create_group.rb +7 -3
- data/lib/fog/aws/requests/iam/create_user.rb +47 -0
- data/lib/fog/aws/requests/iam/delete_group.rb +5 -1
- data/lib/fog/aws/requests/iam/delete_group_policy.rb +42 -0
- data/lib/fog/aws/requests/iam/delete_user.rb +40 -0
- data/lib/fog/aws/requests/iam/list_group_policies.rb +47 -0
- data/lib/fog/aws/requests/iam/list_groups.rb +9 -4
- data/lib/fog/aws/requests/iam/put_group_policy.rb +44 -0
- data/lib/fog/aws/requests/iam/remove_user_from_group.rb +42 -0
- data/lib/fog/aws/requests/simpledb/put_attributes.rb +2 -2
- data/lib/fog/aws/requests/storage/abort_multipart_upload.rb +38 -0
- data/lib/fog/aws/requests/storage/complete_multipart_upload.rb +60 -0
- data/lib/fog/aws/requests/storage/get_service.rb +1 -1
- data/lib/fog/aws/requests/storage/initiate_multipart_upload.rb +55 -0
- data/lib/fog/aws/requests/storage/list_multipart_uploads.rb +68 -0
- data/lib/fog/aws/requests/storage/list_parts.rb +67 -0
- data/lib/fog/aws/requests/storage/put_object.rb +12 -5
- data/lib/fog/aws/requests/storage/upload_part.rb +51 -0
- data/lib/fog/aws/storage.rb +12 -6
- data/lib/fog/brightbox.rb +7 -0
- data/lib/fog/brightbox/bin.rb +23 -0
- data/lib/fog/brightbox/compute.rb +134 -0
- data/lib/fog/brightbox/models/compute/account.rb +51 -0
- data/lib/fog/brightbox/models/compute/cloud_ip.rb +43 -0
- data/lib/fog/brightbox/models/compute/cloud_ips.rb +34 -0
- data/lib/fog/brightbox/models/compute/flavor.rb +33 -0
- data/lib/fog/brightbox/models/compute/flavors.rb +28 -0
- data/lib/fog/brightbox/models/compute/image.rb +52 -0
- data/lib/fog/brightbox/models/compute/images.rb +28 -0
- data/lib/fog/brightbox/models/compute/server.rb +94 -0
- data/lib/fog/brightbox/models/compute/servers.rb +29 -0
- data/lib/fog/brightbox/models/compute/user.rb +39 -0
- data/lib/fog/brightbox/models/compute/users.rb +29 -0
- data/lib/fog/brightbox/models/compute/zone.rb +21 -0
- data/lib/fog/brightbox/models/compute/zones.rb +29 -0
- data/lib/fog/brightbox/requests/compute/create_api_client.rb +27 -0
- data/lib/fog/brightbox/requests/compute/create_cloud_ip.rb +27 -0
- data/lib/fog/brightbox/requests/compute/create_image.rb +27 -0
- data/lib/fog/brightbox/requests/compute/create_server.rb +27 -0
- data/lib/fog/brightbox/requests/compute/destroy_api_client.rb +28 -0
- data/lib/fog/brightbox/requests/compute/destroy_cloud_ip.rb +28 -0
- data/lib/fog/brightbox/requests/compute/destroy_image.rb +28 -0
- data/lib/fog/brightbox/requests/compute/destroy_server.rb +28 -0
- data/lib/fog/brightbox/requests/compute/get_account.rb +27 -0
- data/lib/fog/brightbox/requests/compute/get_api_client.rb +28 -0
- data/lib/fog/brightbox/requests/compute/get_cloud_ip.rb +28 -0
- data/lib/fog/brightbox/requests/compute/get_image.rb +28 -0
- data/lib/fog/brightbox/requests/compute/get_interface.rb +28 -0
- data/lib/fog/brightbox/requests/compute/get_server.rb +28 -0
- data/lib/fog/brightbox/requests/compute/get_server_type.rb +28 -0
- data/lib/fog/brightbox/requests/compute/get_user.rb +28 -0
- data/lib/fog/brightbox/requests/compute/get_zone.rb +28 -0
- data/lib/fog/brightbox/requests/compute/list_api_clients.rb +27 -0
- data/lib/fog/brightbox/requests/compute/list_cloud_ips.rb +27 -0
- data/lib/fog/brightbox/requests/compute/list_images.rb +27 -0
- data/lib/fog/brightbox/requests/compute/list_server_types.rb +27 -0
- data/lib/fog/brightbox/requests/compute/list_servers.rb +27 -0
- data/lib/fog/brightbox/requests/compute/list_users.rb +27 -0
- data/lib/fog/brightbox/requests/compute/list_zones.rb +27 -0
- data/lib/fog/brightbox/requests/compute/map_cloud_ip.rb +28 -0
- data/lib/fog/brightbox/requests/compute/reset_ftp_password_account.rb +27 -0
- data/lib/fog/brightbox/requests/compute/resize_server.rb +27 -0
- data/lib/fog/brightbox/requests/compute/shutdown_server.rb +28 -0
- data/lib/fog/brightbox/requests/compute/snapshot_server.rb +28 -0
- data/lib/fog/brightbox/requests/compute/start_server.rb +28 -0
- data/lib/fog/brightbox/requests/compute/stop_server.rb +28 -0
- data/lib/fog/brightbox/requests/compute/unmap_cloud_ip.rb +28 -0
- data/lib/fog/brightbox/requests/compute/update_account.rb +28 -0
- data/lib/fog/brightbox/requests/compute/update_api_client.rb +29 -0
- data/lib/fog/brightbox/requests/compute/update_image.rb +29 -0
- data/lib/fog/brightbox/requests/compute/update_server.rb +29 -0
- data/lib/fog/brightbox/requests/compute/update_user.rb +29 -0
- data/lib/fog/core/attributes.rb +3 -3
- data/lib/fog/core/bin.rb +2 -0
- data/lib/fog/core/compute.rb +5 -2
- data/lib/fog/core/credentials.rb +2 -0
- data/lib/fog/core/service.rb +24 -12
- data/lib/fog/google/models/storage/file.rb +23 -14
- data/lib/fog/google/models/storage/files.rb +4 -14
- data/lib/fog/google/requests/storage/get_bucket.rb +0 -1
- data/lib/fog/google/requests/storage/put_object.rb +9 -2
- data/lib/fog/rackspace/models/storage/file.rb +3 -3
- data/lib/fog/rackspace/models/storage/files.rb +5 -13
- data/spec/aws/models/compute/server_spec.rb +0 -3
- data/spec/aws/requests/simpledb/get_attributes_spec.rb +11 -0
- data/spec/core/attributes_spec.rb +52 -0
- data/spec/vcloud/bin_spec.rb +1 -1
- data/spec/vcloud/vcloud_spec.rb +1 -1
- data/tests/aws/models/compute/flavors_tests.rb +5 -0
- data/tests/aws/models/compute/server_tests.rb +6 -0
- data/tests/aws/models/compute/servers_tests.rb +6 -0
- data/tests/aws/requests/storage/bucket_tests.rb +1 -1
- data/tests/aws/requests/storage/multipart_upload_tests.rb +135 -0
- data/tests/bluebox/models/compute/flavors_tests.rb +5 -0
- data/tests/bluebox/models/compute/server_tests.rb +5 -0
- data/tests/bluebox/models/compute/servers_tests.rb +6 -0
- data/tests/brightbox/helper.rb +0 -0
- data/tests/brightbox/models/compute/flavors_tests.rb +5 -0
- data/tests/brightbox/models/compute/server_tests.rb +6 -0
- data/tests/brightbox/models/compute/servers_tests.rb +6 -0
- data/tests/google/requests/storage/bucket_tests.rb +78 -0
- data/tests/google/requests/storage/object_tests.rb +81 -0
- data/tests/helper.rb +19 -4
- data/tests/helpers/collection_tests.rb +51 -0
- data/tests/helpers/compute/flavors_tests.rb +34 -0
- data/tests/helpers/compute/server_tests.rb +19 -0
- data/tests/helpers/compute/servers_tests.rb +11 -0
- data/tests/helpers/model_tests.rb +28 -0
- data/tests/helpers/storage/directories_tests.rb +4 -36
- data/tests/helpers/storage/directory_tests.rb +8 -22
- data/tests/helpers/storage/file_tests.rb +8 -25
- data/tests/helpers/storage/files_tests.rb +5 -39
- data/tests/local/models/storage/directories_tests.rb +1 -1
- data/tests/local/models/storage/directory_tests.rb +1 -1
- data/tests/local/models/storage/file_tests.rb +1 -1
- data/tests/local/models/storage/files_tests.rb +1 -1
- data/tests/rackspace/models/compute/flavors_tests.rb +5 -0
- data/tests/rackspace/models/compute/server_tests.rb +6 -0
- data/tests/rackspace/models/compute/servers_tests.rb +6 -0
- data/tests/rackspace/models/storage/directories_tests.rb +1 -1
- data/tests/rackspace/models/storage/directory_tests.rb +1 -1
- data/tests/rackspace/models/storage/file_tests.rb +1 -1
- data/tests/rackspace/models/storage/files_tests.rb +1 -1
- data/tests/slicehost/models/compute/flavors_tests.rb +5 -0
- data/tests/slicehost/models/compute/server_tests.rb +6 -0
- data/tests/slicehost/models/compute/servers_tests.rb +6 -0
- metadata +108 -31
- data/spec/aws/models/compute/flavors_spec.rb +0 -14
- data/spec/aws/models/compute/servers_spec.rb +0 -21
- data/spec/bluebox/models/compute/flavors_spec.rb +0 -17
- data/spec/bluebox/models/compute/server_spec.rb +0 -29
- data/spec/bluebox/models/compute/servers_spec.rb +0 -31
- data/spec/google/requests/storage/copy_object_spec.rb +0 -61
- data/spec/google/requests/storage/delete_bucket_spec.rb +0 -35
- data/spec/google/requests/storage/delete_object_spec.rb +0 -38
- data/spec/google/requests/storage/get_bucket_spec.rb +0 -110
- data/spec/google/requests/storage/get_object_spec.rb +0 -58
- data/spec/google/requests/storage/get_service_spec.rb +0 -32
- data/spec/google/requests/storage/head_object_spec.rb +0 -26
- data/spec/google/requests/storage/put_bucket_spec.rb +0 -21
- data/spec/google/requests/storage/put_object_spec.rb +0 -43
- data/spec/rackspace/models/compute/flavors_spec.rb +0 -18
- data/spec/rackspace/models/compute/server_spec.rb +0 -55
- data/spec/rackspace/models/compute/servers_spec.rb +0 -22
- data/spec/shared_examples/flavors_examples.rb +0 -16
- data/spec/shared_examples/server_examples.rb +0 -43
- data/spec/shared_examples/servers_examples.rb +0 -37
- data/spec/slicehost/models/compute/flavors_spec.rb +0 -18
- data/spec/slicehost/models/compute/server_spec.rb +0 -55
- data/spec/slicehost/models/compute/servers_spec.rb +0 -26
@@ -1,26 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Storage.head_object' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
Google[:storage].put_bucket('fogheadobject')
|
8
|
-
Google[:storage].put_object('fogheadobject', 'fog_head_object', lorem_file)
|
9
|
-
end
|
10
|
-
|
11
|
-
after(:each) do
|
12
|
-
Google[:storage].delete_object('fogheadobject', 'fog_head_object')
|
13
|
-
Google[:storage].delete_bucket('fogheadobject')
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'should return proper attributes' do
|
17
|
-
actual = Google[:storage].head_object('fogheadobject', 'fog_head_object')
|
18
|
-
actual.status.should == 200
|
19
|
-
data = lorem_file.read
|
20
|
-
actual.headers['Content-Length'].should == data.length.to_s
|
21
|
-
actual.headers['ETag'].should be_a(String)
|
22
|
-
actual.headers['Last-Modified'].should be_a(String)
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Storage.put_bucket' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
@response = Google[:storage].put_bucket('fogputbucket')
|
8
|
-
end
|
9
|
-
|
10
|
-
after(:each) do
|
11
|
-
Google[:storage].delete_bucket('fogputbucket')
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should raise an error if the bucket already exists' do
|
15
|
-
lambda {
|
16
|
-
Google[:storage].put_bucket('fogputbucket')
|
17
|
-
}.should raise_error(Excon::Errors::Conflict)
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Storage.put_object' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
Google[:storage].put_bucket('fogputobject')
|
8
|
-
@response = Google[:storage].put_object('fogputobject', 'fog_put_object', lorem_file)
|
9
|
-
end
|
10
|
-
|
11
|
-
after(:each) do
|
12
|
-
Google[:storage].delete_object('fogputobject', 'fog_put_object')
|
13
|
-
Google[:storage].delete_bucket('fogputobject')
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'should return proper attributes' do
|
17
|
-
@response.status.should == 200
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'should not raise an error if the object already exists' do
|
21
|
-
actual = Google[:storage].put_object('fogputobject', 'fog_put_object', lorem_file)
|
22
|
-
actual.status.should == 200
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
describe 'failure' do
|
27
|
-
|
28
|
-
it 'should raise a NotFound error if the bucket does not exist' do
|
29
|
-
lambda {
|
30
|
-
Google[:storage].put_object('fognotabucket', 'fog_put_object', lorem_file)
|
31
|
-
}.should raise_error(Excon::Errors::NotFound)
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'should not raise an error if the object already exists' do
|
35
|
-
Google[:storage].put_bucket('fogputobject')
|
36
|
-
Google[:storage].put_object('fogputobject', 'fog_put_object', lorem_file)
|
37
|
-
Google[:storage].put_object('fogputobject', 'fog_put_object', lorem_file)
|
38
|
-
Google[:storage].delete_object('fogputobject', 'fog_put_object')
|
39
|
-
Google[:storage].delete_bucket('fogputobject')
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
43
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
require File.dirname(__FILE__) + '/../../../shared_examples/flavors_examples'
|
3
|
-
|
4
|
-
describe 'Fog::Rackspace::Compute::Flavors' do
|
5
|
-
|
6
|
-
if Fog.mocking?
|
7
|
-
it "needs to have mocks implemented"
|
8
|
-
else
|
9
|
-
it_should_behave_like "Flavors"
|
10
|
-
end
|
11
|
-
|
12
|
-
subject { @flavor = @flavors.all.first }
|
13
|
-
|
14
|
-
before(:each) do
|
15
|
-
@flavors = Rackspace[:compute].flavors
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
require File.dirname(__FILE__) + '/../../../shared_examples/server_examples'
|
3
|
-
|
4
|
-
describe 'Fog::Rackspace::Compute::Server' do
|
5
|
-
|
6
|
-
if Fog.mocking?
|
7
|
-
it "needs to have mocks implemented"
|
8
|
-
else
|
9
|
-
it_should_behave_like "Server"
|
10
|
-
end
|
11
|
-
|
12
|
-
# flavor 1 = 256, image 49 = Ubuntu 10.04 LTS (lucid)
|
13
|
-
subject { @server = @servers.new(:flavor_id => 1, :image_id => 49, :name => "fog_#{Time.now.to_i}") }
|
14
|
-
|
15
|
-
before(:each) do
|
16
|
-
@servers = Rackspace[:compute].servers
|
17
|
-
end
|
18
|
-
|
19
|
-
after(:each) do
|
20
|
-
if @server && !@server.new_record?
|
21
|
-
@server.wait_for { ready? }
|
22
|
-
@server.destroy.should be_true
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe "#initialize" do
|
27
|
-
|
28
|
-
it "should remap attributes from parser" do
|
29
|
-
server = @servers.new({
|
30
|
-
'addresses' => 'addresses',
|
31
|
-
'adminPass' => 'password',
|
32
|
-
'flavorId' => 'flavor_id',
|
33
|
-
'hostId' => 'host_id',
|
34
|
-
'imageId' => 'image_id',
|
35
|
-
'metadata' => 'metadata',
|
36
|
-
'name' => 'name',
|
37
|
-
'personality' => 'personality',
|
38
|
-
'progress' => 'progress',
|
39
|
-
'status' => 'status'
|
40
|
-
})
|
41
|
-
server.addresses.should == 'addresses'
|
42
|
-
server.password.should == 'password'
|
43
|
-
server.flavor_id.should == 'flavor_id'
|
44
|
-
server.host_id.should == 'host_id'
|
45
|
-
server.image_id.should == 'image_id'
|
46
|
-
server.metadata.should == 'metadata'
|
47
|
-
server.name.should == 'name'
|
48
|
-
server.personality.should == 'personality'
|
49
|
-
server.progress.should == 'progress'
|
50
|
-
server.status.should == 'status'
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
require File.dirname(__FILE__) + '/../../../shared_examples/servers_examples'
|
3
|
-
|
4
|
-
describe 'Fog::Rackspace::Compute::Servers' do
|
5
|
-
|
6
|
-
it_should_behave_like "Servers"
|
7
|
-
|
8
|
-
# flavor 1 = 256, image 49 = Ubuntu 10.04 LTS (lucid)
|
9
|
-
subject { @server = @servers.new(:flavor_id => 1, :image_id => 49, :name => "fog_#{Time.now.to_i}") }
|
10
|
-
|
11
|
-
before(:each) do
|
12
|
-
@servers = Rackspace[:compute].servers
|
13
|
-
end
|
14
|
-
|
15
|
-
after(:each) do
|
16
|
-
if @server && !@server.new_record?
|
17
|
-
@server.wait_for { ready? }
|
18
|
-
@server.destroy.should be_true
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
shared_examples_for "Flavors" do
|
2
|
-
|
3
|
-
describe "#get" do
|
4
|
-
|
5
|
-
it "should return a matching flavor if one exists" do
|
6
|
-
get = @flavors.get(subject.id)
|
7
|
-
subject.attributes.should == get.attributes
|
8
|
-
end
|
9
|
-
|
10
|
-
it "should return nil if no matching server exists" do
|
11
|
-
@flavors.get('0').should be_nil
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
shared_examples_for "Server" do
|
2
|
-
|
3
|
-
describe "#reboot" do
|
4
|
-
|
5
|
-
it "should succeed" do
|
6
|
-
subject.save
|
7
|
-
subject.wait_for { ready? }
|
8
|
-
subject.reboot.should be_true
|
9
|
-
end
|
10
|
-
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "#reload" do
|
14
|
-
|
15
|
-
it "should reset attributes to remote state" do
|
16
|
-
subject.save
|
17
|
-
subject.wait_for { ready? }
|
18
|
-
@reloaded = subject.reload
|
19
|
-
subject.attributes.should == @reloaded.attributes
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
describe "#save" do
|
25
|
-
|
26
|
-
it "should return true when it succeeds" do
|
27
|
-
subject.save.should be_true
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should not exist remotely before save" do
|
31
|
-
@servers.get(subject.id).should be_nil
|
32
|
-
end
|
33
|
-
|
34
|
-
it "should exist remotely after save" do
|
35
|
-
subject.save
|
36
|
-
subject.wait_for { ready? }
|
37
|
-
@servers.get(subject.id).should_not be_nil
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
43
|
-
|
@@ -1,37 +0,0 @@
|
|
1
|
-
shared_examples_for "Servers" do
|
2
|
-
|
3
|
-
describe "#all" do
|
4
|
-
|
5
|
-
it "should include persisted servers" do
|
6
|
-
subject.save
|
7
|
-
@servers.all.map {|server| server.id}.should include(subject.id)
|
8
|
-
end
|
9
|
-
|
10
|
-
end
|
11
|
-
|
12
|
-
describe "#get" do
|
13
|
-
|
14
|
-
it "should return a matching server if one exists" do
|
15
|
-
subject.save
|
16
|
-
get = @servers.get(subject.id)
|
17
|
-
subject.attributes.should == get.attributes
|
18
|
-
end
|
19
|
-
|
20
|
-
it "should return nil if no matching server exists" do
|
21
|
-
@servers.get('i-00000000').should be_nil
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
|
26
|
-
describe "#reload" do
|
27
|
-
|
28
|
-
it "should reset attributes to remote state" do
|
29
|
-
subject.save
|
30
|
-
servers = @servers.all
|
31
|
-
reloaded = servers.reload
|
32
|
-
servers.attributes.should == reloaded.attributes
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
require File.dirname(__FILE__) + '/../../../shared_examples/flavors_examples'
|
3
|
-
|
4
|
-
describe 'Fog::Slicehost::Compute::Flavors' do
|
5
|
-
|
6
|
-
if Fog.mocking?
|
7
|
-
it "needs to have mocks implemented"
|
8
|
-
else
|
9
|
-
it_should_behave_like "Flavors"
|
10
|
-
end
|
11
|
-
|
12
|
-
subject { @flavor = @flavors.all.first }
|
13
|
-
|
14
|
-
before(:each) do
|
15
|
-
@flavors = Slicehost[:compute].flavors
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
require File.dirname(__FILE__) + '/../../../shared_examples/server_examples'
|
3
|
-
|
4
|
-
describe 'Fog::Slicehost::Compute::Server' do
|
5
|
-
|
6
|
-
if Fog.mocking?
|
7
|
-
it "needs to have mocks implemented"
|
8
|
-
else
|
9
|
-
it_should_behave_like "Server"
|
10
|
-
end
|
11
|
-
|
12
|
-
# flavor 1 = 256, image 49 = Ubuntu 10.04 LTS (lucid)
|
13
|
-
subject { @server = @servers.new(:flavor_id => 1, :image_id => 49, :name => Time.now.to_i.to_s) }
|
14
|
-
|
15
|
-
before(:each) do
|
16
|
-
@servers = Slicehost[:compute].servers
|
17
|
-
end
|
18
|
-
|
19
|
-
after(:each) do
|
20
|
-
if @server && !@server.new_record?
|
21
|
-
@server.wait_for { ready? }
|
22
|
-
@server.destroy.should be_true
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe "#initialize" do
|
27
|
-
|
28
|
-
it "should remap attributes from parser" do
|
29
|
-
server = @servers.new({
|
30
|
-
'addresses' => 'addresses',
|
31
|
-
'backup-id' => 'backup_id',
|
32
|
-
'bw-in' => 'bw_in',
|
33
|
-
'bw-out' => 'bw_out',
|
34
|
-
'flavor-id' => 'flavor_id',
|
35
|
-
'image-id' => 'image_id',
|
36
|
-
'name' => 'name',
|
37
|
-
'root-password' => 'password',
|
38
|
-
'progress' => 'progress',
|
39
|
-
'status' => 'status'
|
40
|
-
})
|
41
|
-
server.addresses.should == 'addresses'
|
42
|
-
server.backup_id.should == 'backup_id'
|
43
|
-
server.bandwidth_in.should == 'bw_in'
|
44
|
-
server.bandwidth_out.should == 'bw_out'
|
45
|
-
server.flavor_id.should == 'flavor_id'
|
46
|
-
server.image_id.should == 'image_id'
|
47
|
-
server.name.should == 'name'
|
48
|
-
server.password.should == 'password'
|
49
|
-
server.progress.should == 'progress'
|
50
|
-
server.status.should == 'status'
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
require File.dirname(__FILE__) + '/../../../shared_examples/servers_examples'
|
3
|
-
|
4
|
-
describe 'Fog::Slicehost::Compute::Servers' do
|
5
|
-
|
6
|
-
if Fog.mocking?
|
7
|
-
it "needs to have mocks implemented"
|
8
|
-
else
|
9
|
-
it_should_behave_like "Servers"
|
10
|
-
end
|
11
|
-
|
12
|
-
# flavor 1 = 256, image 49 = Ubuntu 10.04 LTS (lucid)
|
13
|
-
subject { @server = @servers.new(:flavor_id => 1, :image_id => 49, :name => Time.now.to_i.to_s) }
|
14
|
-
|
15
|
-
before(:each) do
|
16
|
-
@servers = Slicehost[:compute].servers
|
17
|
-
end
|
18
|
-
|
19
|
-
after(:each) do
|
20
|
-
if @server && !@server.new_record?
|
21
|
-
@server.wait_for { ready? }
|
22
|
-
@server.destroy.should be_true
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|