Modify TestCase constructor attributes
[functest.git] / functest / opnfv_tests / openstack / snaps / snaps_test_runner.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 from functest.utils import functest_logger as ft_logger
9 from functest.core.pytest_suite_runner import PyTestSuiteRunner
10 from functest.opnfv_tests.openstack.snaps import snaps_utils
11 from functest.utils import functest_utils
12
13 from snaps.openstack import create_flavor
14
15
16 class SnapsTestRunner(PyTestSuiteRunner):
17     """
18     This test executes the SNAPS Python Test case SimpleHealthCheck which
19     creates a VM with a single port with an IPv4 address that is assigned by
20     DHCP. This test then validates the expected IP with the actual
21     """
22     def __init__(self, **kwargs):
23         super(SnapsTestRunner, self).__init__(**kwargs)
24
25         self.ext_net_name = snaps_utils.get_ext_net_name()
26         self.logger = ft_logger.Logger(self.project_name).getLogger()
27         scenario = functest_utils.get_scenario()
28
29         self.flavor_metadata = create_flavor.MEM_PAGE_SIZE_ANY
30         if 'ovs' in scenario or 'fdio' in scenario:
31             self.flavor_metadata = create_flavor.MEM_PAGE_SIZE_LARGE
32
33         self.logger.info("Using flavor metatdata '%s'" % self.flavor_metadata)