From f319c412acd0c2b2aae7e1bb1ae92f217859d839 Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Tue, 5 Feb 2019 16:48:48 +0000 Subject: [PATCH] Fix flakey symlink setup/teardown Change-Id: I63c86619eb1fe89f2748882a490fb102872ad46f --- test/functional/test_symlink.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/functional/test_symlink.py b/test/functional/test_symlink.py index d21ab132b1..cfc0031b2c 100755 --- a/test/functional/test_symlink.py +++ b/test/functional/test_symlink.py @@ -23,6 +23,7 @@ import time from six.moves import urllib from uuid import uuid4 +from swift.common.http import is_success from swift.common.utils import json, MD5_OF_EMPTY_STRING from swift.common.middleware.slo import SloGetContext from test.functional import check_response, retry, requires_acls, \ @@ -94,7 +95,7 @@ class TestSymlinkEnv(BaseEnv): headers = headers or {} resp = retry(cls._make_request, method='PUT', container=name, headers=headers, use_account=use_account) - if resp.status != 201: + if resp.status not in (201, 202): raise ResponseError(resp) return name @@ -132,7 +133,7 @@ class TestSymlinkEnv(BaseEnv): use_account=use_account) if resp.status == 404: break - if resp.status // 100 != 2: + if not is_success(resp.status): raise ResponseError(resp) objs = json.loads(resp.content) if not objs: @@ -141,7 +142,7 @@ class TestSymlinkEnv(BaseEnv): resp = retry(cls._make_request, method='DELETE', container=container, obj=obj['name'], use_account=use_account) - if (resp.status != 204): + if resp.status not in (204, 404): raise ResponseError(resp) # delete the containers