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 ProxACLProfile(ProxProfile):
27 This profile adds a single stream at the beginning of the traffic session
29 def run_test_with_pkt_size(self, traffic_gen, pkt_size, duration):
30 """Run the test for a single packet size.
32 :param traffic_gen: traffic generator instance
33 :type traffic_gen: TrafficGen
34 :param pkt_size: The packet size to test with.
36 :param duration: The duration for each try.
41 test_value = self.upper_bound
43 # throughput and packet loss from the last successful test
44 while test_value == self.upper_bound:
45 result = traffic_gen.resource_helper.run_test(pkt_size, duration,
46 test_value, self.tolerated_loss)
49 LOG.debug("Success! ")
51 LOG.debug("Failure...")
53 samples = result.get_samples(pkt_size)
54 self.fill_samples(samples, traffic_gen)
55 self.queue.put(samples)