Exemple #1
0
 def test_create_final_param_dict_empty_value(self):
     initial_param_dict = {'nfv': {'VDU': '', 'CP': ''}}
     expected_final_param_dict = {'nfv': {'VDU': '', 'CP': ''}}
     vdu_flavor_dict = {}
     vdu_image_dict = {}
     cpd_vl_dict = {}
     actual_final_param_dict = utils.create_final_param_dict(
         initial_param_dict, vdu_flavor_dict, vdu_image_dict, cpd_vl_dict)
     self.assertEqual(expected_final_param_dict, actual_final_param_dict)
Exemple #2
0
 def test_create_final_param_dict_empty_argument(self):
     initial_param_dict = {}
     expected_final_param_dict = {}
     vdu_flavor_dict = {}
     vdu_image_dict = {}
     cpd_vl_dict = {}
     actual_final_param_dict = utils.create_final_param_dict(
         initial_param_dict, vdu_flavor_dict, vdu_image_dict, cpd_vl_dict)
     self.assertEqual(expected_final_param_dict, actual_final_param_dict)
Exemple #3
0
 def instantiate(base_hot_dict=None,
                 vnfd_dict=None,
                 inst_req_info=None,
                 grant_info=None):
     api_param = UserDataUtil.get_diff_base_hot_param_from_api(
         base_hot_dict, inst_req_info)
     initial_param_dict = \
         UserDataUtil.create_initial_param_server_port_dict(
             base_hot_dict)
     vdu_flavor_dict = \
         UserDataUtil.create_vdu_flavor_capability_name_dict(vnfd_dict)
     vdu_image_dict = UserDataUtil.create_sw_image_dict(vnfd_dict)
     cpd_vl_dict = UserDataUtil.create_network_dict(inst_req_info,
                                                    initial_param_dict)
     final_param_dict = UserDataUtil.create_final_param_dict(
         initial_param_dict, vdu_flavor_dict, vdu_image_dict, cpd_vl_dict)
     return {**final_param_dict, **api_param}
Exemple #4
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
Exemple #5
0
 def test_create_final_param_dict(self):
     initial_param_dict = {
         'nfv': {
             'CP': {
                 'CP1': {
                     'network': 'cp1_network_id'
                 }
             },
             'VDU': {
                 'VDU1': {
                     'image': 'vdu1_image_uuid',
                     'flavor': {
                         'ram': 'vdu1_flavor_ram'
                     }
                 }
             }
         }
     }
     vdu_flavor_dict = {'VDU1': {'ram': 'vdu1_flavor_ram_change'}}
     vdu_image_dict = {'VDU1': 'vdu1_image_uuid_change'}
     cpd_vl_dict = {
         'CP1': {'cp1_network_id_change_1', 'cp1_network_id_change_2'}
     }
     expected_final_param_dict = {
         'nfv': {
             'CP': {
                 'CP1': {
                     'network':
                     {'cp1_network_id_change_1', 'cp1_network_id_change_2'}
                 }
             },
             'VDU': {
                 'VDU1': {
                     'image': 'vdu1_image_uuid_change',
                     'flavor': {
                         'ram': 'vdu1_flavor_ram_change'
                     }
                 }
             }
         }
     }
     actual_final_param_dict = utils.create_final_param_dict(
         initial_param_dict, vdu_flavor_dict, vdu_image_dict, cpd_vl_dict)
     self.assertEqual(expected_final_param_dict, actual_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