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