Integrating PyTest contained in SNAPS as a replacement to the old
[functest.git] / functest / opnfv_tests / openstack / snaps / api_check.py
1 # Copyright (c) 2015 All rights reserved
2 # This program and the accompanying materials
3 # are made available under the terms of the Apache License, Version 2.0
4 # which accompanies this distribution, and is available at
5 #
6 # http://www.apache.org/licenses/LICENSE-2.0
7
8 import unittest
9
10 from snaps import test_suite_builder
11
12 from functest.core.pytest_suite_runner import PyTestSuiteRunner
13 from functest.opnfv_tests.openstack.snaps import snaps_utils
14 from functest.utils.constants import CONST
15
16
17 class ApiCheck(PyTestSuiteRunner):
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):
24         super(ApiCheck, self).__init__()
25
26         self.suite = unittest.TestSuite()
27         self.case_name = "api_check"
28         ext_net_name = snaps_utils.get_ext_net_name()
29
30         test_suite_builder.add_openstack_api_tests(
31             self.suite,
32             CONST.openstack_creds,
33             ext_net_name,
34             use_keystone=CONST.snaps_use_keystone)