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
11 from functest.opnfv_tests.openstack.snaps.snaps_test_runner import \
13 from functest.utils.constants import CONST
15 from snaps.openstack.tests.os_source_file_test import OSIntegrationTestCase
16 from snaps.openstack.tests.create_instance_tests import SimpleHealthCheck
19 class HealthCheck(SnapsTestRunner):
21 This test executes the SNAPS Python Test case SimpleHealthCheck which
22 creates a VM with a single port with an IPv4 address that is assigned by
23 DHCP. This test then validates the expected IP with the actual
25 def __init__(self, **kwargs):
26 if "case_name" not in kwargs:
27 kwargs["case_name"] = "snaps_images_cirros"
28 super(HealthCheck, 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
38 image_custom_config = None
40 if hasattr(CONST, 'snaps_images_cirros'):
41 image_custom_config = CONST.__getattribute__('snaps_images_cirros')
43 OSIntegrationTestCase.parameterize(
44 SimpleHealthCheck, os_creds=self.os_creds,
45 ext_net_name=self.ext_net_name,
46 use_keystone=self.use_keystone,
47 flavor_metadata=self.flavor_metadata,
48 image_metadata=image_custom_config))
49 return super(self.__class__, self).run()