6b3cfdd0dd55319a41e3a2c79d21bd3326968a42
[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 functest.opnfv_tests.openstack.snaps.snaps_test_runner import \
11     SnapsTestRunner
12 from functest.utils.constants import CONST
13
14 from snaps.openstack.tests.os_source_file_test import OSIntegrationTestCase
15 from snaps.openstack.tests.create_instance_tests import SimpleHealthCheck
16
17
18 class HealthCheck(SnapsTestRunner):
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, case_name="snaps_health_check"):
25         super(HealthCheck, self).__init__(case_name)
26
27         self.suite = unittest.TestSuite()
28
29         image_custom_config = None
30         if hasattr(CONST, 'snaps_health_check'):
31             image_custom_config = CONST.snaps_health_check
32
33         self.suite.addTest(
34             OSIntegrationTestCase.parameterize(
35                 SimpleHealthCheck, CONST.openstack_creds, self.ext_net_name,
36                 use_keystone=CONST.snaps_use_keystone,
37                 flavor_metadata=self.flavor_metadata,
38                 image_metadata=image_custom_config))