1 # Copyright (c) 2016-2017 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 """ Fixed traffic profile definitions """
16 from __future__ import absolute_import
20 from yardstick.network_services.traffic_profile.prox_profile import ProxProfile
22 LOG = logging.getLogger(__name__)
25 class ProxRampProfile(ProxProfile):
27 def run_test_with_pkt_size(self, traffic_gen, pkt_size, duration):
28 """Run the test for a single packet size.
30 :param traffic_gen: traffic generator instance
31 :type traffic_gen: TrafficGen
32 :param pkt_size: The packet size to test with.
34 :param duration: The duration for each try.
39 LOG.info("Testing with packet size %d", pkt_size)
41 for test_value in self.bounds_iterator(LOG):
42 test_result = self._profile_helper.run_test(pkt_size, duration,
43 test_value, self.tolerated_loss)
45 if not test_result.success:
46 LOG.debug("Failure... stopping")
49 LOG.debug("Success! Increasing test value")
50 samples = test_result.get_samples(pkt_size)
51 self.fill_samples(samples, traffic_gen)
53 self.queue.put(samples)