@testCase("tomato.auth.cleanup", requiredFlags=["global_admin"]) def testAuthCleanupTask(_): runTask("tomato.auth.cleanup") @testCase("tomato.topology.timeout_task", requiredFlags=["global_admin"]) def testTopologyTimeoutTask(_): runTask("tomato.topology.timeout_task") @testCase("tomato.link.taskRun", requiredFlags=["global_admin"]) def testLinkStatisticsTask(_): runTask("tomato.link.taskRun") @testCase("tomato.elements.*.syncRexTFV", requiredFlags=["global_admin"]) def testRexTFVTask(_): runTask("tomato.elements.openvz.syncRexTFV") runTask("tomato.elements.kvmqm.syncRexTFV") tests = [ testAccountingTask, testHostSyncTask, testHostComponentSyncTask, testAuthCleanupTask, testTopologyTimeoutTask, testLinkStatisticsTask, testRexTFVTask ] if __name__ == "__main__": testSuite(tests)
@testCase("api.topology_import", setUp=setUp, tearDown=tearDown) def testTopologyImport(topId): createStarTopology(topId, 3) print "Exporting topology..." data = topology_export(topId) print "Importing topology..." (top_id, elements, connections, errors) = topology_import(data) topology_remove(top_id) assert not errors, "Import resulted in errors: %s" % errors assert len(elements) == 10, "Imported topology was malformed" assert len(connections) == 3, "Imported topology was malformed" @testCase("api.topology_usage", setUp=setUp, tearDown=tearDown) def testTopologyUsage(topId): print "Fetching resource statistics..." usage = topology_usage(topId) tests = [ testTopologyPermissions, testTopologyModify, testTopologyInfo, testTopologyAction, testTopologyList, testTopologyExport, testTopologyImport, testTopologyUsage, ] if __name__ == "__main__": testSuite(tests)
from lib.tests import testSuite import all if __name__ == "__main__": testSuite(all.tests, automated=True)