[ARVADOS] updated: 899af276f73189b0581b65c6d77b19f5c041312a
Git user
git at public.curoverse.com
Thu Apr 21 11:00:45 EDT 2016
Summary of changes:
services/api/test/unit/blob_test.rb | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
via 899af276f73189b0581b65c6d77b19f5c041312a (commit)
from 5784c9a32528a7795181a837660f7f21a7393cce (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 899af276f73189b0581b65c6d77b19f5c041312a
Author: radhika <radhika at curoverse.com>
Date: Thu Apr 21 11:00:11 2016 -0400
8936: update the blob_test to use a specific blob_signature_ttl to ensure consistent results.
diff --git a/services/api/test/unit/blob_test.rb b/services/api/test/unit/blob_test.rb
index 707056d..29635e2 100644
--- a/services/api/test/unit/blob_test.rb
+++ b/services/api/test/unit/blob_test.rb
@@ -17,21 +17,27 @@ class BlobTest < ActiveSupport::TestCase
'vu5wm9fpnwjyxfldw3vbo01mgjs75rgo7qioh8z8ij7jpyp8508okhgbbex3ceei' +
'786u5rw2a9gx743dj3fgq2irk'
@@known_signed_locator = 'acbd18db4cc2f85cedef654fccc4a4d8+3' +
- '+A44362129a92a48d02b2e0789c597f970f3b1faf3 at 7fffffff'
+ '+A89118b78732c33104a4d6231e8b5a5fa1e4301e3 at 7fffffff'
test 'generate predictable invincible signature' do
+ original_ttl = Rails.configuration.blob_signature_ttl
+ Rails.configuration.blob_signature_ttl = 1209600
signed = Blob.sign_locator @@known_locator, {
api_token: @@known_token,
key: @@known_key,
expire: 0x7fffffff,
}
assert_equal @@known_signed_locator, signed
+ Rails.configuration.blob_signature_ttl = original_ttl
end
test 'verify predictable invincible signature' do
+ original_ttl = Rails.configuration.blob_signature_ttl
+ Rails.configuration.blob_signature_ttl = 1209600
assert_equal true, Blob.verify_signature!(@@known_signed_locator,
api_token: @@known_token,
key: @@known_key)
+ Rails.configuration.blob_signature_ttl = original_ttl
end
test 'correct' do
@@ -125,7 +131,6 @@ class BlobTest < ActiveSupport::TestCase
key: @@known_key,
expire: 0x7fffffff,
}
- assert_equal @@known_signed_locator, signed
original_ttl = Rails.configuration.blob_signature_ttl
Rails.configuration.blob_signature_ttl = original_ttl*2
@@ -135,6 +140,7 @@ class BlobTest < ActiveSupport::TestCase
expire: 0x7fffffff,
}
Rails.configuration.blob_signature_ttl = original_ttl
+
assert_not_equal signed, signed2
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list