nephophobia 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -0
- data/lib/nephophobia/client.rb +3 -3
- data/lib/nephophobia/compute.rb +70 -2
- data/lib/nephophobia/credential.rb +0 -19
- data/lib/nephophobia/project.rb +3 -0
- data/lib/nephophobia/role.rb +3 -0
- data/lib/nephophobia/user.rb +20 -0
- data/lib/nephophobia/version.rb +1 -1
- data/nephophobia.gemspec +2 -2
- data/test/cassettes/compute_allocate_address.yml +55 -0
- data/test/cassettes/compute_allocate_address_when_not_available.yml +30 -0
- data/test/cassettes/compute_associate_address.yml +136 -0
- data/test/cassettes/compute_disassociate_address.yml +163 -0
- data/test/cassettes/compute_release_address.yml +55 -0
- data/test/cassettes/project_add_member.yml +12 -12
- data/test/cassettes/project_all.yml +3 -3
- data/test/cassettes/project_all_with_user_name.yml +22 -22
- data/test/cassettes/project_create.yml +12 -12
- data/test/cassettes/project_destroy.yml +12 -12
- data/test/cassettes/project_find.yml +3 -3
- data/test/cassettes/project_find_with_invalid_project_name.yml +3 -3
- data/test/cassettes/project_member.yml +16 -16
- data/test/cassettes/project_members.yml +10 -10
- data/test/cassettes/project_members_with_invalid_project_name.yml +3 -3
- data/test/cassettes/project_remove_member.yml +12 -12
- data/test/cassettes/role_all.yml +15 -15
- data/test/cassettes/role_all_with_project_name.yml +15 -15
- data/test/cassettes/role_all_without_roles.yml +12 -12
- data/test/cassettes/role_create.yml +12 -12
- data/test/cassettes/role_create_with_project_name.yml +12 -12
- data/test/cassettes/role_create_with_project_name_and_role_name.yml +12 -12
- data/test/cassettes/role_destroy.yml +12 -12
- data/test/cassettes/role_destroy_with_project_name.yml +12 -12
- data/test/cassettes/role_destroy_with_project_name_and_role_name.yml +12 -12
- data/test/cassettes/user_create.yml +6 -6
- data/test/cassettes/user_credentials.yml +190 -0
- data/test/cassettes/user_destroy.yml +6 -6
- data/test/cassettes/user_find.yml +9 -9
- data/test/cassettes/user_find_with_invalid_user_name.yml +3 -3
- data/test/cassettes/user_register.yml +19 -19
- data/test/cassettes/user_register_asserts.yml +10 -10
- data/test/lib/nephophobia/compute_test.rb +104 -9
- data/test/lib/nephophobia/credential_test.rb +4 -17
- data/test/lib/nephophobia/user_test.rb +31 -0
- data/test/test_helper.rb +11 -0
- metadata +16 -4
@@ -2,7 +2,7 @@
|
|
2
2
|
- !ruby/struct:VCR::HTTPInteraction
|
3
3
|
request: !ruby/struct:VCR::Request
|
4
4
|
method: :get
|
5
|
-
uri: http://10.3.170.32:8773/services/Admin
|
5
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=RegisterUser&Name=vcr_user&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=6AjzqntOVWOXKISXoh%2BEAq9jrsgrH%2BKnfpTSBzx%2B%2F6A%3D
|
6
6
|
body:
|
7
7
|
headers:
|
8
8
|
accept:
|
@@ -21,15 +21,15 @@
|
|
21
21
|
content-length:
|
22
22
|
- "313"
|
23
23
|
date:
|
24
|
-
-
|
24
|
+
- Fri, 27 May 2011 17:46:28 GMT
|
25
25
|
connection:
|
26
26
|
- keep-alive
|
27
|
-
body: <?xml version="1.0" ?><RegisterUserResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>
|
27
|
+
body: <?xml version="1.0" ?><RegisterUserResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>JGHSWBEZ-LMQB4SKA8FV</requestId><username>vcr_user</username><secretkey>6a7c75ad-8746-4f90-8546-3f890631056f</secretkey><accesskey>d239c6ff-9888-4f01-8375-f62faec53318</accesskey><file/></RegisterUserResponse>
|
28
28
|
http_version: "1.1"
|
29
29
|
- !ruby/struct:VCR::HTTPInteraction
|
30
30
|
request: !ruby/struct:VCR::Request
|
31
31
|
method: :get
|
32
|
-
uri: http://10.3.170.32:8773/services/Admin
|
32
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=DeregisterUser&Name=vcr_user&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=xE0f9t0Pixm0FkSRS%2B9oaao1FoM7o682i0gYkIlfwSU%3D
|
33
33
|
body:
|
34
34
|
headers:
|
35
35
|
accept:
|
@@ -48,8 +48,8 @@
|
|
48
48
|
content-length:
|
49
49
|
- "184"
|
50
50
|
date:
|
51
|
-
-
|
51
|
+
- Fri, 27 May 2011 17:46:28 GMT
|
52
52
|
connection:
|
53
53
|
- keep-alive
|
54
|
-
body: <?xml version="1.0" ?><DeregisterUserResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>
|
54
|
+
body: <?xml version="1.0" ?><DeregisterUserResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>N8VWYKBWWDY0-2E9RA11</requestId><return>true</return></DeregisterUserResponse>
|
55
55
|
http_version: "1.1"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
- !ruby/struct:VCR::HTTPInteraction
|
3
3
|
request: !ruby/struct:VCR::Request
|
4
4
|
method: :get
|
5
|
-
uri: http://10.3.170.32:8773/services/Admin
|
5
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=RegisterUser&Name=vcr_user&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=6AjzqntOVWOXKISXoh%2BEAq9jrsgrH%2BKnfpTSBzx%2B%2F6A%3D
|
6
6
|
body:
|
7
7
|
headers:
|
8
8
|
accept:
|
@@ -21,15 +21,15 @@
|
|
21
21
|
content-length:
|
22
22
|
- "313"
|
23
23
|
date:
|
24
|
-
-
|
24
|
+
- Fri, 27 May 2011 17:46:29 GMT
|
25
25
|
connection:
|
26
26
|
- keep-alive
|
27
|
-
body: <?xml version="1.0" ?><RegisterUserResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>
|
27
|
+
body: <?xml version="1.0" ?><RegisterUserResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>TE51AF17AO5RBGA5N050</requestId><username>vcr_user</username><secretkey>1dfa251a-129e-41e0-8867-7b5cd04340e0</secretkey><accesskey>eb434e94-dd92-4cc0-8e21-ce3ee1b0de88</accesskey><file/></RegisterUserResponse>
|
28
28
|
http_version: "1.1"
|
29
29
|
- !ruby/struct:VCR::HTTPInteraction
|
30
30
|
request: !ruby/struct:VCR::Request
|
31
31
|
method: :get
|
32
|
-
uri: http://10.3.170.32:8773/services/Admin
|
32
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=DescribeUser&Name=vcr_user&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=ALd26JZQSPhHXV%2Bxcoz1VFYCXa%2B58WFKRt5EIz8nRFg%3D
|
33
33
|
body:
|
34
34
|
headers:
|
35
35
|
accept:
|
@@ -48,15 +48,15 @@
|
|
48
48
|
content-length:
|
49
49
|
- "313"
|
50
50
|
date:
|
51
|
-
-
|
51
|
+
- Fri, 27 May 2011 17:46:29 GMT
|
52
52
|
connection:
|
53
53
|
- keep-alive
|
54
|
-
body: <?xml version="1.0" ?><DescribeUserResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>
|
54
|
+
body: <?xml version="1.0" ?><DescribeUserResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>QM4-4B-2ED7-HPHDWWFX</requestId><username>vcr_user</username><secretkey>1dfa251a-129e-41e0-8867-7b5cd04340e0</secretkey><accesskey>eb434e94-dd92-4cc0-8e21-ce3ee1b0de88</accesskey><file/></DescribeUserResponse>
|
55
55
|
http_version: "1.1"
|
56
56
|
- !ruby/struct:VCR::HTTPInteraction
|
57
57
|
request: !ruby/struct:VCR::Request
|
58
58
|
method: :get
|
59
|
-
uri: http://10.3.170.32:8773/services/Admin
|
59
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=DeregisterUser&Name=vcr_user&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=xE0f9t0Pixm0FkSRS%2B9oaao1FoM7o682i0gYkIlfwSU%3D
|
60
60
|
body:
|
61
61
|
headers:
|
62
62
|
accept:
|
@@ -75,8 +75,8 @@
|
|
75
75
|
content-length:
|
76
76
|
- "184"
|
77
77
|
date:
|
78
|
-
-
|
78
|
+
- Fri, 27 May 2011 17:46:29 GMT
|
79
79
|
connection:
|
80
80
|
- keep-alive
|
81
|
-
body: <?xml version="1.0" ?><DeregisterUserResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>
|
81
|
+
body: <?xml version="1.0" ?><DeregisterUserResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>51NJ1XF5XHA8CEFMKC0S</requestId><return>true</return></DeregisterUserResponse>
|
82
82
|
http_version: "1.1"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
- !ruby/struct:VCR::HTTPInteraction
|
3
3
|
request: !ruby/struct:VCR::Request
|
4
4
|
method: :get
|
5
|
-
uri: http://10.3.170.32:8773/services/Admin
|
5
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=DescribeUser&Name=invalid_user_name&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=stMHJwcMixzo%2FmJPfNzgsG%2ByUwP6oxUnpgQnYRhVa8o%3D
|
6
6
|
body:
|
7
7
|
headers:
|
8
8
|
accept:
|
@@ -21,10 +21,10 @@
|
|
21
21
|
content-length:
|
22
22
|
- "190"
|
23
23
|
date:
|
24
|
-
-
|
24
|
+
- Fri, 27 May 2011 17:46:30 GMT
|
25
25
|
connection:
|
26
26
|
- keep-alive
|
27
27
|
body: |-
|
28
28
|
<?xml version="1.0"?>
|
29
|
-
<Response><Errors><Error><Code>NotFound</Code><Message>No user for id invalid_user_name</Message></Error></Errors><RequestID>
|
29
|
+
<Response><Errors><Error><Code>NotFound</Code><Message>No user for id invalid_user_name</Message></Error></Errors><RequestID>LVD1RI7NNYI9GDG2A76Q</RequestID></Response>
|
30
30
|
http_version: "1.1"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
- !ruby/struct:VCR::HTTPInteraction
|
3
3
|
request: !ruby/struct:VCR::Request
|
4
4
|
method: :get
|
5
|
-
uri: http://10.3.170.32:8773/services/Admin
|
5
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=RegisterUser&Name=vcr_user&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=6AjzqntOVWOXKISXoh%2BEAq9jrsgrH%2BKnfpTSBzx%2B%2F6A%3D
|
6
6
|
body:
|
7
7
|
headers:
|
8
8
|
accept:
|
@@ -21,15 +21,15 @@
|
|
21
21
|
content-length:
|
22
22
|
- "313"
|
23
23
|
date:
|
24
|
-
-
|
24
|
+
- Fri, 27 May 2011 17:46:30 GMT
|
25
25
|
connection:
|
26
26
|
- keep-alive
|
27
|
-
body: <?xml version="1.0" ?><RegisterUserResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>
|
27
|
+
body: <?xml version="1.0" ?><RegisterUserResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>9HW-NCB5M09KH7AJWV76</requestId><username>vcr_user</username><secretkey>743bbd69-71e2-41a1-9707-bfef8df30b1e</secretkey><accesskey>863b7f10-fcfe-48d0-a154-a4824f530baf</accesskey><file/></RegisterUserResponse>
|
28
28
|
http_version: "1.1"
|
29
29
|
- !ruby/struct:VCR::HTTPInteraction
|
30
30
|
request: !ruby/struct:VCR::Request
|
31
31
|
method: :get
|
32
|
-
uri: http://10.3.170.32:8773/services/Admin
|
32
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=DescribeProjectMembers&Name=sandbox&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=wTXaX6kI6U7c01YgfL5w2fX5BhhEBCK%2FfupkcS6T1NQ%3D
|
33
33
|
body:
|
34
34
|
headers:
|
35
35
|
accept:
|
@@ -46,17 +46,17 @@
|
|
46
46
|
content-type:
|
47
47
|
- text/xml
|
48
48
|
content-length:
|
49
|
-
- "
|
49
|
+
- "592"
|
50
50
|
date:
|
51
|
-
-
|
51
|
+
- Fri, 27 May 2011 17:46:30 GMT
|
52
52
|
connection:
|
53
53
|
- keep-alive
|
54
|
-
body: <?xml version="1.0" ?><DescribeProjectMembersResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId
|
54
|
+
body: <?xml version="1.0" ?><DescribeProjectMembersResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>-H0N2BCKO-RGAXO-NREB</requestId><members><item><member>eh0377</member></item><item><member>cc520u</member></item><item><member>kb718q</member></item><item><member>root</member></item><item><member>jd265j</member></item><item><member>pe623x</member></item><item><member>jk520u</member></item><item><member>cn5542</member></item><item><member>fh865a</member></item><item><member>aa873p</member></item><item><member>jt708u</member></item></members></DescribeProjectMembersResponse>
|
55
55
|
http_version: "1.1"
|
56
56
|
- !ruby/struct:VCR::HTTPInteraction
|
57
57
|
request: !ruby/struct:VCR::Request
|
58
58
|
method: :get
|
59
|
-
uri: http://10.3.170.32:8773/services/Admin
|
59
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=ModifyUserRole&Operation=add&Role=sysadmin&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr_user&Version=2010-11-15&Signature=iXoqvg1IfdbUoT8KwFMtAxMG%2FEw36EmiQRE6gzh27vU%3D
|
60
60
|
body:
|
61
61
|
headers:
|
62
62
|
accept:
|
@@ -75,15 +75,15 @@
|
|
75
75
|
content-length:
|
76
76
|
- "184"
|
77
77
|
date:
|
78
|
-
-
|
78
|
+
- Fri, 27 May 2011 17:46:30 GMT
|
79
79
|
connection:
|
80
80
|
- keep-alive
|
81
|
-
body: <?xml version="1.0" ?><ModifyUserRoleResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>
|
81
|
+
body: <?xml version="1.0" ?><ModifyUserRoleResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>4MJRXRNPHG1V4SNWOP4J</requestId><return>true</return></ModifyUserRoleResponse>
|
82
82
|
http_version: "1.1"
|
83
83
|
- !ruby/struct:VCR::HTTPInteraction
|
84
84
|
request: !ruby/struct:VCR::Request
|
85
85
|
method: :get
|
86
|
-
uri: http://10.3.170.32:8773/services/Admin
|
86
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=ModifyUserRole&Operation=add&Project=sandbox&Role=sysadmin&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr_user&Version=2010-11-15&Signature=ACwX6Rx4GWaes1GnO5%2Bf0GZRu%2F4CWgvfuiVv%2BP7Ocno%3D
|
87
87
|
body:
|
88
88
|
headers:
|
89
89
|
accept:
|
@@ -102,15 +102,15 @@
|
|
102
102
|
content-length:
|
103
103
|
- "184"
|
104
104
|
date:
|
105
|
-
-
|
105
|
+
- Fri, 27 May 2011 17:46:31 GMT
|
106
106
|
connection:
|
107
107
|
- keep-alive
|
108
|
-
body: <?xml version="1.0" ?><ModifyUserRoleResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>
|
108
|
+
body: <?xml version="1.0" ?><ModifyUserRoleResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>3K4OZC5RW78J03JGULLI</requestId><return>true</return></ModifyUserRoleResponse>
|
109
109
|
http_version: "1.1"
|
110
110
|
- !ruby/struct:VCR::HTTPInteraction
|
111
111
|
request: !ruby/struct:VCR::Request
|
112
112
|
method: :get
|
113
|
-
uri: http://10.3.170.32:8773/services/Admin
|
113
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=ModifyProjectMember&Operation=add&Project=sandbox&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr_user&Version=2010-11-15&Signature=K0g5BrmtuGPDHSMkbSWNtTuIzkF08MeWnIFVkDgKH78%3D
|
114
114
|
body:
|
115
115
|
headers:
|
116
116
|
accept:
|
@@ -129,15 +129,15 @@
|
|
129
129
|
content-length:
|
130
130
|
- "194"
|
131
131
|
date:
|
132
|
-
-
|
132
|
+
- Fri, 27 May 2011 17:46:31 GMT
|
133
133
|
connection:
|
134
134
|
- keep-alive
|
135
|
-
body: <?xml version="1.0" ?><ModifyProjectMemberResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>
|
135
|
+
body: <?xml version="1.0" ?><ModifyProjectMemberResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>B5ND6PN6M99LJFSN1Y-V</requestId><return>true</return></ModifyProjectMemberResponse>
|
136
136
|
http_version: "1.1"
|
137
137
|
- !ruby/struct:VCR::HTTPInteraction
|
138
138
|
request: !ruby/struct:VCR::Request
|
139
139
|
method: :get
|
140
|
-
uri: http://10.3.170.32:8773/services/Admin
|
140
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=DeregisterUser&Name=vcr_user&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=xE0f9t0Pixm0FkSRS%2B9oaao1FoM7o682i0gYkIlfwSU%3D
|
141
141
|
body:
|
142
142
|
headers:
|
143
143
|
accept:
|
@@ -156,8 +156,8 @@
|
|
156
156
|
content-length:
|
157
157
|
- "184"
|
158
158
|
date:
|
159
|
-
-
|
159
|
+
- Fri, 27 May 2011 17:46:32 GMT
|
160
160
|
connection:
|
161
161
|
- keep-alive
|
162
|
-
body: <?xml version="1.0" ?><DeregisterUserResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>
|
162
|
+
body: <?xml version="1.0" ?><DeregisterUserResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>J84W78Z-KEUJ0I461SGF</requestId><return>true</return></DeregisterUserResponse>
|
163
163
|
http_version: "1.1"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
- !ruby/struct:VCR::HTTPInteraction
|
3
3
|
request: !ruby/struct:VCR::Request
|
4
4
|
method: :get
|
5
|
-
uri: http://10.3.170.32:8773/services/Admin
|
5
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=DescribeUserRoles&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr_user&Version=2010-11-15&Signature=sUHSI6oFYi%2Fa7Rg7Y57YrIgdqCu0UNBx2GjkoEkaaq0%3D
|
6
6
|
body:
|
7
7
|
headers:
|
8
8
|
accept:
|
@@ -21,15 +21,15 @@
|
|
21
21
|
content-length:
|
22
22
|
- "218"
|
23
23
|
date:
|
24
|
-
-
|
24
|
+
- Fri, 27 May 2011 17:46:31 GMT
|
25
25
|
connection:
|
26
26
|
- keep-alive
|
27
|
-
body: <?xml version="1.0" ?><DescribeUserRolesResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>
|
27
|
+
body: <?xml version="1.0" ?><DescribeUserRolesResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>HL5PLCHZBD8NORWOSI90</requestId><roles><item><role>sysadmin</role></item></roles></DescribeUserRolesResponse>
|
28
28
|
http_version: "1.1"
|
29
29
|
- !ruby/struct:VCR::HTTPInteraction
|
30
30
|
request: !ruby/struct:VCR::Request
|
31
31
|
method: :get
|
32
|
-
uri: http://10.3.170.32:8773/services/Admin
|
32
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=DescribeUserRoles&Project=sandbox&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&User=vcr_user&Version=2010-11-15&Signature=3qXbAY%2FRzK%2Bj6czyRJIFBKXUagipYCuc87c6SU1YBhY%3D
|
33
33
|
body:
|
34
34
|
headers:
|
35
35
|
accept:
|
@@ -48,15 +48,15 @@
|
|
48
48
|
content-length:
|
49
49
|
- "218"
|
50
50
|
date:
|
51
|
-
-
|
51
|
+
- Fri, 27 May 2011 17:46:31 GMT
|
52
52
|
connection:
|
53
53
|
- keep-alive
|
54
|
-
body: <?xml version="1.0" ?><DescribeUserRolesResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>
|
54
|
+
body: <?xml version="1.0" ?><DescribeUserRolesResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>QSENO2REDK8CUDYO3JDG</requestId><roles><item><role>sysadmin</role></item></roles></DescribeUserRolesResponse>
|
55
55
|
http_version: "1.1"
|
56
56
|
- !ruby/struct:VCR::HTTPInteraction
|
57
57
|
request: !ruby/struct:VCR::Request
|
58
58
|
method: :get
|
59
|
-
uri: http://10.3.170.32:8773/services/Admin
|
59
|
+
uri: http://10.3.170.32:8773/services/Admin?AWSAccessKeyId=03982c2e-8e28-40b6-95e2-f2811383b4a2%3Asandbox&Action=DescribeProjectMembers&Name=sandbox&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=1999-12-31T19%3A59%3A59Z&Version=2010-11-15&Signature=wTXaX6kI6U7c01YgfL5w2fX5BhhEBCK%2FfupkcS6T1NQ%3D
|
60
60
|
body:
|
61
61
|
headers:
|
62
62
|
accept:
|
@@ -73,10 +73,10 @@
|
|
73
73
|
content-type:
|
74
74
|
- text/xml
|
75
75
|
content-length:
|
76
|
-
- "
|
76
|
+
- "630"
|
77
77
|
date:
|
78
|
-
-
|
78
|
+
- Fri, 27 May 2011 17:46:32 GMT
|
79
79
|
connection:
|
80
80
|
- keep-alive
|
81
|
-
body: <?xml version="1.0" ?><DescribeProjectMembersResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>
|
81
|
+
body: <?xml version="1.0" ?><DescribeProjectMembersResponse xmlns="http://ec2.amazonaws.com/doc/2010-11-15/"><requestId>QUU7ZAT2XD4W5U22JMNS</requestId><members><item><member>eh0377</member></item><item><member>cc520u</member></item><item><member>kb718q</member></item><item><member>root</member></item><item><member>jd265j</member></item><item><member>pe623x</member></item><item><member>jk520u</member></item><item><member>cn5542</member></item><item><member>fh865a</member></item><item><member>aa873p</member></item><item><member>jt708u</member></item><item><member>vcr_user</member></item></members></DescribeProjectMembersResponse>
|
82
82
|
http_version: "1.1"
|
@@ -160,15 +160,7 @@ describe Nephophobia::Compute do
|
|
160
160
|
describe "#vnc_url" do
|
161
161
|
before do
|
162
162
|
VCR.use_cassette "compute_vnc_url" do
|
163
|
-
|
164
|
-
# Pointing to the nova trunk version.
|
165
|
-
|
166
|
-
@compute = ::Client.with(:admin,
|
167
|
-
:access_key => "2ea76797-229c-4e52-a21b-f30513cb91a6",
|
168
|
-
:secret_key => "3d16b391-820f-4f5c-893b-0f65d5f35312",
|
169
|
-
:host => "10.3.170.35",
|
170
|
-
:project => "sandbox"
|
171
|
-
).compute
|
163
|
+
@compute = ::Client.trunk_with(:admin).compute
|
172
164
|
|
173
165
|
@instance_id = @compute.create(@image_id).instance_id
|
174
166
|
|
@@ -186,4 +178,107 @@ describe Nephophobia::Compute do
|
|
186
178
|
@response.url.must_match %r{/vnc_auto.html\?token=[a-z0-9-]+}
|
187
179
|
end
|
188
180
|
end
|
181
|
+
|
182
|
+
describe "#allocate_address" do
|
183
|
+
before do
|
184
|
+
VCR.use_cassette "compute_allocate_address" do
|
185
|
+
@compute = ::Client.trunk_with(:admin).compute
|
186
|
+
|
187
|
+
@response = @compute.allocate_address
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
after do
|
192
|
+
VCR.use_cassette "compute_allocate_address" do
|
193
|
+
@compute.release_address @response.floating_ip
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
it "allocates address" do
|
198
|
+
@response.floating_ip.must_match %r{[0-9]{1,3}+\.[0-9]{1,3}}
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
describe "not available" do
|
203
|
+
describe "#allocate_address" do
|
204
|
+
before do
|
205
|
+
@compute = ::Client.trunk_with(:admin).compute
|
206
|
+
end
|
207
|
+
|
208
|
+
it "has no available address" do
|
209
|
+
VCR.use_cassette "compute_allocate_address_when_not_available" do
|
210
|
+
lambda { @compute.allocate_address}.must_raise Hugs::Errors::BadRequest
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
describe "#release_address" do
|
217
|
+
before do
|
218
|
+
VCR.use_cassette "compute_release_address" do
|
219
|
+
@compute = ::Client.trunk_with(:admin).compute
|
220
|
+
|
221
|
+
floating_ip = @compute.allocate_address.floating_ip
|
222
|
+
@response = @compute.release_address floating_ip
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
it "released the floating ip" do
|
227
|
+
@response.status.must_equal "Address released."
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
describe "#associate_address" do
|
232
|
+
before do
|
233
|
+
VCR.use_cassette "compute_associate_address" do
|
234
|
+
@compute = ::Client.trunk_with(:admin).compute
|
235
|
+
|
236
|
+
@floating_ip = @compute.allocate_address.floating_ip
|
237
|
+
@instance_id = @compute.create(@image_id).instance_id
|
238
|
+
|
239
|
+
sleep 5 unless VCR.current_cassette.record_mode == :none
|
240
|
+
|
241
|
+
@response = @compute.associate_address @instance_id, @floating_ip
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
after do
|
246
|
+
VCR.use_cassette "compute_associate_address" do
|
247
|
+
@compute.destroy @instance_id
|
248
|
+
@compute.release_address @floating_ip
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
it "has associated the address" do
|
253
|
+
@response.status.must_equal "Address associated."
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
describe "#disassociate_address" do
|
258
|
+
before do
|
259
|
+
VCR.use_cassette "compute_disassociate_address" do
|
260
|
+
@compute = ::Client.trunk_with(:admin).compute
|
261
|
+
|
262
|
+
@floating_ip = @compute.allocate_address.floating_ip
|
263
|
+
@instance_id = @compute.create(@image_id).instance_id
|
264
|
+
|
265
|
+
sleep 5 unless VCR.current_cassette.record_mode == :none
|
266
|
+
@compute.associate_address @instance_id, @floating_ip
|
267
|
+
|
268
|
+
sleep 5 unless VCR.current_cassette.record_mode == :none
|
269
|
+
@response = @compute.disassociate_address @floating_ip
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
after do
|
274
|
+
VCR.use_cassette "compute_disassociate_address" do
|
275
|
+
@compute.destroy @instance_id
|
276
|
+
@compute.release_address @floating_ip
|
277
|
+
end
|
278
|
+
end
|
279
|
+
|
280
|
+
it "remove the floating from instance" do
|
281
|
+
@response.status.must_equal "Address disassociated."
|
282
|
+
end
|
283
|
+
end
|
189
284
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
1
3
|
describe Nephophobia::Credential do
|
2
4
|
##
|
3
5
|
# Note:
|
@@ -6,9 +8,8 @@ describe Nephophobia::Credential do
|
|
6
8
|
# We will always have at least one project configured.
|
7
9
|
|
8
10
|
before do
|
9
|
-
@key_name
|
10
|
-
@
|
11
|
-
@credential = ::Client.with(:user).credential
|
11
|
+
@key_name = "vcr_keypair"
|
12
|
+
@credential = ::Client.with(:user).credential
|
12
13
|
end
|
13
14
|
|
14
15
|
describe "#all" do
|
@@ -74,18 +75,4 @@ describe Nephophobia::Credential do
|
|
74
75
|
@response.return.must_equal true
|
75
76
|
end
|
76
77
|
end
|
77
|
-
|
78
|
-
#describe "#download" do
|
79
|
-
# before do
|
80
|
-
# @user_name = "jd265j"
|
81
|
-
# end
|
82
|
-
|
83
|
-
# it "returns the credentials for a given 'user_name' for the specified 'project_name'." do
|
84
|
-
# VCR.use_cassette "credential_download" do
|
85
|
-
# response = @credential.download @user_name, @project_name
|
86
|
-
|
87
|
-
# response.must_match %r{BEGIN CERTIFICATE}
|
88
|
-
# end
|
89
|
-
# end
|
90
|
-
#end
|
91
78
|
end
|