Beispiel #1
0
    def test_create_vdu_image_dict(self):
        vnf_resource = type('', (), {})
        resource_identifier = constants.INVALID_UUID
        vnf_resource.resource_identifier = resource_identifier
        grant_info = {'vdu_name': {vnf_resource}}

        vdu_image_dict = utils.create_vdu_image_dict(grant_info)
        self.assertEqual({'vdu_name': resource_identifier}, vdu_image_dict)
Beispiel #2
0
    def instantiate(base_hot_dict=None,
                    vnfd_dict=None,
                    inst_req_info=None,
                    grant_info=None):

        # Create HOT input parameter using util functions.
        initial_param_dict = UserDataUtil.create_initial_param_dict(
            base_hot_dict)

        vdu_flavor_dict = UserDataUtil.create_vdu_flavor_dict(vnfd_dict)
        vdu_image_dict = UserDataUtil.create_vdu_image_dict(grant_info)
        cpd_vl_dict = UserDataUtil.create_cpd_vl_dict(base_hot_dict,
                                                      inst_req_info)

        final_param_dict = UserDataUtil.create_final_param_dict(
            initial_param_dict, vdu_flavor_dict, vdu_image_dict, cpd_vl_dict)

        return final_param_dict
    def instantiate(base_hot_dict=None,
                    vnfd_dict=None,
                    inst_req_info=None,
                    grant_info=None):

        # Sleep more than timeout.
        LOG.debug('Sleep start.')
        time.sleep(USER_DATA_TIMEOUT + 60)
        LOG.debug('Sleep end.')

        # Create HOT input parameter using util functions.
        initial_param_dict = UserDataUtil.create_initial_param_dict(
            base_hot_dict)

        vdu_flavor_dict = UserDataUtil.create_vdu_flavor_dict(vnfd_dict)
        vdu_image_dict = UserDataUtil.create_vdu_image_dict(grant_info)
        cpd_vl_dict = UserDataUtil.create_cpd_vl_dict(base_hot_dict,
                                                      inst_req_info)

        final_param_dict = UserDataUtil.create_final_param_dict(
            initial_param_dict, vdu_flavor_dict, vdu_image_dict, cpd_vl_dict)

        return final_param_dict
Beispiel #4
0
 def test_create_vdu_image_dict_empty_argument(self):
     grant_info = {}
     vdu_image_dict = utils.create_vdu_image_dict(grant_info)
     self.assertEqual({}, vdu_image_dict)