1 # Copyright (c) 2017 Cable Television Laboratories, Inc. and others.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
12 from snaps import test_suite_builder
14 from functest.opnfv_tests.openstack.snaps.snaps_test_runner import \
16 from functest.utils.constants import CONST
19 class SnapsSmoke(SnapsTestRunner):
21 This test executes the Python Tests included with the SNAPS libraries
22 that exercise many of the OpenStack APIs within Keystone, Glance, Neutron,
25 def __init__(self, **kwargs):
26 if "case_name" not in kwargs:
27 kwargs["case_name"] = "snaps_smoke"
28 super(SnapsSmoke, self).__init__(**kwargs)
30 self.suite = unittest.TestSuite()
32 def run(self, **kwargs):
34 Builds the test suite then calls super.run()
35 :param kwargs: the arguments to pass on
39 if hasattr(CONST, 'snaps_images_cirros'):
40 image_config = CONST.__getattribute__('snaps_images_cirros')
42 # Tests requiring floating IPs leverage files contained within the
43 # SNAPS repository and are found relative to that path
45 snaps_dir = os.path.join(CONST.__getattribute__('dir_repo_snaps'),
49 test_suite_builder.add_openstack_integration_tests(
51 os_creds=self.os_creds,
52 ext_net_name=self.ext_net_name,
53 use_keystone=self.use_keystone,
54 flavor_metadata=self.flavor_metadata,
55 image_metadata=image_config,
56 use_floating_ips=self.use_fip)
57 return super(self.__class__, self).run()