deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [2/4] git commit: EC2: Added tests for the storage_volumes collection
Date Mon, 13 Aug 2012 14:39:23 GMT
EC2: Added tests for the storage_volumes collection


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/c487f555
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/c487f555
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/c487f555

Branch: refs/heads/master
Commit: c487f5552e890b1737bb303264f1140ac650e90a
Parents: 82a3253
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Mon Aug 13 15:11:59 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Mon Aug 13 16:39:49 2012 +0200

----------------------------------------------------------------------
 server/lib/deltacloud/api.rb                       |    1 +
 server/lib/deltacloud/models/storage_snapshot.rb   |    4 +
 server/tests/drivers/ec2/common.rb                 |    4 +
 ...001_must_throw_error_when_wrong_credentials.yml |  144 +-
 ..._0002_must_return_list_of_storage_snapshots.yml |20717 +++++++++++++++
 ...0003_must_allow_to_filter_storage_snapshots.yml |  179 +
 ..._create_and_destroy_the_storage_snapshot-10.yml |   38 +
 ...o_create_and_destroy_the_storage_snapshot-9.yml |   35 +
 ..._to_create_and_destroy_the_storage_snapshot.yml |  135 +
 server/tests/drivers/ec2/storage_snapshots_test.rb |   54 +
 10 files changed, 21272 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/c487f555/server/lib/deltacloud/api.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/api.rb b/server/lib/deltacloud/api.rb
index 56416bc..ed3d4e4 100644
--- a/server/lib/deltacloud/api.rb
+++ b/server/lib/deltacloud/api.rb
@@ -63,6 +63,7 @@ end
 
 class Instance; include TestPoller; end
 class Image; include TestPoller; end
+class StorageSnapshot; include TestPoller; end
 
 module Deltacloud
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/c487f555/server/lib/deltacloud/models/storage_snapshot.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/models/storage_snapshot.rb b/server/lib/deltacloud/models/storage_snapshot.rb
index 0f133f2..ee7e4b8 100644
--- a/server/lib/deltacloud/models/storage_snapshot.rb
+++ b/server/lib/deltacloud/models/storage_snapshot.rb
@@ -22,4 +22,8 @@ class StorageSnapshot < BaseModel
   attr_accessor :storage_volume_id
   attr_accessor :created
 
+  def is_completed?
+    state == 'completed'
+  end
+
 end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/c487f555/server/tests/drivers/ec2/common.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/common.rb b/server/tests/drivers/ec2/common.rb
index c7a8249..aa2d790 100644
--- a/server/tests/drivers/ec2/common.rb
+++ b/server/tests/drivers/ec2/common.rb
@@ -16,6 +16,10 @@ def credentials
   }
 end
 
+unless Time.respond_to? :be
+  require_relative '../../test_helper.rb'
+end
+
 Time.be(DateTime.parse("2012-07-30 11:05:00 +0000").to_s)
 
 VCR.configure do |c|

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/c487f555/server/tests/drivers/ec2/fixtures/test_0001_must_throw_error_when_wrong_credentials.yml
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/fixtures/test_0001_must_throw_error_when_wrong_credentials.yml
b/server/tests/drivers/ec2/fixtures/test_0001_must_throw_error_when_wrong_credentials.yml
index 6ce0384..4ef464a 100644
--- a/server/tests/drivers/ec2/fixtures/test_0001_must_throw_error_when_wrong_credentials.yml
+++ b/server/tests/drivers/ec2/fixtures/test_0001_must_throw_error_when_wrong_credentials.yml
@@ -1,57 +1,123 @@
---- 
-recorded_with: VCR 2.2.4
-http_interactions: 
-- request: 
+---
+http_interactions:
+- request:
     method: get
     uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=unknown&Action=DescribeAvailabilityZones&Signature=RKydNEtx7th3j3t9odsCkpZS6zBYc7ooilLwma/bxNk=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
-    body: 
-      string: ""
-    headers: 
-      Accept: 
-      - "*/*"
-      User-Agent: 
-      - ""
-  response: 
-    status: 
+    body:
+      encoding: UTF-8
+      string: ''
+    headers:
+      Accept:
+      - ! '*/*'
+      User-Agent:
+      - ''
+  response:
+    status:
       code: 401
       message: Unauthorized
-    headers: 
-      Server: 
+    headers:
+      Server:
       - AmazonEC2
-      Transfer-Encoding: 
+      Transfer-Encoding:
       - chunked
-      Date: 
+      Date:
       - Mon, 30 Jul 2012 11:05:04 GMT
-    body: 
-      string: |-
-        <?xml version="1.0" encoding="UTF-8"?>
-        <Response><Errors><Error><Code>AuthFailure</Code><Message>AWS
was not able to validate the provided access credentials</Message></Error></Errors><RequestID>d6332a66-1bac-4843-80e4-5bcb65fe4ff5</RequestID></Response>
+    body:
+      encoding: UTF-8
+      string: ! '<?xml version="1.0" encoding="UTF-8"?>
+
+        <Response><Errors><Error><Code>AuthFailure</Code><Message>AWS
was not able
+        to validate the provided access credentials</Message></Error></Errors><RequestID>d6332a66-1bac-4843-80e4-5bcb65fe4ff5</RequestID></Response>'
     http_version: 
   recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
-- request: 
+- request:
     method: get
     uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=unknown&Action=DescribeImages&Filter.1.Name=image-type&Filter.1.Value.1=machine&Owner.1=amazon&Signature=vit58ypcZUlSmYqIVpXK2/HftGjsyMVoYsjVua3hOZ4=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-07-30T11:05:00.000Z&Version=2010-08-31
-    body: 
-      string: ""
-    headers: 
-      User-Agent: 
-      - ""
-      Accept: 
-      - "*/*"
-  response: 
-    status: 
+    body:
+      encoding: UTF-8
+      string: ''
+    headers:
+      User-Agent:
+      - ''
+      Accept:
+      - ! '*/*'
+  response:
+    status:
       code: 401
       message: Unauthorized
-    headers: 
-      Transfer-Encoding: 
+    headers:
+      Transfer-Encoding:
       - chunked
-      Server: 
+      Server:
       - AmazonEC2
-      Date: 
+      Date:
       - Mon, 30 Jul 2012 11:05:16 GMT
-    body: 
-      string: |-
-        <?xml version="1.0" encoding="UTF-8"?>
-        <Response><Errors><Error><Code>AuthFailure</Code><Message>AWS
was not able to validate the provided access credentials</Message></Error></Errors><RequestID>ee56f88b-4548-4964-92c6-5a534bb8afb0</RequestID></Response>
+    body:
+      encoding: UTF-8
+      string: ! '<?xml version="1.0" encoding="UTF-8"?>
+
+        <Response><Errors><Error><Code>AuthFailure</Code><Message>AWS
was not able
+        to validate the provided access credentials</Message></Error></Errors><RequestID>ee56f88b-4548-4964-92c6-5a534bb8afb0</RequestID></Response>'
     http_version: 
   recorded_at: Mon, 30 Jul 2012 11:05:00 GMT
+- request:
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=unknown&Action=DescribeImages&Filter.1.Name=image-type&Filter.1.Value.1=machine&Owner.1=amazon&Signature=q2q1o3MFJ5zA0wSCNjIlnTCTtE9R2Dfr90+z0s7Yeq8=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-13T12:47:00.000Z&Version=2010-08-31
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - ! '*/*'
+      User-Agent:
+      - ''
+  response:
+    status:
+      code: 401
+      message: Unauthorized
+    headers:
+      Transfer-Encoding:
+      - chunked
+      Date:
+      - Mon, 13 Aug 2012 12:46:39 GMT
+      Server:
+      - AmazonEC2
+    body:
+      encoding: US-ASCII
+      string: ! '<?xml version="1.0" encoding="UTF-8"?>
+
+        <Response><Errors><Error><Code>AuthFailure</Code><Message>AWS
was not able
+        to validate the provided access credentials</Message></Error></Errors><RequestID>bfa1a6ed-76f4-46d1-9857-d71359ed8c9d</RequestID></Response>'
+    http_version: 
+  recorded_at: Mon, 13 Aug 2012 12:47:00 GMT
+- request:
+    method: get
+    uri: https://ec2.us-east-1.amazonaws.com/?AWSAccessKeyId=unknown&Action=DescribeImages&Filter.1.Name=image-type&Filter.1.Value.1=machine&Owner.1=amazon&Signature=JWBfs00rK+BBzk5fUD1Y6oR3FMzQ0umMXcpcNxPtSpw=&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-08-13T13:03:00.000Z&Version=2010-08-31
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - ! '*/*'
+      User-Agent:
+      - ''
+  response:
+    status:
+      code: 401
+      message: Unauthorized
+    headers:
+      Transfer-Encoding:
+      - chunked
+      Date:
+      - Mon, 13 Aug 2012 13:03:15 GMT
+      Server:
+      - AmazonEC2
+    body:
+      encoding: US-ASCII
+      string: ! '<?xml version="1.0" encoding="UTF-8"?>
+
+        <Response><Errors><Error><Code>AuthFailure</Code><Message>AWS
was not able
+        to validate the provided access credentials</Message></Error></Errors><RequestID>703a80de-c0e3-4c73-8c80-e70afcada61d</RequestID></Response>'
+    http_version: 
+  recorded_at: Mon, 13 Aug 2012 13:03:00 GMT
+recorded_with: VCR 2.2.4


Mime
View raw message