3 # Copyright (c) 2017 Cable Television Laboratories, Inc. and others.
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
9 # http://www.apache.org/licenses/LICENSE-2.0
11 """configuration params to run snaps tests"""
15 from xtesting.core import unit
17 from functest.opnfv_tests.openstack.snaps import snaps_utils
18 from functest.utils import config
21 class SnapsTestRunner(unit.Suite):
22 # pylint: disable=too-many-instance-attributes
24 This test executes the SNAPS Python Tests
27 def __init__(self, **kwargs):
28 super(SnapsTestRunner, self).__init__(**kwargs)
29 self.logger = logging.getLogger(__name__)
30 self.os_creds = kwargs.get('os_creds') or snaps_utils.get_credentials()
32 if 'ext_net_name' in kwargs:
33 self.ext_net_name = kwargs['ext_net_name']
35 self.ext_net_name = snaps_utils.get_ext_net_name(self.os_creds)
37 self.netconf_override = None
38 if hasattr(config.CONF, 'snaps_network_config'):
39 self.netconf_override = getattr(
40 config.CONF, 'snaps_network_config')
43 getattr(config.CONF, 'snaps_use_floating_ips') == 'True')
45 getattr(config.CONF, 'snaps_use_keystone') == 'True')
47 self.flavor_metadata = getattr(config.CONF, 'snaps_flavor_extra_specs',
49 self.logger.info("Using flavor metadata '%s'", self.flavor_metadata)
51 self.image_metadata = None
52 if hasattr(config.CONF, 'snaps_images'):
53 self.image_metadata = getattr(config.CONF, 'snaps_images')