Merge "Add possibility to suppress errors in Tempest plugin cleanup"
This commit is contained in:
commit
67ccd12e42
@ -25,6 +25,9 @@ if [[ "$1" =~ "multibackend" ]]; then
|
|||||||
|
|
||||||
# backend names are defined in pre_test_hook
|
# backend names are defined in pre_test_hook
|
||||||
iniset $BASE/new/tempest/etc/tempest.conf share backend_names "LONDON,PARIS"
|
iniset $BASE/new/tempest/etc/tempest.conf share backend_names "LONDON,PARIS"
|
||||||
|
|
||||||
|
# Suppress errors in cleanup of resources
|
||||||
|
iniset $BASE/new/tempest/etc/tempest.conf share suppress_errors_in_cleanup True
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# let us control if we die or not
|
# let us control if we die or not
|
||||||
|
@ -21,9 +21,11 @@ from tempest.common.utils import data_utils
|
|||||||
from tempest import config_share as config
|
from tempest import config_share as config
|
||||||
from tempest import exceptions
|
from tempest import exceptions
|
||||||
from tempest.openstack.common import lockutils
|
from tempest.openstack.common import lockutils
|
||||||
|
from tempest.openstack.common import log as logging
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class BaseSharesTest(test.BaseTestCase):
|
class BaseSharesTest(test.BaseTestCase):
|
||||||
@ -378,6 +380,12 @@ class BaseSharesTest(test.BaseTestCase):
|
|||||||
pass
|
pass
|
||||||
except exceptions.Unauthorized:
|
except exceptions.Unauthorized:
|
||||||
pass
|
pass
|
||||||
|
except Exception as e:
|
||||||
|
# Catch all other exceptions
|
||||||
|
if not CONF.share.suppress_errors_in_cleanup:
|
||||||
|
raise e
|
||||||
|
else:
|
||||||
|
LOG.error("Suppressed cleanup error: %s" % e)
|
||||||
res["deleted"] = True
|
res["deleted"] = True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -89,6 +89,11 @@ ShareGroup = [
|
|||||||
default=500,
|
default=500,
|
||||||
help="Timeout in seconds to wait for a share to become"
|
help="Timeout in seconds to wait for a share to become"
|
||||||
"available."),
|
"available."),
|
||||||
|
cfg.BoolOpt("suppress_errors_in_cleanup",
|
||||||
|
default=False,
|
||||||
|
help="Whether to suppress errors with clean up operation "
|
||||||
|
"or not. There are cases when we may want to skip "
|
||||||
|
"such errors and catch only test errors."),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user