internuity-awsum 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -1
- data/lib/awsum.rb +1 -1
- data/lib/ec2/address.rb +118 -0
- data/lib/ec2/availability_zone.rb +68 -0
- data/lib/ec2/keypair.rb +75 -0
- data/lib/ec2/region.rb +96 -0
- data/lib/ec2/security_group.rb +175 -0
- data/lib/error.rb +55 -0
- data/lib/net_fix.rb +100 -0
- data/lib/requestable.rb +2 -0
- data/lib/s3/bucket.rb +66 -0
- data/lib/s3/headers.rb +24 -0
- data/lib/s3/object.rb +138 -0
- data/lib/s3/s3.rb +219 -0
- data/test/fixtures/ec2/addresses.xml +10 -0
- data/test/fixtures/ec2/allocate_address.xml +5 -0
- data/test/fixtures/ec2/associate_address.xml +5 -0
- data/test/fixtures/ec2/authorize_ip_access.xml +5 -0
- data/test/fixtures/ec2/authorize_owner_group_access.xml +5 -0
- data/test/fixtures/ec2/authorize_owner_group_access_error.xml +2 -0
- data/test/fixtures/ec2/availability_zones.xml +16 -0
- data/test/fixtures/ec2/create_key_pair.xml +29 -0
- data/test/fixtures/ec2/create_security_group.xml +5 -0
- data/test/fixtures/ec2/delete_key_pair.xml +5 -0
- data/test/fixtures/ec2/delete_security_group.xml +5 -0
- data/test/fixtures/ec2/deregister_image.xml +5 -0
- data/test/fixtures/ec2/disassociate_address.xml +5 -0
- data/test/fixtures/ec2/internal_error.xml +2 -0
- data/test/fixtures/ec2/invalid_amiid_error.xml +2 -0
- data/test/fixtures/ec2/invalid_request_error.xml +2 -0
- data/test/fixtures/ec2/key_pairs.xml +10 -0
- data/test/fixtures/ec2/regions.xml +14 -0
- data/test/fixtures/ec2/register_image.xml +5 -0
- data/test/fixtures/ec2/release_address.xml +5 -0
- data/test/fixtures/ec2/revoke_ip_access.xml +5 -0
- data/test/fixtures/ec2/revoke_owner_group_access.xml +5 -0
- data/test/fixtures/ec2/security_groups.xml +159 -0
- data/test/fixtures/ec2/unassociated_address.xml +10 -0
- data/test/fixtures/s3/buckets.xml +2 -0
- data/test/fixtures/s3/copy_failure.xml +23 -0
- data/test/fixtures/s3/invalid_request_signature.xml +5 -0
- data/test/fixtures/s3/keys.xml +2 -0
- data/test/units/ec2/test_addresses.rb +60 -0
- data/test/units/ec2/test_keypair.rb +87 -0
- data/test/units/ec2/test_regions.rb +33 -0
- data/test/units/ec2/test_security_group.rb +105 -0
- data/test/units/s3/test_bucket.rb +58 -0
- data/test/units/s3/test_object.rb +111 -0
- data/test/units/s3/test_s3.rb +298 -0
- data/test/units/test_error.rb +101 -0
- data/test/units/test_requestable.rb +241 -0
- data/test/work_out_string_to_sign.rb +7 -0
- metadata +132 -43
@@ -0,0 +1,10 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<DescribeAddressesResponse xmlns="http://ec2.amazonaws.com/doc/2008-12-01/">
|
3
|
+
<requestId>0a578151-76d1-4461-b1ce-ae36d39ec349</requestId>
|
4
|
+
<addressesSet>
|
5
|
+
<item>
|
6
|
+
<publicIp>127.0.0.1</publicIp>
|
7
|
+
<instanceId>i-3f1cc856</instanceId>
|
8
|
+
</item>
|
9
|
+
</addressesSet>
|
10
|
+
</DescribeAddressesResponse>
|
@@ -0,0 +1,2 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<Response><Errors><Error><Code>InvalidParameterCombination</Code><Message>The parameter 'CidrIp' may not be used in combination with 'SourceSecurityGroupOwnerId'</Message></Error></Errors><RequestID>6364d411-bdf0-4718-a2c9-219ebec33827</RequestID></Response>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<DescribeAvailabilityZonesResponse xmlns="http://ec2.amazonaws.com/doc/2008-12-01/">
|
3
|
+
<requestId>6ffe1588-28b8-4033-a07c-97b029c6930a</requestId>
|
4
|
+
<availabilityZoneInfo>
|
5
|
+
<item>
|
6
|
+
<zoneName>eu-west-1a</zoneName>
|
7
|
+
<zoneState>available</zoneState>
|
8
|
+
<regionName>eu-west-1</regionName>
|
9
|
+
</item>
|
10
|
+
<item>
|
11
|
+
<zoneName>eu-west-1b</zoneName>
|
12
|
+
<zoneState>available</zoneState>
|
13
|
+
<regionName>eu-west-1</regionName>
|
14
|
+
</item>
|
15
|
+
</availabilityZoneInfo>
|
16
|
+
</DescribeAvailabilityZonesResponse>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<CreateKeyPairResponse xmlns="http://ec2.amazonaws.com/doc/2008-12-01/">
|
3
|
+
<requestId>6c6d3488-f769-431b-a838-2f630aa6c38b</requestId>
|
4
|
+
<keyName>test-keypair</keyName>
|
5
|
+
<keyFingerprint>ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab</keyFingerprint>
|
6
|
+
<keyMaterial>-----BEGIN RSA PRIVATE KEY-----
|
7
|
+
MIIEogIBAAKCAQEAqkxIjNxLV/shvaep5Kum3N2xTV6aBbXezVA4HHE371HSq3haKTcST7QYeQha
|
8
|
+
92AmZojAm2ojqWMw9GJaeq/Q7NvXKdMgj3mKd7zY7tdC+HmKYVkAvJ9enuuVwPFxlt+5rPpZ2jS+
|
9
|
+
kl4MWEvWh1N5U1urx5gzHq2e/k7P+dCBwFnCHsg/p1mym4j4qwEHEviaUG6SnB8Xvuggp/pxCmJg
|
10
|
+
9Gie4cXNgbBboEyAQDRb/AmrehbBa90GOVDjDGIzB98rOcJ22FRrpLqSl2D+FQKsXWboqgbIrgKT
|
11
|
+
ven7mzb8cgDJNrWTI/MNP8p8gNTh+L7gTwPDcGfaDBiRpn9t3FiTBwIDAQABAoIBAEmuNZmUWpjX
|
12
|
+
U/LdjtkcF1bqKCMkchlUZfCI664KojvOOAruSHwakrafYhNDtS/gjtzAAC19z64i93RU9XatiQRh
|
13
|
+
3YcADM9ms604rNcxlY0x8NhLjNEPVv4FScav8AhqBci8jJGnTmi/fjHZphjo2c5iFEGILV3xmp/G
|
14
|
+
857PQsQ4nOAzoV7fQPYow4XiO/xhGh8p8o2Z9Og3GdbEGH1v/051g3O1eU7PFyQaxmOGNYmklMuM
|
15
|
+
V/8l/LK+OKR0f9KgqcgDSlEbidqsmWM0a1/t7+I5W/mgXSZl5U4HN680DKbkzoX0kgoPN7XMbcSX
|
16
|
+
sHNguqDfrvkBUQu1vEaXebWfpekCgYEA0qVbcFGxKniyYxmvtSrbb5bpEnh6zRCGXgSU4fX41i8P
|
17
|
+
Xg15R7FnwGO5nuRXqGW6CSgfbA7YAVEQHunUOB0XWuJWgn6gsqvnCZvyfRnqyMJJjRhvuaUMTn/5
|
18
|
+
ikcayflqPFHvv5Z+pB3pWNaTD6lM5imdF1In9RBYL4q5Vpt9gl0CgYEAzvb6cS6Yi0PkxU3OOEmg
|
19
|
+
98QcdTEd1hrk3r6uXI1TOeiUPIw+dyGCKa9OqpcFDs+0FskFs6RzztRh2gpwQZTH3UOYPqsjsWd+
|
20
|
+
AjL3jv+vmpU1OhnA0SpkyiiZtaSAV2N+Xlq8orG6fbnYFCdzHbufLFaoOpbGptmLfrwMSvnhXLMC
|
21
|
+
gYBxRsEcbqHycAOmLUsDBvAIW0QtTaLkIe3QI3CY7viI3bfK4T4GIs3jdP1+B9dn1IStpej36Cea
|
22
|
+
1afwp9ga8PH9Stgwxr3ON4k/7qABTG2o1mpNOQXj9HDgygs8pC4wzTKnC3z9L4Yc5YT15DYjZuzW
|
23
|
+
nSxAPUsFi2uQ7W3ruCRPdQKBgGslsCiyb+UBpEmFa3L2o3BCRl1hrUmwKLcszsY5oFHFmCD0lk5E
|
24
|
+
ucds6/QjNUoiu+Bj+CC1zgLRL0ubxdwd848YtJQVM+hfZPwseL++naIRBzpqJMnlAcMrW9CPNqaH
|
25
|
+
at/cZ/ZuvtbiRPzCI7XL8a8ZugSDFJtC2xYkstSKI2NDAoGAIiwUwKRMJyB9IRXhMfpf6vsEza2t
|
26
|
+
urHVUdJUyIwvPJSh2PfkumwrPuk+P+8v6jJjJ0hsqOS+TLQwWclIGwGey/PMNRYqQDqnSUofNmza
|
27
|
+
XtGGfWTOD3AdDEH39RTd3Zmfirrjm1YsY/Nb54X+V5TN2uvm/yJBIbb4aLvfG74Jmoc=
|
28
|
+
-----END RSA PRIVATE KEY-----</keyMaterial>
|
29
|
+
</CreateKeyPairResponse>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<DescribeKeyPairsResponse xmlns="http://ec2.amazonaws.com/doc/2008-12-01/">
|
3
|
+
<requestId>a647508d-775c-44e0-870b-3389ef6b5b10</requestId>
|
4
|
+
<keySet>
|
5
|
+
<item>
|
6
|
+
<keyName>gsg-keypair</keyName>
|
7
|
+
<keyFingerprint>ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab</keyFingerprint>
|
8
|
+
</item>
|
9
|
+
</keySet>
|
10
|
+
</DescribeKeyPairsResponse>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<DescribeRegionsResponse xmlns="http://ec2.amazonaws.com/doc/2008-12-01/">
|
3
|
+
<requestId>862239db-7a6f-4c5b-affd-54e9c1d61170</requestId>
|
4
|
+
<regionInfo>
|
5
|
+
<item>
|
6
|
+
<regionName>eu-west-1</regionName>
|
7
|
+
<regionEndpoint>eu-west-1.ec2.amazonaws.com</regionEndpoint>
|
8
|
+
</item>
|
9
|
+
<item>
|
10
|
+
<regionName>us-east-1</regionName>
|
11
|
+
<regionEndpoint>us-east-1.ec2.amazonaws.com</regionEndpoint>
|
12
|
+
</item>
|
13
|
+
</regionInfo>
|
14
|
+
</DescribeRegionsResponse>
|
@@ -0,0 +1,159 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<DescribeSecurityGroupsResponse xmlns="http://ec2.amazonaws.com/doc/2008-12-01/">
|
3
|
+
<requestId>b452331e-76d8-4f08-933e-be058e91e2c7</requestId>
|
4
|
+
<securityGroupInfo>
|
5
|
+
<item>
|
6
|
+
<ownerId>111111111111</ownerId>
|
7
|
+
<groupName>default</groupName>
|
8
|
+
<groupDescription>default group</groupDescription>
|
9
|
+
<ipPermissions>
|
10
|
+
<item>
|
11
|
+
<ipProtocol>tcp</ipProtocol>
|
12
|
+
<fromPort>0</fromPort>
|
13
|
+
<toPort>65535</toPort>
|
14
|
+
<groups>
|
15
|
+
<item>
|
16
|
+
<userId>111111111111</userId>
|
17
|
+
<groupName>default</groupName>
|
18
|
+
</item>
|
19
|
+
</groups>
|
20
|
+
<ipRanges/>
|
21
|
+
</item>
|
22
|
+
<item>
|
23
|
+
<ipProtocol>udp</ipProtocol>
|
24
|
+
<fromPort>0</fromPort>
|
25
|
+
<toPort>65535</toPort>
|
26
|
+
<groups>
|
27
|
+
<item>
|
28
|
+
<userId>111111111111</userId>
|
29
|
+
<groupName>default</groupName>
|
30
|
+
</item>
|
31
|
+
</groups>
|
32
|
+
<ipRanges/>
|
33
|
+
</item>
|
34
|
+
<item>
|
35
|
+
<ipProtocol>icmp</ipProtocol>
|
36
|
+
<fromPort>-1</fromPort>
|
37
|
+
<toPort>-1</toPort>
|
38
|
+
<groups>
|
39
|
+
<item>
|
40
|
+
<userId>111111111111</userId>
|
41
|
+
<groupName>default</groupName>
|
42
|
+
</item>
|
43
|
+
</groups>
|
44
|
+
<ipRanges/>
|
45
|
+
</item>
|
46
|
+
<item>
|
47
|
+
<ipProtocol>tcp</ipProtocol>
|
48
|
+
<fromPort>22</fromPort>
|
49
|
+
<toPort>22</toPort>
|
50
|
+
<groups/>
|
51
|
+
<ipRanges>
|
52
|
+
<item>
|
53
|
+
<cidrIp>0.0.0.0/0</cidrIp>
|
54
|
+
</item>
|
55
|
+
</ipRanges>
|
56
|
+
</item>
|
57
|
+
<item>
|
58
|
+
<ipProtocol>tcp</ipProtocol>
|
59
|
+
<fromPort>80</fromPort>
|
60
|
+
<toPort>80</toPort>
|
61
|
+
<groups/>
|
62
|
+
<ipRanges>
|
63
|
+
<item>
|
64
|
+
<cidrIp>0.0.0.0/0</cidrIp>
|
65
|
+
</item>
|
66
|
+
</ipRanges>
|
67
|
+
</item>
|
68
|
+
<item>
|
69
|
+
<ipProtocol>tcp</ipProtocol>
|
70
|
+
<fromPort>443</fromPort>
|
71
|
+
<toPort>443</toPort>
|
72
|
+
<groups/>
|
73
|
+
<ipRanges>
|
74
|
+
<item>
|
75
|
+
<cidrIp>0.0.0.0/0</cidrIp>
|
76
|
+
</item>
|
77
|
+
</ipRanges>
|
78
|
+
</item>
|
79
|
+
<item>
|
80
|
+
<ipProtocol>tcp</ipProtocol>
|
81
|
+
<fromPort>9111</fromPort>
|
82
|
+
<toPort>9111</toPort>
|
83
|
+
<groups/>
|
84
|
+
<ipRanges>
|
85
|
+
<item>
|
86
|
+
<cidrIp>0.0.0.0/0</cidrIp>
|
87
|
+
</item>
|
88
|
+
</ipRanges>
|
89
|
+
</item>
|
90
|
+
</ipPermissions>
|
91
|
+
</item>
|
92
|
+
<item>
|
93
|
+
<ownerId>111111111111</ownerId>
|
94
|
+
<groupName>webservers</groupName>
|
95
|
+
<groupDescription>web</groupDescription>
|
96
|
+
<ipPermissions>
|
97
|
+
<item>
|
98
|
+
<ipProtocol>tcp</ipProtocol>
|
99
|
+
<fromPort>1</fromPort>
|
100
|
+
<toPort>65535</toPort>
|
101
|
+
<groups>
|
102
|
+
<item>
|
103
|
+
<userId>111111111111</userId>
|
104
|
+
<groupName>default</groupName>
|
105
|
+
</item>
|
106
|
+
<item>
|
107
|
+
<userId>111111111111</userId>
|
108
|
+
<groupName>webservers</groupName>
|
109
|
+
</item>
|
110
|
+
</groups>
|
111
|
+
<ipRanges/>
|
112
|
+
</item>
|
113
|
+
<item>
|
114
|
+
<ipProtocol>udp</ipProtocol>
|
115
|
+
<fromPort>1</fromPort>
|
116
|
+
<toPort>65535</toPort>
|
117
|
+
<groups>
|
118
|
+
<item>
|
119
|
+
<userId>111111111111</userId>
|
120
|
+
<groupName>default</groupName>
|
121
|
+
</item>
|
122
|
+
<item>
|
123
|
+
<userId>111111111111</userId>
|
124
|
+
<groupName>webservers</groupName>
|
125
|
+
</item>
|
126
|
+
</groups>
|
127
|
+
<ipRanges/>
|
128
|
+
</item>
|
129
|
+
<item>
|
130
|
+
<ipProtocol>icmp</ipProtocol>
|
131
|
+
<fromPort>-1</fromPort>
|
132
|
+
<toPort>-1</toPort>
|
133
|
+
<groups>
|
134
|
+
<item>
|
135
|
+
<userId>111111111111</userId>
|
136
|
+
<groupName>default</groupName>
|
137
|
+
</item>
|
138
|
+
<item>
|
139
|
+
<userId>111111111111</userId>
|
140
|
+
<groupName>webservers</groupName>
|
141
|
+
</item>
|
142
|
+
</groups>
|
143
|
+
<ipRanges/>
|
144
|
+
</item>
|
145
|
+
<item>
|
146
|
+
<ipProtocol>tcp</ipProtocol>
|
147
|
+
<fromPort>80</fromPort>
|
148
|
+
<toPort>80</toPort>
|
149
|
+
<groups/>
|
150
|
+
<ipRanges>
|
151
|
+
<item>
|
152
|
+
<cidrIp>0.0.0.0/0</cidrIp>
|
153
|
+
</item>
|
154
|
+
</ipRanges>
|
155
|
+
</item>
|
156
|
+
</ipPermissions>
|
157
|
+
</item>
|
158
|
+
</securityGroupInfo>
|
159
|
+
</DescribeSecurityGroupsResponse>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<DescribeAddressesResponse xmlns="http://ec2.amazonaws.com/doc/2008-12-01/">
|
3
|
+
<requestId>0a578151-76d1-4461-b1ce-ae36d39ec349</requestId>
|
4
|
+
<addressesSet>
|
5
|
+
<item>
|
6
|
+
<publicIp>127.0.0.1</publicIp>
|
7
|
+
<instanceId/>
|
8
|
+
</item>
|
9
|
+
</addressesSet>
|
10
|
+
</DescribeAddressesResponse>
|
@@ -0,0 +1,2 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>1111111111111111111111111111111111111111111111111111111111111111</ID><DisplayName>AAAAAA</DisplayName></Owner><Buckets><Bucket><Name>test-bucket</Name><CreationDate>2008-12-04T16:08:03.000Z</CreationDate></Bucket><Bucket><Name>another-test-bucket</Name><CreationDate>2009-01-02T08:25:27.000Z</CreationDate></Bucket></Buckets></ListAllMyBucketsResult>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><StringToSignBytes>50 55 54 0a 59 57 59 34 4d 47 4a 6c 4d 6d 55 32 5a 44 59 35 4e 32 59 79 4f 57 45 35 5a 44 67 31 59 6a 67 33 59 54 51 35 4f 54 6b 79 4d 44 55 3d 0a 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 2d 77 77 77 2d 66 6f 72 6d 2d 75 72 6c 65 6e 63 6f 64 65 64 0a 54 75 65 2c 20 32 37 20 4a 61 6e 20 32 30 30 39 20 30 35 3a 31 38 3a 30 36 20 2b 30 32 30 30 0a 2f 61 77 73 75 6d 2d 74 65 73 74 2d 62 75 63 6b 65 74 2f 74 65 73 74 31 2e 74 78 74</StringToSignBytes><RequestId>508F513C9D42C30E</RequestId><HostId>98di22wxhjhz0gCgNTHjJsH+Ywogv244W+sua24060WKPIjt2GGEhc0iYIsmMvVi</HostId><SignatureProvided>ryk9uqNKaI1wRaH7XLikD+pnwpM=</SignatureProvided><StringToSign>PUT
|
2
|
+
YWY4MGJlMmU2ZDY5N2YyOWE5ZDg1Yjg3YTQ5OTkyMDU=
|
3
|
+
application/x-www-form-urlencoded
|
4
|
+
Tue, 27 Jan 2009 05:18:06 +0200
|
5
|
+
/awsum-test-bucket/test1.txt</StringToSign><AWSAccessKeyId>1NJXGWMY8MX5G7SE7XG2</AWSAccessKeyId></Error>
|
@@ -0,0 +1,2 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>test.cyclemates.com</Name><Prefix></Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><IsTruncated>false</IsTruncated><Contents><Key>test/photo1.jpg</Key><LastModified>2008-12-07T13:47:59.000Z</LastModified><ETag>"03bde534951a1c099724f569a53acb1e"</ETag><Size>203841</Size><Owner><ID>1111111111111111111111111111111111111111111111111111111111111111</ID><DisplayName>AAAAAA</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents><Contents><Key>test/photo2.jpg</Key><LastModified>2008-12-07T13:48:13.000Z</LastModified><ETag>"14c3a2e9a40b0c33451627b8ffec6081"</ETag><Size>21102</Size><Owner><ID>1111111111111111111111111111111111111111111111111111111111111111</ID><DisplayName>AAAAAA</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents></ListBucketResult>
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require File.expand_path('../../helper', File.dirname(__FILE__))
|
2
|
+
|
3
|
+
class AddressesTest < Test::Unit::TestCase
|
4
|
+
context "AddressParser:" do
|
5
|
+
context "Parsing the result of a call to DescribeAddresses" do
|
6
|
+
setup {
|
7
|
+
ec2 = Awsum::Ec2.new('abc', 'xyz')
|
8
|
+
xml = load_fixture('ec2/addresses')
|
9
|
+
parser = Awsum::Ec2::AddressParser.new(ec2)
|
10
|
+
@result = parser.parse(xml)
|
11
|
+
}
|
12
|
+
|
13
|
+
should "return an array of addresses" do
|
14
|
+
assert @result.is_a?(Array)
|
15
|
+
assert @result[0].is_a?(Awsum::Ec2::Address)
|
16
|
+
end
|
17
|
+
|
18
|
+
context ", the first address" do
|
19
|
+
setup {
|
20
|
+
@address = @result[0]
|
21
|
+
}
|
22
|
+
|
23
|
+
should "have the correct ip address" do
|
24
|
+
assert_equal "127.0.0.1", @address.public_ip
|
25
|
+
end
|
26
|
+
|
27
|
+
should "have the correct instance id" do
|
28
|
+
assert_equal 'i-3f1cc856', @address.instance_id
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context "Parsing the result of a call to AllocateAddress" do
|
34
|
+
setup {
|
35
|
+
ec2 = Awsum::Ec2.new('abc', 'xyz')
|
36
|
+
xml = load_fixture('ec2/allocate_address')
|
37
|
+
parser = Awsum::Ec2::AddressParser.new(ec2)
|
38
|
+
@result = parser.parse(xml)
|
39
|
+
}
|
40
|
+
|
41
|
+
should "return an address" do
|
42
|
+
assert Awsum::Ec2::Address, @result.class
|
43
|
+
end
|
44
|
+
|
45
|
+
context ", the address" do
|
46
|
+
setup {
|
47
|
+
@address = @result[0]
|
48
|
+
}
|
49
|
+
|
50
|
+
should "have the correct ip address" do
|
51
|
+
assert_equal "127.0.0.1", @address.public_ip
|
52
|
+
end
|
53
|
+
|
54
|
+
should "have a nil instance id" do
|
55
|
+
assert_nil @address.instance_id
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|