Merge "Several fixies to tempest plugin"

This commit is contained in:
Jenkins 2014-06-05 08:38:26 +00:00 committed by Gerrit Code Review
commit 3a67172141
2 changed files with 11 additions and 14 deletions

View File

@ -61,8 +61,9 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
# All expected keys are present
for key in keys:
self.assertIn(key, server.keys())
# 'Updated at' is valid date
self.assertTrue(self.date_re.match(server["updated_at"]))
# 'Updated at' is valid date if set
if server["updated_at"]:
self.assertTrue(self.date_re.match(server["updated_at"]))
# Host is not empty
self.assertTrue(len(server["host"]) > 0)
# Id is not empty
@ -71,8 +72,11 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
self.assertTrue(len(server["project_id"]) > 0)
# Server we used is present
# allow 'creating' status too, because there can be
# another server with same requirements.
any((s["share_network_name"] in self.sn_name_and_id and
self.assertEqual(s["status"].lower(), "active")) for s in servers)
self.assertIn(s["status"].lower(),
["active", "creating"])) for s in servers)
@test.attr(type=["gate", "smoke", ])
def test_list_share_servers_with_host_filter(self):
@ -176,8 +180,9 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
self.assertIn(key, server.keys())
# 'created_at' is valid date
self.assertTrue(self.date_re.match(server["created_at"]))
# 'updated_at' is valid date
self.assertTrue(self.date_re.match(server["updated_at"]))
# 'updated_at' is valid date if set
if server["updated_at"]:
self.assertTrue(self.date_re.match(server["updated_at"]))
# Host is not empty
self.assertTrue(len(server["host"]) > 0)
# Id is not empty

View File

@ -21,7 +21,7 @@ class ShareBuildErrorException(exceptions.TempestException):
class AccessRuleBuildErrorException(exceptions.TempestException):
message = "Share's rule with id %(rule_id) is in ERROR status"
message = "Share's rule with id %(rule_id)s is in ERROR status"
class SnapshotBuildErrorException(exceptions.TempestException):
@ -42,11 +42,3 @@ class NoAvailableNetwork(exceptions.TempestException):
class InvalidResource(exceptions.TempestException):
message = "Provided invalid resource: %(message)s"
class ShareNetworkActivationFailed(exceptions.TempestException):
message = "Share-network with id %(sn_id)s failed to activate"
class ShareNetworkDeactivationFailed(exceptions.TempestException):
message = "Share-network with id %(sn_id)s failed to deactivate"