Add API query test for Swift

This test will be useful in gauging API availability for Swift during
upgrades

Change-Id: I1e5ac7ab1cfed15771fdb205d5736da206929bc6
This commit is contained in:
Nolan Brubaker 2017-06-05 13:09:47 -04:00
parent 9ba0e9a2a2
commit 54f91a1b2f

View File

@ -218,6 +218,20 @@ class CinderTest(ServiceTest):
return msg
class SwiftTest(ServiceTest):
service_name = 'swift'
description = 'Query for a list of containers'
def run(self):
containers = self.get_objects('object_store', 'containers')
msg = 'API reached, no containers found'
if containers:
msg = 'Container list received'
return msg
class TestRunner(object):
"""Run a test in a loop, with the option to gracefully exit"""
stop_now = False
@ -311,6 +325,7 @@ available_tests = {
'nova': NovaTest,
'neutron': NeutronTest,
'cinder': CinderTest,
'swift': SwiftTest,
}