b8cd4fdd442bd125af134aa2d57d4a0b046339eb
[functest.git] / functest / opnfv_tests / openstack / snaps / api_check.py
1 #!/usr/bin/env python
2
3 # Copyright (c) 2017 Cable Television Laboratories, Inc. and others.
4 #
5 # This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10
11 """api_check test case implementation"""
12
13 import unittest
14
15 from functest.opnfv_tests.openstack.snaps import snaps_suite_builder
16 from functest.opnfv_tests.openstack.snaps.snaps_test_runner import \
17     SnapsTestRunner
18
19
20 class ApiCheck(SnapsTestRunner):
21     """
22     This test executes the Python Tests included with the SNAPS libraries
23     that exercise many of the OpenStack APIs within Keystone, Glance, Neutron,
24     and Nova
25     """
26     def __init__(self, **kwargs):
27         if "case_name" not in kwargs:
28             kwargs["case_name"] = "api_check"
29         super(ApiCheck, self).__init__(**kwargs)
30
31         self.suite = unittest.TestSuite()
32
33     def run(self, **kwargs):
34         """
35         Builds the test suite then calls super.run()
36         :param kwargs: the arguments to pass on
37         :return:
38         """
39         snaps_suite_builder.add_openstack_api_tests(
40             suite=self.suite,
41             os_creds=self.os_creds,
42             ext_net_name=self.ext_net_name,
43             use_keystone=self.use_keystone,
44             image_metadata=self.image_metadata)
45         return super(ApiCheck, self).run()