diff options
author | Orest Voznyy <orestx.voznyy@intel.com> | 2018-10-22 18:27:31 +0300 |
---|---|---|
committer | Abhijit Sinha <abhijit.sinha@intel.com> | 2018-10-30 10:44:12 +0000 |
commit | 9b968b08e7d52c57db3af4c323c820bb81d9ef34 (patch) | |
tree | 4df8c1f7adca159d2c0970a719322f3274bcf94a /yardstick/network_services | |
parent | e0b7c0ad95d44eea4db4a3fb532f51688c97c8fc (diff) |
Add test library name update in DMF and mainflows
Add automatic update of traffic profile items library name update, as well
as update of session profile Dmf library name, to avoid the need of user
changing it in template files.
Update affected unit tests.
JIRA: YARDSTICK-1474
Change-Id: I18cc8ca99a47da862753329c87d1a560a97f76fa
Signed-off-by: Orest Voznyy <orestx.voznyy@intel.com>
(cherry picked from commit 1fd3806d6a6bac19f3173da4d6cb94cef81fd7f5)
Diffstat (limited to 'yardstick/network_services')
-rw-r--r-- | yardstick/network_services/vnf_generic/vnf/tg_landslide.py | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/yardstick/network_services/vnf_generic/vnf/tg_landslide.py b/yardstick/network_services/vnf_generic/vnf/tg_landslide.py index a146b72ca..68021c9fe 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_landslide.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_landslide.py @@ -129,6 +129,17 @@ class LandslideTrafficGen(sample_vnf.SampleVNFTrafficGen): self.session_profile['reservePorts'] = 'true' self.session_profile['reservations'] = [reservation] + def _update_session_library_name(self, test_session): + """Update DMF library name in session profile""" + for _ts_group in test_session['tsGroups']: + for _tc in _ts_group['testCases']: + try: + for _mainflow in _tc['parameters']['Dmf']['mainflows']: + _mainflow['library'] = \ + self.vnfd_helper.mgmt_interface['user'] + except KeyError: + pass + @staticmethod def _update_session_tc_params(tc_options, testcase): for _param_key in tc_options: @@ -206,6 +217,8 @@ class LandslideTrafficGen(sample_vnf.SampleVNFTrafficGen): _testcase_idx].update( self._update_session_tc_params(tc_options, _testcase)) + self._update_session_library_name(self.session_profile) + class LandslideResourceHelper(sample_vnf.ClientResourceHelper): """Landslide TG helper class""" @@ -459,11 +472,14 @@ class LandslideResourceHelper(sample_vnf.ClientResourceHelper): self._terminated.value = 1 def create_dmf(self, dmf): - if isinstance(dmf, list): - for _dmf in dmf: - self._tcl.create_dmf(_dmf) - else: - self._tcl.create_dmf(dmf) + if isinstance(dmf, dict): + dmf = [dmf] + for _dmf in dmf: + # Update DMF library name in traffic profile + _dmf['dmf'].update( + {'library': self.vnfd_helper.mgmt_interface['user']}) + # Create DMF on Landslide server + self._tcl.create_dmf(_dmf) def delete_dmf(self, dmf): if isinstance(dmf, list): |