Merge "Integrating PyTest contained in SNAPS as a replacement to the old bash healthc...
[functest.git] / functest / opnfv_tests / openstack / snaps / health_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.openstack.tests.os_source_file_test import OSIntegrationTestCase
11 from snaps.openstack.tests.create_instance_tests import SimpleHealthCheck
12
13 from functest.core.pytest_suite_runner import PyTestSuiteRunner
14 from functest.opnfv_tests.openstack.snaps import snaps_utils
15 from functest.utils.constants import CONST
16
17
18 class HealthCheck(PyTestSuiteRunner):
19     """
20     This test executes the SNAPS Python Test case SimpleHealthCheck which
21     creates a VM with a single port with an IPv4 address that is assigned by
22     DHCP. This test then validates the expected IP with the actual
23     """
24     def __init__(self):
25         super(HealthCheck, self).__init__()
26
27         self.suite = unittest.TestSuite()
28         self.case_name = "snaps_health_check"
29         ext_net_name = snaps_utils.get_ext_net_name()
30
31         self.suite.addTest(
32             OSIntegrationTestCase.parameterize(
33                 SimpleHealthCheck, CONST.openstack_creds, ext_net_name,
34                 use_keystone=CONST.snaps_use_keystone))