Merge "Fix tempest case "test_delete_ss_from_sn_used_by_share_server""

This commit is contained in:
Jenkins 2016-01-16 19:36:56 +00:00 committed by Gerrit Code Review
commit 68cc52bb2b
1 changed files with 18 additions and 2 deletions

View File

@ -13,6 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_log import log # noqa
import six # noqa
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
@ -21,6 +23,7 @@ import testtools # noqa
from manila_tempest_tests.tests.api import base
CONF = config.CONF
LOG = log.getLogger(__name__)
class SecServicesMappingNegativeTest(base.BaseSharesTest):
@ -99,8 +102,21 @@ class SecServicesMappingNegativeTest(base.BaseSharesTest):
self.shares_client.add_sec_service_to_share_network(
fresh_sn["id"], self.ss["id"])
self.create_share(
share_network_id=fresh_sn["id"], cleanup_in_class=False)
# Security service with fake data is used, so if we use backend driver
# that fails on wrong data, we expect error here.
# We require any share that uses our share-network.
try:
self.create_share(
share_network_id=fresh_sn["id"], cleanup_in_class=False)
except Exception as e:
# we do wait for either 'error' or 'available' status because
# it is the only available statuses for proper deletion.
LOG.warning("Caught exception. It is expected in case backend "
"fails having security-service with improper data "
"that leads to share-server creation error. "
"%s" % six.text_type(e))
self.assertRaises(lib_exc.Forbidden,
self.cl.remove_sec_service_from_share_network,
fresh_sn["id"],