right_aws 1.7.1 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,5 +66,30 @@ class TestS3Stubbed < Test::Unit::TestCase
66
66
  Rightscale::HttpConnection.push(403, 'Good Luck!')
67
67
  assert_raise(Rightscale::AwsError) { @s3.delete_bucket(@bucket) }
68
68
  end
69
+
70
+ def test_115_copy_key
71
+
72
+ Rightscale::HttpConnection.push(500, 'not found')
73
+ #--- test COPY
74
+ # copy a key
75
+ assert_raise RightAws::AwsError do
76
+ @s3.copy(@bucket, @key1, @bucket, @key1_copy)
77
+ end
78
+
79
+ end
80
+
81
+ def test_116_move_key
82
+ # move a key
83
+ Rightscale::HttpConnection.push(413, 'not found')
84
+ assert @s3.move(@bucket, @key1, @bucket, @key1_new_name)
85
+
86
+ end
87
+
88
+ def test_117_rename_key
89
+ # rename a key
90
+ Rightscale::HttpConnection.push(500, 'not found')
91
+ assert @s3.rename(@bucket, @key2, @key2_new_name)
92
+
93
+ end
69
94
 
70
95
  end
@@ -118,11 +118,30 @@ class TestSdb < Test::Unit::TestCase
118
118
  assert_equal items.first, @item
119
119
  end
120
120
 
121
- def test_09_delete_domain
121
+ def test_09_signature_version_0
122
+ sdb = Rightscale::SdbInterface.new(TestCredentials.aws_access_key_id, TestCredentials.aws_secret_access_key, :signature_version => '0')
123
+ item = 'toys'
124
+ # put attributes
125
+ # mhhh... Not sure how to translate this: hölzchehn klötzchen grÃŒnspan buße... Lets assume this is:
126
+ attributes = { 'Jurgen' => %w{kitten puppy chickabiddy piglet} }
127
+ assert sdb.put_attributes(@domain, item, attributes)
128
+ wait SDB_DELAY, 'after putting attributes'
129
+ # get attributes
130
+ values = sdb.get_attributes(@domain, item)[:attributes]['Jurgen'].to_a.sort
131
+ # compare to original list
132
+ assert_equal values, attributes['Jurgen'].sort
133
+ # check that the request has correct signature version
134
+ assert sdb.last_request.path.include?('SignatureVersion=0')
135
+ end
136
+
137
+ # Keep this test last, because it deletes the domain...
138
+ def test_10_delete_domain
122
139
  assert @sdb.delete_domain(@domain), 'delete_domain fail'
123
140
  wait SDB_DELAY, 'after domain deletion'
124
141
  # check that domain does not exist
125
142
  assert !@sdb.list_domains[:domains].include?(@domain)
126
143
  end
127
-
144
+
145
+
146
+
128
147
  end
@@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/test_helper.rb'
2
2
 
3
3
  class TestSqs < Test::Unit::TestCase
4
4
 
5
- GRANTEE_EMAIL_ADDRESS = 'fester@example.com'
5
+ GRANTEE_EMAIL_ADDRESS = 'madhur@amazon.com'
6
6
  RIGHT_MESSAGE_TEXT = 'Right test message'
7
7
 
8
8
 
@@ -29,6 +29,23 @@ class TestSqs < Test::Unit::TestCase
29
29
  end
30
30
  queue_url
31
31
  end
32
+
33
+
34
+
35
+
36
+ def assert_eventually_equal(value, timeout=30, failmsg="", &block)
37
+ start_time = Time.now.to_i
38
+ tries = 0
39
+ while(yield != value) do
40
+ tries += 1
41
+ print '-'
42
+ STDOUT.flush
43
+ s = Time.now.to_i - start_time
44
+ flunk("Timeout: #{failmsg}: did not equal \"#{value}\" after #{tries} tries in #{s}s.") if s > timeout
45
+ sleep(1)
46
+ setup if (tries % 10) == 0
47
+ end
48
+ end
32
49
 
33
50
 
34
51
  #---------------------------
@@ -58,7 +75,10 @@ class TestSqs < Test::Unit::TestCase
58
75
  queue_url = @sqs.queue_url_by_name(@queue_name)
59
76
  assert @sqs.set_visibility_timeout(queue_url, 222), 'Set_visibility_timeout fail'
60
77
  sleep 20 # Amazon needs some time to change attribute
61
- assert_equal 222, @sqs.get_visibility_timeout(queue_url), 'Get_visibility_timeout must return to 222'
78
+ #assert_equal 222, @sqs.get_visibility_timeout(queue_url), 'Get_visibility_timeout must return to 222'
79
+ assert_eventually_equal(222, 60, 'Get_visibility_timeout must return to 222') do
80
+ @sqs.get_visibility_timeout(queue_url)
81
+ end
62
82
  end
63
83
 
64
84
  def test_05_add_test_remove_grant
@@ -124,7 +144,9 @@ class TestSqs < Test::Unit::TestCase
124
144
  assert queue.is_a?(Rightscale::Sqs::Queue)
125
145
  wait_for_queue_url(@queue_name)
126
146
  # check that amount of queues has increased
127
- assert_equal queues_size + 1, @s.queues.size
147
+ assert_eventually_equal(queues_size + 1, 60, "The number of queues did not increase by one") do
148
+ @s.queues.size
149
+ end
128
150
  # delete queue
129
151
  assert queue.delete
130
152
  end
@@ -185,6 +207,8 @@ class TestSqs < Test::Unit::TestCase
185
207
  end
186
208
 
187
209
  def test_24_send_size
210
+ queue_url = @sqs.queue_url_by_name("#{@queue_name}_24")
211
+ @sqs.delete_queue(queue_url)
188
212
  queue = Rightscale::Sqs::Queue.create(@s, "#{@queue_name}_24", true)
189
213
  # send 5 messages
190
214
  assert queue.push('a1')
@@ -255,4 +279,13 @@ class TestSqs < Test::Unit::TestCase
255
279
  assert(newsqs.multi_thread)
256
280
  end
257
281
 
282
+ def test_29_signature_version_0
283
+ sqs = Rightscale::SqsInterface.new(TestCredentials.aws_access_key_id, TestCredentials.aws_secret_access_key, :signature_version => '0')
284
+ assert_nothing_raised do
285
+ sqs.list_queues
286
+ end
287
+ # check that the request has correct signature version
288
+ assert sqs.last_request.path.include?('SignatureVersion=0')
289
+ end
290
+
258
291
  end
@@ -197,4 +197,13 @@ class TestSqsGen2 < Test::Unit::TestCase
197
197
  assert(newsqs.multi_thread)
198
198
  end
199
199
 
200
+ def test_29_signature_version_0
201
+ sqs = Rightscale::SqsInterface.new(TestCredentials.aws_access_key_id, TestCredentials.aws_secret_access_key, :signature_version => '0')
202
+ assert_nothing_raised do
203
+ sqs.list_queues
204
+ end
205
+ # check that the request has correct signature version
206
+ assert sqs.last_request.path.include?('SignatureVersion=0')
207
+ end
208
+
200
209
  end
metadata CHANGED
@@ -1,39 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: right_aws
5
3
  version: !ruby/object:Gem::Version
6
- version: 1.7.1
7
- date: 2008-04-04 00:00:00 -07:00
8
- summary: Interface classes for the Amazon EC2, SQS, and S3 Web Services
9
- require_paths:
10
- - lib
11
- email: support@rightscale.com
12
- homepage:
13
- rubyforge_project: rightaws
14
- description: "== DESCRIPTION: The RightScale AWS gems have been designed to provide a robust, fast, and secure interface to Amazon EC2, Amazon S3, Amazon SQS, and Amazon SDB. These gems have been used in production by RightScale since late 2006 and are being maintained to track enhancements made by Amazon. The RightScale AWS gems comprise: - RightAws::Ec2 -- interface to Amazon EC2 (Elastic Compute Cloud) - RightAws::S3 and RightAws::S3Interface -- interface to Amazon S3 (Simple Storage Service) - RightAws::Sqs and RightAws::SqsInterface -- interface to first-generation Amazon SQS (Simple Queue Service) (API version 2007-05-01) - RightAws::SqsGen2 and RightAws::SqsGen2Interface -- interface to second-generation Amazon SQS (Simple Queue Service) (API version 2008-01-01) - RightAws::SdbInterface and RightAws::ActiveSdb -- interface to Amazon SDB (SimpleDB) == FEATURES:"
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 1.7.2
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - RightScale, Inc.
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-07-07 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: right_http_connection
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.2.1
23
+ version:
24
+ description: "== DESCRIPTION: The RightScale AWS gems have been designed to provide a robust, fast, and secure interface to Amazon EC2, Amazon S3, Amazon SQS, and Amazon SDB. These gems have been used in production by RightScale since late 2006 and are being maintained to track enhancements made by Amazon. The RightScale AWS gems comprise: - RightAws::Ec2 -- interface to Amazon EC2 (Elastic Compute Cloud) - RightAws::S3 and RightAws::S3Interface -- interface to Amazon S3 (Simple Storage Service) - RightAws::Sqs and RightAws::SqsInterface -- interface to first-generation Amazon SQS (Simple Queue Service) (API version 2007-05-01) - RightAws::SqsGen2 and RightAws::SqsGen2Interface -- interface to second-generation Amazon SQS (Simple Queue Service) (API version 2008-01-01) - RightAws::SdbInterface and RightAws::ActiveSdb -- interface to Amazon SDB (SimpleDB) == FEATURES:"
25
+ email: support@rightscale.com
26
+ executables: []
27
+
28
+ extensions: []
29
+
30
+ extra_rdoc_files:
31
+ - History.txt
32
+ - Manifest.txt
33
+ - README.txt
31
34
  files:
32
35
  - History.txt
33
36
  - Manifest.txt
34
37
  - README.txt
35
38
  - Rakefile
36
39
  - lib/awsbase/benchmark_fix.rb
40
+ - lib/awsbase/file_fix.rb
37
41
  - lib/awsbase/right_awsbase.rb
38
42
  - lib/awsbase/support.rb
39
43
  - lib/ec2/right_ec2.rb
@@ -60,28 +64,32 @@ files:
60
64
  - test/sqs/test_right_sqs_gen2.rb
61
65
  - test/test_credentials.rb
62
66
  - test/ts_right_aws.rb
63
- test_files:
64
- - test/ts_right_aws.rb
67
+ has_rdoc: true
68
+ homepage:
69
+ post_install_message:
65
70
  rdoc_options:
66
71
  - --main
67
72
  - README.txt
68
- extra_rdoc_files:
69
- - History.txt
70
- - Manifest.txt
71
- - README.txt
72
- executables: []
73
-
74
- extensions: []
75
-
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: "0"
80
+ version:
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: "0"
86
+ version:
76
87
  requirements: []
77
88
 
78
- dependencies:
79
- - !ruby/object:Gem::Dependency
80
- name: right_http_connection
81
- version_requirement:
82
- version_requirements: !ruby/object:Gem::Version::Requirement
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- version: 1.2.1
87
- version:
89
+ rubyforge_project: rightaws
90
+ rubygems_version: 1.0.1
91
+ signing_key:
92
+ specification_version: 2
93
+ summary: Interface classes for the Amazon EC2, SQS, and S3 Web Services
94
+ test_files:
95
+ - test/ts_right_aws.rb