nephophobia 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/README.md +4 -0
  2. data/lib/nephophobia/client.rb +3 -3
  3. data/lib/nephophobia/compute.rb +70 -2
  4. data/lib/nephophobia/credential.rb +0 -19
  5. data/lib/nephophobia/project.rb +3 -0
  6. data/lib/nephophobia/role.rb +3 -0
  7. data/lib/nephophobia/user.rb +20 -0
  8. data/lib/nephophobia/version.rb +1 -1
  9. data/nephophobia.gemspec +2 -2
  10. data/test/cassettes/compute_allocate_address.yml +55 -0
  11. data/test/cassettes/compute_allocate_address_when_not_available.yml +30 -0
  12. data/test/cassettes/compute_associate_address.yml +136 -0
  13. data/test/cassettes/compute_disassociate_address.yml +163 -0
  14. data/test/cassettes/compute_release_address.yml +55 -0
  15. data/test/cassettes/project_add_member.yml +12 -12
  16. data/test/cassettes/project_all.yml +3 -3
  17. data/test/cassettes/project_all_with_user_name.yml +22 -22
  18. data/test/cassettes/project_create.yml +12 -12
  19. data/test/cassettes/project_destroy.yml +12 -12
  20. data/test/cassettes/project_find.yml +3 -3
  21. data/test/cassettes/project_find_with_invalid_project_name.yml +3 -3
  22. data/test/cassettes/project_member.yml +16 -16
  23. data/test/cassettes/project_members.yml +10 -10
  24. data/test/cassettes/project_members_with_invalid_project_name.yml +3 -3
  25. data/test/cassettes/project_remove_member.yml +12 -12
  26. data/test/cassettes/role_all.yml +15 -15
  27. data/test/cassettes/role_all_with_project_name.yml +15 -15
  28. data/test/cassettes/role_all_without_roles.yml +12 -12
  29. data/test/cassettes/role_create.yml +12 -12
  30. data/test/cassettes/role_create_with_project_name.yml +12 -12
  31. data/test/cassettes/role_create_with_project_name_and_role_name.yml +12 -12
  32. data/test/cassettes/role_destroy.yml +12 -12
  33. data/test/cassettes/role_destroy_with_project_name.yml +12 -12
  34. data/test/cassettes/role_destroy_with_project_name_and_role_name.yml +12 -12
  35. data/test/cassettes/user_create.yml +6 -6
  36. data/test/cassettes/user_credentials.yml +190 -0
  37. data/test/cassettes/user_destroy.yml +6 -6
  38. data/test/cassettes/user_find.yml +9 -9
  39. data/test/cassettes/user_find_with_invalid_user_name.yml +3 -3
  40. data/test/cassettes/user_register.yml +19 -19
  41. data/test/cassettes/user_register_asserts.yml +10 -10
  42. data/test/lib/nephophobia/compute_test.rb +104 -9
  43. data/test/lib/nephophobia/credential_test.rb +4 -17
  44. data/test/lib/nephophobia/user_test.rb +31 -0
  45. data/test/test_helper.rb +11 -0
  46. 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/?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=nthXQq43tPrgjgiuaeCImXCS3kfDdv47YuT6tzxZ6wg%3D
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
- - Mon, 18 Apr 2011 22:53:40 GMT
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>UNI2KGM7LXOUZIXV67PQ</requestId><username>vcr_user</username><secretkey>bcba99a9-c701-4ee8-bfe4-d6ef6ff2ba14</secretkey><accesskey>2854d530-ddf2-4c88-8ce0-5ac476f759e8</accesskey><file/></RegisterUserResponse>
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/?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=aa2vpTcy0i2JfYcxUgDitUVqb3aPgH1FzgCcbQc2D5E%3D
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
- - Mon, 18 Apr 2011 22:53:40 GMT
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>6-8PQOR01HAGKCLS0X3U</requestId><return>true</return></DeregisterUserResponse>
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/?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=nthXQq43tPrgjgiuaeCImXCS3kfDdv47YuT6tzxZ6wg%3D
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
- - Mon, 18 Apr 2011 22:58:04 GMT
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>B9XZ65Z8MJLV32J2BUP8</requestId><username>vcr_user</username><secretkey>8419a43b-50d6-46b0-94d8-72d930c22bc8</secretkey><accesskey>dd31a057-2276-4261-b67b-7dcf969f593e</accesskey><file/></RegisterUserResponse>
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/?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=k9UF0F%2FnnB9rUpJwW0NaSJelQRaqIV29yfvi%2FBWQ8kc%3D
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
- - Mon, 18 Apr 2011 22:58:05 GMT
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>E4X7TED-6ZFQ8FNBP918</requestId><username>vcr_user</username><secretkey>8419a43b-50d6-46b0-94d8-72d930c22bc8</secretkey><accesskey>dd31a057-2276-4261-b67b-7dcf969f593e</accesskey><file/></DescribeUserResponse>
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/?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=aa2vpTcy0i2JfYcxUgDitUVqb3aPgH1FzgCcbQc2D5E%3D
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
- - Mon, 18 Apr 2011 22:58:05 GMT
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>82MH0H6W2AXWDHY9DPUP</requestId><return>true</return></DeregisterUserResponse>
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/?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=Bmnub9I3Q0vIRkNMdguJV1urWPKgBptH%2FP03QwgMwyk%3D
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
- - Mon, 18 Apr 2011 23:01:30 GMT
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>IN7NL6AYPJ72GJ2L322-</RequestID></Response>
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/?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=nthXQq43tPrgjgiuaeCImXCS3kfDdv47YuT6tzxZ6wg%3D
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
- - Mon, 18 Apr 2011 23:10:48 GMT
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>OG90036AOAHF32-MF9E7</requestId><username>vcr_user</username><secretkey>18d07853-b56a-4a67-a131-3f39043254e9</secretkey><accesskey>c2214fcf-bf30-4c17-8970-488b96344caa</accesskey><file/></RegisterUserResponse>
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/?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=TNzeGrVLbfQ8DFlrUFUA7poSyY69GIrLZd%2FZX3RDfno%3D
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
- - "376"
49
+ - "592"
50
50
  date:
51
- - Mon, 18 Apr 2011 23:10:48 GMT
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>VEFIU8XXKN66KVJDD4A-</requestId><members><item><member>root</member></item><item><member>jk520u</member></item><item><member>jd265j</member></item><item><member>kb718q</member></item><item><member>pe623x</member></item></members></DescribeProjectMembersResponse>
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/?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=nwaWtt4r1uicUNAcS1KYOWuwv94o0HiTcFfMoh3jM6o%3D
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
- - Mon, 18 Apr 2011 23:10:49 GMT
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>JFV25BUF0LYDPDCZOHG2</requestId><return>true</return></ModifyUserRoleResponse>
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/?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=SpZpNjE%2FU%2F4WE8bj34u34Ooc0ObM0R%2FJOfWcU228g8s%3D
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
- - Mon, 18 Apr 2011 23:10:49 GMT
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>PFL3J5Z0TQUO3COG733Z</requestId><return>true</return></ModifyUserRoleResponse>
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/?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=IrvE46vanO2TpR4KZT%2FTyvmyERyATesOdA9iY8Wxlmo%3D
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
- - Mon, 18 Apr 2011 23:10:49 GMT
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>L8UXNC2P810RA-P1Z-KJ</requestId><return>true</return></ModifyProjectMemberResponse>
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/?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=aa2vpTcy0i2JfYcxUgDitUVqb3aPgH1FzgCcbQc2D5E%3D
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
- - Mon, 18 Apr 2011 23:10:51 GMT
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>HTMVVLNLJMWJCRV82NJY</requestId><return>true</return></DeregisterUserResponse>
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/?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=XwheiYoIglQYt3%2BRvx8MckigXMm8omhhgpwvpJh9f7g%3D
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
- - Mon, 18 Apr 2011 23:10:50 GMT
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>W4RZ02Y3V95IREHB3UR3</requestId><roles><item><role>sysadmin</role></item></roles></DescribeUserRolesResponse>
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/?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=vnaYLhtJUGql3OrZXEngRuoYHKVjiN%2FV5sEY56vEooM%3D
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
- - Mon, 18 Apr 2011 23:10:50 GMT
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>QXUV-VPEMBWZ9FI8L5KM</requestId><roles><item><role>sysadmin</role></item></roles></DescribeUserRolesResponse>
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/?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=TNzeGrVLbfQ8DFlrUFUA7poSyY69GIrLZd%2FZX3RDfno%3D
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
- - "414"
76
+ - "630"
77
77
  date:
78
- - Mon, 18 Apr 2011 23:10:50 GMT
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>XH25DDUVLFK-MAU9SZ2F</requestId><members><item><member>root</member></item><item><member>jk520u</member></item><item><member>jd265j</member></item><item><member>kb718q</member></item><item><member>pe623x</member></item><item><member>vcr_user</member></item></members></DescribeProjectMembersResponse>
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 = "vcr_keypair"
10
- @project_name = "sandbox"
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