-
-
Save notmyname/c1d077eb652a273a804f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tempest/api/object_storage/test_object_temp_url_negative.py b/tempest/api/object_storage/test_object_temp_url_negative.py | |
index cf24f66..b053d2c 100644 | |
--- a/tempest/api/object_storage/test_object_temp_url_negative.py | |
+++ b/tempest/api/object_storage/test_object_temp_url_negative.py | |
@@ -70,9 +70,6 @@ class ObjectTempUrlNegativeTest(base.BaseObjectTest): | |
self.object_client.create_object(self.container_name, | |
self.object_name, self.data) | |
- def _get_expiry_date(self, expiration_time=1000): | |
- return int(time.time() + expiration_time) | |
- | |
def _get_temp_url(self, container, object_name, method, expires, | |
key): | |
"""Create the temporary URL.""" | |
@@ -94,14 +91,14 @@ class ObjectTempUrlNegativeTest(base.BaseObjectTest): | |
@test.requires_ext(extension='tempurl', service='object') | |
def test_get_object_after_expiration_time(self): | |
- expires = self._get_expiry_date(1) | |
+ expires = int(time.time() + 1.0) | |
# get a temp URL for the created object | |
url = self._get_temp_url(self.container_name, | |
self.object_name, "GET", | |
expires, self.key) | |
- # temp URL is valid for 1 seconds, let's wait 2 | |
- time.sleep(2) | |
+ while time.time() < expires: | |
+ time.sleep(1) | |
self.assertRaises(exceptions.Unauthorized, | |
self.object_client.get, url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment