mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-28 19:31:39 +00:00
replace datetime.now with datetime.utcnow()
when the local timezone is not UTC and if it is a day behind,
lifecycle_header tests fails with 2 days not equal to 1
so replacing datetime.now() with datetime.utcnow()
Signed-off-by: Ali Maredia <amaredia@redhat.com>
(cherry picked from commit 4744808eda
)
This commit is contained in:
parent
e0503c9fcd
commit
10fcfbea4c
1 changed files with 3 additions and 3 deletions
|
@ -8475,7 +8475,7 @@ def test_lifecycle_expiration_header_put():
|
||||||
bucket_name = get_new_bucket()
|
bucket_name = get_new_bucket()
|
||||||
client = get_client()
|
client = get_client()
|
||||||
|
|
||||||
now = datetime.datetime.now(None)
|
now = datetime.datetime.utcnow()
|
||||||
response = setup_lifecycle_expiration(
|
response = setup_lifecycle_expiration(
|
||||||
client, bucket_name, 'rule1', 1, 'days1/')
|
client, bucket_name, 'rule1', 1, 'days1/')
|
||||||
assert check_lifecycle_expiration_header(response, now, 'rule1', 1)
|
assert check_lifecycle_expiration_header(response, now, 'rule1', 1)
|
||||||
|
@ -8487,7 +8487,7 @@ def test_lifecycle_expiration_header_head():
|
||||||
bucket_name = get_new_bucket()
|
bucket_name = get_new_bucket()
|
||||||
client = get_client()
|
client = get_client()
|
||||||
|
|
||||||
now = datetime.datetime.now(None)
|
now = datetime.datetime.utcnow()
|
||||||
response = setup_lifecycle_expiration(
|
response = setup_lifecycle_expiration(
|
||||||
client, bucket_name, 'rule1', 1, 'days1/')
|
client, bucket_name, 'rule1', 1, 'days1/')
|
||||||
|
|
||||||
|
@ -8558,7 +8558,7 @@ def test_lifecycle_expiration_header_tags_head():
|
||||||
@pytest.mark.lifecycle_expiration
|
@pytest.mark.lifecycle_expiration
|
||||||
@pytest.mark.fails_on_dbstore
|
@pytest.mark.fails_on_dbstore
|
||||||
def test_lifecycle_expiration_header_and_tags_head():
|
def test_lifecycle_expiration_header_and_tags_head():
|
||||||
now = datetime.datetime.now(None)
|
now = datetime.datetime.utcnow()
|
||||||
bucket_name = get_new_bucket()
|
bucket_name = get_new_bucket()
|
||||||
client = get_client()
|
client = get_client()
|
||||||
lifecycle={
|
lifecycle={
|
||||||
|
|
Loading…
Reference in a new issue