1fc49349e68934dd73b58531a84b9642b2275292
[functest-xtesting.git] / functest / opnfv_tests / openstack / snaps / connection_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 functest.opnfv_tests.openstack.snaps import snaps_suite_builder
12 from functest.opnfv_tests.openstack.snaps.snaps_test_runner import \
13     SnapsTestRunner
14
15
16 class ConnectionCheck(SnapsTestRunner):
17     """
18     This test executes the Python Tests included with the SNAPS libraries
19     that simply obtain the different OpenStack clients and may perform
20     simple queries
21     """
22     def __init__(self, **kwargs):
23         if "case_name" not in kwargs:
24             kwargs["case_name"] = "connection_check"
25         super(ConnectionCheck, self).__init__(**kwargs)
26
27         self.suite = unittest.TestSuite()
28
29     def run(self, **kwargs):
30         """
31         Builds the test suite then calls super.run()
32         :param kwargs: the arguments to pass on
33         :return:
34         """
35         snaps_suite_builder.add_openstack_client_tests(
36             suite=self.suite,
37             os_creds=self.os_creds,
38             ext_net_name=self.ext_net_name,
39             use_keystone=self.use_keystone)
40         return super(self.__class__, self).run()