diff options
author | 2018-06-05 09:25:36 +0200 | |
---|---|---|
committer | 2018-06-07 08:04:32 +0000 | |
commit | 853b855803dd70bbc371e96fa8582cd0e039db04 (patch) | |
tree | e269721ef282cfb41b62eb8986430775ec92bd17 | |
parent | fc2b3139c7629a601f1a716aea7e65ec4b5fd414 (diff) |
Provide support for VNFs
Currently it is not possible to define different images for client/server
and VNFs. This functionality is important to have in order to test
different VNFs
Change-Id: Ibc3b3f1102d52529701748d37f795cdf05269410
Signed-off-by: Manuel Buil <mbuil@suse.com>
-rw-r--r-- | sfc/lib/config.py | 13 | ||||
-rw-r--r-- | sfc/tests/functest/config.yaml | 4 | ||||
-rw-r--r-- | sfc/tests/functest/sfc_parent_function.py | 9 |
3 files changed, 26 insertions, 0 deletions
diff --git a/sfc/lib/config.py b/sfc/lib/config.py index 69e1769d..e6149081 100644 --- a/sfc/lib/config.py +++ b/sfc/lib/config.py @@ -103,6 +103,19 @@ class CommonConfig(object): "defaults.image_format", self.config_file) self.image_url = ft_utils.get_parameter_from_yaml( "defaults.image_url", self.config_file) + try: + self.vnf_image_name = ft_utils.get_parameter_from_yaml( + "defaults.vnf_image_name", self.config_file) + self.vnf_image_url = ft_utils.get_parameter_from_yaml( + "defaults.vnf_image_url", self.config_file) + self.vnf_image_format = ft_utils.get_parameter_from_yaml( + "defaults.vnf_image_format", self.config_file) + except ValueError: + # If the parameter does not exist we use the default + self.vnf_image_name = self.image_name + self.vnf_image_url = self.image_url + self.vnf_image_format = self.image_format + self.dir_functest_data = getattr(config.CONF, 'dir_functest_data') diff --git a/sfc/tests/functest/config.yaml b/sfc/tests/functest/config.yaml index d18a0033..9c743553 100644 --- a/sfc/tests/functest/config.yaml +++ b/sfc/tests/functest/config.yaml @@ -25,6 +25,10 @@ defaults: vnfd-dir: "vnfd-templates" vnfd-default-params-file: "test-vnfd-default-params.yaml" + # [OPTIONAL] Only when deploying VNFs without the default image (vxlan_tool) + # vnf_image_name: xxx + # vnf_image_format: yyy + # vnf_image_url: zzz testcases: sfc_one_chain_two_service_functions: diff --git a/sfc/tests/functest/sfc_parent_function.py b/sfc/tests/functest/sfc_parent_function.py index 336d8d42..a16fa6a7 100644 --- a/sfc/tests/functest/sfc_parent_function.py +++ b/sfc/tests/functest/sfc_parent_function.py @@ -33,6 +33,7 @@ class SfcCommonTestCase(object): self.router = None self.sg = None self.image_creator = None + self.vnf_image_creator = None self.creators = None self.odl_ip = None self.odl_port = None @@ -133,6 +134,14 @@ class SfcCommonTestCase(object): self.sg = openstack_sfc.create_security_group( testcase_config.secgroup_name) + # Image for the vnf is registered + self.vnf_image_creator = openstack_sfc.register_glance_image( + COMMON_CONFIG.vnf_image_name, + COMMON_CONFIG.vnf_image_url, + COMMON_CONFIG.vnf_image_format, + 'public') + + # Image for the client/server is registered self.image_creator = openstack_sfc.register_glance_image( COMMON_CONFIG.image_name, COMMON_CONFIG.image_url, |