1 # Copyright (c) 2018 Intel Corporation
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 """ Spirent Landslide traffic profile definitions """
16 from yardstick.network_services.traffic_profile import base
19 class LandslideProfile(base.TrafficProfile):
21 This traffic profile handles attributes of Landslide data stream
24 def __init__(self, tp_config):
25 super(LandslideProfile, self).__init__(tp_config)
27 # for backward compatibility support dict and list of dicts
28 if isinstance(tp_config["dmf_config"], dict):
29 self.dmf_config = [tp_config["dmf_config"]]
31 self.dmf_config = tp_config["dmf_config"]
33 def execute(self, traffic_generator):
36 def update_dmf(self, options):
38 if isinstance(options['dmf'], dict):
39 _dmfs = [options['dmf']]
41 _dmfs = options['dmf']
43 for index, _dmf in enumerate(_dmfs):
45 self.dmf_config[index].update(_dmf)