fog 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/Rakefile +43 -0
- data/changelog.txt +39 -0
- data/docs/_config.yml +39 -0
- data/docs/_layouts/default.html +96 -0
- data/docs/_posts/2011-01-01-cdn.markdown +82 -0
- data/docs/_posts/2011-01-01-contributing.markdown +228 -0
- data/docs/_posts/2011-01-01-dns.markdown +79 -0
- data/docs/_posts/2011-01-01-press.markdown +32 -0
- data/docs/_posts/2011-01-01-start.markdown +21 -0
- data/docs/_posts/2011-01-01-storage.markdown +145 -0
- data/docs/_posts/2011-01-01-structure.markdown +78 -0
- data/docs/_posts/2011-01-01-users.markdown +33 -0
- data/docs/index.markdown +94 -0
- data/docs/public/crossdomain.xml +25 -0
- data/docs/public/css/fog.css +129 -0
- data/docs/public/css/handheld.css +8 -0
- data/docs/public/css/style.css +129 -0
- data/docs/public/images/.gitignore +3 -0
- data/docs/public/js/libs/dd_belatedpng.js +13 -0
- data/docs/public/js/libs/jquery-1.4.2.js +6240 -0
- data/docs/public/js/libs/jquery-1.4.2.min.js +154 -0
- data/docs/public/js/libs/modernizr-1.6.min.js +30 -0
- data/docs/public/js/mylibs/.gitignore +3 -0
- data/docs/public/js/plugins.js +34 -0
- data/docs/public/js/profiling/config.js +59 -0
- data/docs/public/js/profiling/yahoo-profiling.css +7 -0
- data/docs/public/js/profiling/yahoo-profiling.min.js +39 -0
- data/docs/public/js/script.js +26 -0
- data/docs/public/robots.txt +5 -0
- data/fog.gemspec +6 -5
- data/lib/fog.rb +1 -1
- data/lib/fog/aws/cloud_formation.rb +1 -1
- data/lib/fog/compute/aws.rb +24 -0
- data/lib/fog/compute/models/aws/key_pair.rb +19 -1
- data/lib/fog/compute/models/aws/server.rb +6 -12
- data/lib/fog/compute/models/rackspace/server.rb +7 -7
- data/lib/fog/compute/requests/aws/attach_volume.rb +4 -0
- data/lib/fog/compute/requests/aws/create_security_group.rb +3 -3
- data/lib/fog/compute/requests/aws/create_tags.rb +2 -0
- data/lib/fog/compute/requests/aws/create_volume.rb +4 -0
- data/lib/fog/compute/requests/aws/delete_tags.rb +43 -0
- data/lib/fog/compute/requests/aws/describe_instances.rb +3 -7
- data/lib/fog/compute/requests/aws/describe_snapshots.rb +4 -6
- data/lib/fog/compute/requests/aws/describe_volumes.rb +2 -6
- data/lib/fog/core.rb +1 -0
- data/lib/fog/core/connection.rb +1 -1
- data/lib/fog/core/credentials.rb +5 -1
- data/lib/fog/core/parser.rb +1 -2
- data/lib/fog/core/ssh.rb +2 -3
- data/lib/fog/dns/models/aws/record.rb +1 -1
- data/lib/fog/dns/models/bluebox/zone.rb +1 -0
- data/lib/fog/storage/models/rackspace/directory.rb +8 -2
- data/lib/fog/storage/rackspace.rb +3 -1
- data/lib/fog/storage/requests/rackspace/delete_container.rb +1 -1
- data/lib/fog/storage/requests/rackspace/delete_object.rb +1 -1
- data/lib/fog/storage/requests/rackspace/get_container.rb +1 -1
- data/lib/fog/storage/requests/rackspace/get_object.rb +1 -1
- data/lib/fog/storage/requests/rackspace/head_container.rb +1 -1
- data/lib/fog/storage/requests/rackspace/head_object.rb +2 -2
- data/lib/fog/storage/requests/rackspace/put_container.rb +1 -1
- data/lib/fog/storage/requests/rackspace/put_object.rb +1 -1
- data/spec/spec_helper.rb +0 -4
- data/tests/aws/requests/cloud_formation/stack_tests.rb +16 -5
- data/tests/aws/requests/rds/instance_tests.rb +4 -2
- data/tests/compute/models/aws/address_tests.rb +16 -0
- data/tests/compute/models/aws/addresses_tests.rb +5 -0
- data/tests/compute/models/aws/key_pair_tests.rb +27 -0
- data/tests/compute/models/aws/key_pairs_tests.rb +5 -0
- data/tests/compute/models/aws/security_group_tests.rb +5 -0
- data/tests/compute/models/aws/security_groups.rb +5 -0
- data/tests/compute/models/aws/server_tests.rb +39 -0
- data/tests/compute/models/aws/snapshot_tests.rb +10 -0
- data/tests/compute/models/aws/snapshots_tests.rb +10 -0
- data/tests/compute/models/aws/volume_tests.rb +26 -0
- data/tests/compute/models/aws/volumes_tests.rb +5 -0
- data/tests/core/credential_tests.rb +36 -0
- data/tests/storage/requests/aws/object_tests.rb +1 -1
- data/tests/storage/requests/google/object_tests.rb +1 -1
- data/tests/storage/requests/rackspace/object_tests.rb +8 -0
- metadata +118 -75
- data/spec/aws/models/compute/address_spec.rb +0 -103
- data/spec/aws/models/compute/addresses_spec.rb +0 -70
- data/spec/aws/models/compute/key_pair_spec.rb +0 -86
- data/spec/aws/models/compute/key_pairs_spec.rb +0 -71
- data/spec/aws/models/compute/security_group_spec.rb +0 -88
- data/spec/aws/models/compute/security_groups_spec.rb +0 -71
- data/spec/aws/models/compute/server_spec.rb +0 -105
- data/spec/aws/models/compute/snapshot_spec.rb +0 -79
- data/spec/aws/models/compute/snapshots_spec.rb +0 -85
- data/spec/aws/models/compute/volume_spec.rb +0 -174
- data/spec/aws/models/compute/volumes_spec.rb +0 -71
- data/tests/compute/models/aws/server_monitor_tests.rb +0 -47
@@ -1,103 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'Fog::AWS::Compute::Address' do
|
4
|
-
|
5
|
-
describe "#initialize" do
|
6
|
-
|
7
|
-
it "should remap attributes from parser" do
|
8
|
-
address = AWS[:compute].addresses.new(
|
9
|
-
'instanceId' => 'i-00000000',
|
10
|
-
'publicIp' => '0.0.0.0'
|
11
|
-
)
|
12
|
-
address.server_id.should == 'i-00000000'
|
13
|
-
address.public_ip.should == '0.0.0.0'
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
describe "#addresses" do
|
19
|
-
|
20
|
-
it "should return a Fog::AWS::Compute::Addresses" do
|
21
|
-
AWS[:compute].addresses.new.collection.should be_a(Fog::AWS::Compute::Addresses)
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should be the addresses the address is related to" do
|
25
|
-
addresses = AWS[:compute].addresses
|
26
|
-
addresses.new.collection.should == addresses
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
describe "#destroy" do
|
32
|
-
|
33
|
-
it "should return true if the address is deleted" do
|
34
|
-
address = AWS[:compute].addresses.create
|
35
|
-
address.destroy.should be_true
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "#server=" do
|
41
|
-
before(:each) do
|
42
|
-
@address = AWS[:compute].addresses.new
|
43
|
-
@server = AWS[:compute].servers.create(:image_id => GENTOO_AMI)
|
44
|
-
end
|
45
|
-
|
46
|
-
after(:each) do
|
47
|
-
@address.destroy
|
48
|
-
@server.destroy
|
49
|
-
end
|
50
|
-
|
51
|
-
it "should associate with server to an already saved address" do
|
52
|
-
@address.save.should be_true
|
53
|
-
@server.wait_for { state == 'running' }
|
54
|
-
@address.server = @server
|
55
|
-
@address.server_id.should == @server.id
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
describe "#reload" do
|
60
|
-
|
61
|
-
before(:each) do
|
62
|
-
@address = AWS[:compute].addresses.create
|
63
|
-
@reloaded = @address.reload
|
64
|
-
end
|
65
|
-
|
66
|
-
after(:each) do
|
67
|
-
@address.destroy
|
68
|
-
end
|
69
|
-
|
70
|
-
it "should return a Fog::AWS::Compute::Address" do
|
71
|
-
@reloaded.should be_a(Fog::AWS::Compute::Address)
|
72
|
-
end
|
73
|
-
|
74
|
-
it "should reset attributes to remote state" do
|
75
|
-
@address.attributes.should == @reloaded.attributes
|
76
|
-
end
|
77
|
-
|
78
|
-
end
|
79
|
-
|
80
|
-
describe "#save" do
|
81
|
-
|
82
|
-
before(:each) do
|
83
|
-
@address = AWS[:compute].addresses.new
|
84
|
-
end
|
85
|
-
|
86
|
-
it "should return true when it succeeds" do
|
87
|
-
@address.save.should be_true
|
88
|
-
@address.destroy
|
89
|
-
end
|
90
|
-
|
91
|
-
it "should not exist in addresses before save" do
|
92
|
-
@address.collection.get(@address.public_ip).should be_nil
|
93
|
-
end
|
94
|
-
|
95
|
-
it "should exist in buckets after save" do
|
96
|
-
@address.save
|
97
|
-
@address.collection.get(@address.public_ip).should_not be_nil
|
98
|
-
@address.destroy
|
99
|
-
end
|
100
|
-
|
101
|
-
end
|
102
|
-
|
103
|
-
end
|
@@ -1,70 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'Fog::AWS::Compute::Addresses' do
|
4
|
-
|
5
|
-
describe "#all" do
|
6
|
-
|
7
|
-
it "should return a Fog::AWS::Compute::Addresses" do
|
8
|
-
AWS[:compute].addresses.all.should be_a(Fog::AWS::Compute::Addresses)
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should include persisted addresses" do
|
12
|
-
address = AWS[:compute].addresses.create
|
13
|
-
AWS[:compute].addresses.get(address.public_ip).should_not be_nil
|
14
|
-
address.destroy
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
describe "#create" do
|
20
|
-
|
21
|
-
before(:each) do
|
22
|
-
@address = AWS[:compute].addresses.create
|
23
|
-
end
|
24
|
-
|
25
|
-
after(:each) do
|
26
|
-
@address.destroy
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should return a Fog::AWS::Compute::Address" do
|
30
|
-
@address.should be_a(Fog::AWS::Compute::Address)
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should exist on ec2" do
|
34
|
-
AWS[:compute].addresses.get(@address.public_ip).should_not be_nil
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
describe "#get" do
|
40
|
-
|
41
|
-
it "should return a Fog::AWS::Compute::Address if a matching address exists" do
|
42
|
-
address = AWS[:compute].addresses.create
|
43
|
-
get = AWS[:compute].addresses.get(address.public_ip)
|
44
|
-
address.attributes.should == get.attributes
|
45
|
-
address.destroy
|
46
|
-
end
|
47
|
-
|
48
|
-
it "should return nil if no matching address exists" do
|
49
|
-
AWS[:compute].addresses.get('0.0.0.0').should be_nil
|
50
|
-
end
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
describe "#new" do
|
55
|
-
|
56
|
-
it "should return a Fog::AWS::Compute::Address" do
|
57
|
-
AWS[:compute].addresses.new.should be_a(Fog::AWS::Compute::Address)
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
61
|
-
|
62
|
-
describe "#reload" do
|
63
|
-
|
64
|
-
it "should return a Fog::AWS::Compute::Addresses" do
|
65
|
-
AWS[:compute].addresses.all.reload.should be_a(Fog::AWS::Compute::Addresses)
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
69
|
-
|
70
|
-
end
|
@@ -1,86 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'Fog::AWS::Compute::KeyPair' do
|
4
|
-
|
5
|
-
describe "#initialize" do
|
6
|
-
|
7
|
-
it "should remap attributes from parser" do
|
8
|
-
key_pair = AWS[:compute].key_pairs.new(
|
9
|
-
'keyFingerprint' => 'fingerprint',
|
10
|
-
'keyMaterial' => 'material',
|
11
|
-
'keyName' => 'name'
|
12
|
-
)
|
13
|
-
key_pair.fingerprint.should == 'fingerprint'
|
14
|
-
key_pair.private_key.should == 'material'
|
15
|
-
key_pair.name.should == 'name'
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
describe "#collection" do
|
21
|
-
|
22
|
-
it "should return a Fog::AWS::Compute::KeyPairs" do
|
23
|
-
AWS[:compute].key_pairs.new.collection.should be_a(Fog::AWS::Compute::KeyPairs)
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should be the key_pairs the keypair is related to" do
|
27
|
-
key_pairs = AWS[:compute].key_pairs
|
28
|
-
key_pairs.new.collection.should == key_pairs
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
describe "#destroy" do
|
34
|
-
|
35
|
-
it "should return true if the key_pair is deleted" do
|
36
|
-
address = AWS[:compute].key_pairs.create(:name => 'keyname')
|
37
|
-
address.destroy.should be_true
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
describe "#reload" do
|
43
|
-
|
44
|
-
before(:each) do
|
45
|
-
@key_pair = AWS[:compute].key_pairs.create(:name => 'keyname')
|
46
|
-
@reloaded = @key_pair.reload
|
47
|
-
end
|
48
|
-
|
49
|
-
after(:each) do
|
50
|
-
@key_pair.destroy
|
51
|
-
end
|
52
|
-
|
53
|
-
it "should return a Fog::AWS::Compute::KeyPair" do
|
54
|
-
@reloaded.should be_a(Fog::AWS::Compute::KeyPair)
|
55
|
-
end
|
56
|
-
|
57
|
-
it "should reset attributes to remote state" do
|
58
|
-
@key_pair.attributes.should == @reloaded.attributes
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|
62
|
-
|
63
|
-
describe "#save" do
|
64
|
-
|
65
|
-
before(:each) do
|
66
|
-
@key_pair = AWS[:compute].key_pairs.new(:name => 'keyname')
|
67
|
-
end
|
68
|
-
|
69
|
-
it "should return true when it succeeds" do
|
70
|
-
@key_pair.save.should be_true
|
71
|
-
@key_pair.destroy
|
72
|
-
end
|
73
|
-
|
74
|
-
it "should not exist in key_pairs before save" do
|
75
|
-
AWS[:compute].key_pairs.get(@key_pair.name).should be_nil
|
76
|
-
end
|
77
|
-
|
78
|
-
it "should exist in buckets after save" do
|
79
|
-
@key_pair.save
|
80
|
-
AWS[:compute].key_pairs.get(@key_pair.name).should_not be_nil
|
81
|
-
@key_pair.destroy
|
82
|
-
end
|
83
|
-
|
84
|
-
end
|
85
|
-
|
86
|
-
end
|
@@ -1,71 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'Fog::AWS::Compute::KeyPairs' do
|
4
|
-
|
5
|
-
describe "#all" do
|
6
|
-
|
7
|
-
it "should return a Fog::AWS::Compute::KeyPairs" do
|
8
|
-
AWS[:compute].key_pairs.all.should be_a(Fog::AWS::Compute::KeyPairs)
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should include persisted key_pairs" do
|
12
|
-
key_pair = AWS[:compute].key_pairs.create(:name => 'keyname')
|
13
|
-
AWS[:compute].key_pairs.get(key_pair.name).should_not be_nil
|
14
|
-
key_pair.destroy
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
describe "#create" do
|
20
|
-
|
21
|
-
before(:each) do
|
22
|
-
@key_pair = AWS[:compute].key_pairs.create(:name => 'keyname')
|
23
|
-
end
|
24
|
-
|
25
|
-
after(:each) do
|
26
|
-
@key_pair.destroy
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should return a Fog::AWS::Compute::KeyPair" do
|
30
|
-
@key_pair.should be_a(Fog::AWS::Compute::KeyPair)
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should exist on ec2" do
|
34
|
-
AWS[:compute].key_pairs.get(@key_pair.name).should_not be_nil
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
describe "#get" do
|
40
|
-
|
41
|
-
it "should return a Fog::AWS::Compute::KeyPair if a matching key_pair exists" do
|
42
|
-
key_pair = AWS[:compute].key_pairs.create(:name => 'keyname')
|
43
|
-
get = AWS[:compute].key_pairs.get(key_pair.name)
|
44
|
-
key_pair.attributes[:fingerprint].should == get.attributes[:fingerprint]
|
45
|
-
key_pair.attributes[:name].should == get.attributes[:name]
|
46
|
-
key_pair.destroy
|
47
|
-
end
|
48
|
-
|
49
|
-
it "should return nil if no matching key_pair exists" do
|
50
|
-
AWS[:compute].key_pairs.get('notakeyname').should be_nil
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
describe "#new" do
|
56
|
-
|
57
|
-
it "should return a Fog::AWS::Compute::KeyPair" do
|
58
|
-
AWS[:compute].key_pairs.new(:name => 'keyname').should be_a(Fog::AWS::Compute::KeyPair)
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|
62
|
-
|
63
|
-
describe "#reload" do
|
64
|
-
|
65
|
-
it "should return a Fog::AWS::Compute::KeyPairs" do
|
66
|
-
AWS[:compute].key_pairs.all.reload.should be_a(Fog::AWS::Compute::KeyPairs)
|
67
|
-
end
|
68
|
-
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|
@@ -1,88 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'Fog::AWS::Compute::SecurityGroup' do
|
4
|
-
|
5
|
-
describe "#initialize" do
|
6
|
-
|
7
|
-
it "should remap attributes from parser" do
|
8
|
-
security_group = AWS[:compute].security_groups.new(
|
9
|
-
'groupDescription' => 'description',
|
10
|
-
'groupName' => 'name',
|
11
|
-
'ipPermissions' => 'permissions',
|
12
|
-
'ownerId' => 'owner'
|
13
|
-
)
|
14
|
-
security_group.description.should == 'description'
|
15
|
-
security_group.name.should == 'name'
|
16
|
-
security_group.ip_permissions.should == 'permissions'
|
17
|
-
security_group.owner_id.should == 'owner'
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
describe "#collection" do
|
23
|
-
|
24
|
-
it "should return a Fog::AWS::Compute::SecurityGroups" do
|
25
|
-
AWS[:compute].security_groups.new.collection.should be_a(Fog::AWS::Compute::SecurityGroups)
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should be the security_groups the keypair is related to" do
|
29
|
-
security_groups = AWS[:compute].security_groups
|
30
|
-
security_groups.new.collection.should == security_groups
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
describe "#destroy" do
|
36
|
-
|
37
|
-
it "should return true if the security_group is deleted" do
|
38
|
-
address = AWS[:compute].security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
39
|
-
address.destroy.should be_true
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
43
|
-
|
44
|
-
describe "#reload" do
|
45
|
-
|
46
|
-
before(:each) do
|
47
|
-
@security_group = AWS[:compute].security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
48
|
-
@reloaded = @security_group.reload
|
49
|
-
end
|
50
|
-
|
51
|
-
after(:each) do
|
52
|
-
@security_group.destroy
|
53
|
-
end
|
54
|
-
|
55
|
-
it "should return a Fog::AWS::Compute::SecurityGroup" do
|
56
|
-
@reloaded.should be_a(Fog::AWS::Compute::SecurityGroup)
|
57
|
-
end
|
58
|
-
|
59
|
-
it "should reset attributes to remote state" do
|
60
|
-
@security_group.attributes.should == @reloaded.attributes
|
61
|
-
end
|
62
|
-
|
63
|
-
end
|
64
|
-
|
65
|
-
describe "#save" do
|
66
|
-
|
67
|
-
before(:each) do
|
68
|
-
@security_group = AWS[:compute].security_groups.new(:description => 'groupdescription', :name => 'keyname')
|
69
|
-
end
|
70
|
-
|
71
|
-
it "should return true when it succeeds" do
|
72
|
-
@security_group.save.should be_true
|
73
|
-
@security_group.destroy
|
74
|
-
end
|
75
|
-
|
76
|
-
it "should not exist in security_groups before save" do
|
77
|
-
AWS[:compute].security_groups.get(@security_group.name).should be_nil
|
78
|
-
end
|
79
|
-
|
80
|
-
it "should exist in buckets after save" do
|
81
|
-
@security_group.save
|
82
|
-
AWS[:compute].security_groups.get(@security_group.name).should_not be_nil
|
83
|
-
@security_group.destroy
|
84
|
-
end
|
85
|
-
|
86
|
-
end
|
87
|
-
|
88
|
-
end
|
@@ -1,71 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'Fog::AWS::Compute::SecurityGroups' do
|
4
|
-
|
5
|
-
describe "#all" do
|
6
|
-
|
7
|
-
it "should return a Fog::AWS::Compute::SecurityGroups" do
|
8
|
-
AWS[:compute].security_groups.all.should be_a(Fog::AWS::Compute::SecurityGroups)
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should include persisted security_groups" do
|
12
|
-
security_group = AWS[:compute].security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
13
|
-
AWS[:compute].security_groups.get(security_group.name).should_not be_nil
|
14
|
-
security_group.destroy
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
describe "#create" do
|
20
|
-
|
21
|
-
before(:each) do
|
22
|
-
@security_group = AWS[:compute].security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
23
|
-
end
|
24
|
-
|
25
|
-
after(:each) do
|
26
|
-
@security_group.destroy
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should return a Fog::AWS::Compute::SecurityGroup" do
|
30
|
-
@security_group.should be_a(Fog::AWS::Compute::SecurityGroup)
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should exist on ec2" do
|
34
|
-
AWS[:compute].security_groups.get(@security_group.name).should_not be_nil
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
describe "#get" do
|
40
|
-
|
41
|
-
it "should return a Fog::AWS::Compute::SecurityGroup if a matching security_group exists" do
|
42
|
-
security_group = AWS[:compute].security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
43
|
-
get = AWS[:compute].security_groups.get(security_group.name)
|
44
|
-
security_group.attributes[:fingerprint].should == get.attributes[:fingerprint]
|
45
|
-
security_group.attributes[:name].should == get.attributes[:name]
|
46
|
-
security_group.destroy
|
47
|
-
end
|
48
|
-
|
49
|
-
it "should return nil if no matching security_group exists" do
|
50
|
-
AWS[:compute].security_groups.get('notasecuritygroupname').should be_nil
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
describe "#new" do
|
56
|
-
|
57
|
-
it "should return a Fog::AWS::Compute::SecurityGroup" do
|
58
|
-
AWS[:compute].security_groups.new(:description => 'groupdescription', :name => 'keyname').should be_a(Fog::AWS::Compute::SecurityGroup)
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|
62
|
-
|
63
|
-
describe "#reload" do
|
64
|
-
|
65
|
-
it "should return a Fog::AWS::Compute::SecurityGroups" do
|
66
|
-
AWS[:compute].security_groups.all.reload.should be_a(Fog::AWS::Compute::SecurityGroups)
|
67
|
-
end
|
68
|
-
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|