Remove main() and __main__ from tests.
[yardstick.git] / tests / unit / network_services / traffic_profile / test_ixia_rfc2544.py
1 # Copyright (c) 2016-2017 Intel Corporation
2 #
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
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
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 #
15
16 from __future__ import absolute_import
17 from __future__ import division
18 import unittest
19 import mock
20
21 from copy import deepcopy
22
23 from tests.unit import STL_MOCKS
24
25 STLClient = mock.MagicMock()
26 stl_patch = mock.patch.dict("sys.modules", STL_MOCKS)
27 stl_patch.start()
28
29 if stl_patch:
30     from yardstick.network_services.traffic_profile.trex_traffic_profile \
31         import TrexProfile
32     from yardstick.network_services.traffic_profile.ixia_rfc2544 import \
33         IXIARFC2544Profile
34     from yardstick.network_services.traffic_profile import ixia_rfc2544
35
36
37 class TestIXIARFC2544Profile(unittest.TestCase):
38
39     TRAFFIC_PROFILE = {
40         "schema": "isb:traffic_profile:0.1",
41         "name": "fixed",
42         "description": "Fixed traffic profile to run UDP traffic",
43         "traffic_profile": {
44             "traffic_type": "FixedTraffic",
45             "frame_rate": 100,  # pps
46             "flow_number": 10,
47             "frame_size": 64,
48         },
49     }
50
51     PROFILE = {'description': 'Traffic profile to run RFC2544 latency',
52                'name': 'rfc2544',
53                'traffic_profile': {'traffic_type': 'IXIARFC2544Profile',
54                                    'frame_rate': 100},
55                IXIARFC2544Profile.DOWNLINK: {'ipv4':
56                           {'outer_l2': {'framesize':
57                                         {'64B': '100', '1518B': '0',
58                                          '128B': '0', '1400B': '0',
59                                          '256B': '0', '373b': '0',
60                                          '570B': '0'}},
61                            'outer_l3v4': {'dstip4': '1.1.1.1-1.15.255.255',
62                                           'proto': 'udp', 'count': '1',
63                                           'srcip4': '90.90.1.1-90.105.255.255',
64                                           'dscp': 0, 'ttl': 32},
65                            'outer_l4': {'srcport': '2001',
66                                         'dsrport': '1234'}}},
67                IXIARFC2544Profile.UPLINK: {'ipv4':
68                            {'outer_l2': {'framesize':
69                                          {'64B': '100', '1518B': '0',
70                                           '128B': '0', '1400B': '0',
71                                           '256B': '0', '373b': '0',
72                                           '570B': '0'}},
73                             'outer_l3v4': {'dstip4': '9.9.1.1-90.105.255.255',
74                                            'proto': 'udp', 'count': '1',
75                                            'srcip4': '1.1.1.1-1.15.255.255',
76                                            'dscp': 0, 'ttl': 32},
77                             'outer_l4': {'dstport': '2001',
78                                          'srcport': '1234'}}},
79                'schema': 'isb:traffic_profile:0.1'}
80
81     def test_get_ixia_traffic_profile_error(self):
82         traffic_generator = mock.Mock(autospec=TrexProfile)
83         traffic_generator.my_ports = [0, 1]
84         traffic_generator.uplink_ports = [-1]
85         traffic_generator.downlink_ports = [1]
86         traffic_generator.client = \
87             mock.Mock(return_value=True)
88         STATIC_TRAFFIC = {
89             IXIARFC2544Profile.UPLINK: {
90                 "id": 1,
91                 "bidir": "False",
92                 "duration": 60,
93                 "iload": "100",
94                 "outer_l2": {
95                     "dstmac": "00:00:00:00:00:03",
96                     "framesPerSecond": True,
97                     "framesize": 64,
98                     "srcmac": "00:00:00:00:00:01"
99                 },
100                 "outer_l3": {
101                     "dscp": 0,
102                     "dstip4": "152.16.40.20",
103                     "proto": "udp",
104                     "srcip4": "152.16.100.20",
105                     "ttl": 32
106                 },
107                 "outer_l3v4": {
108                     "dscp": 0,
109                     "dstip4": "152.16.40.20",
110                     "proto": "udp",
111                     "srcip4": "152.16.100.20",
112                     "ttl": 32
113                 },
114                 "outer_l3v6": {
115                     "count": 1024,
116                     "dscp": 0,
117                     "dstip4": "152.16.100.20",
118                     "proto": "udp",
119                     "srcip4": "152.16.40.20",
120                     "ttl": 32
121                 },
122                 "outer_l4": {
123                     "dstport": "2001",
124                     "srcport": "1234"
125                 },
126                 "traffic_type": "continuous"
127             },
128             IXIARFC2544Profile.DOWNLINK: {
129                 "id": 2,
130                 "bidir": "False",
131                 "duration": 60,
132                 "iload": "100",
133                 "outer_l2": {
134                     "dstmac": "00:00:00:00:00:04",
135                     "framesPerSecond": True,
136                     "framesize": 64,
137                     "srcmac": "00:00:00:00:00:01"
138                 },
139                 "outer_l3": {
140                     "count": 1024,
141                     "dscp": 0,
142                     "dstip4": "152.16.100.20",
143                     "proto": "udp",
144                     "srcip4": "152.16.40.20",
145                     "ttl": 32
146                 },
147                 "outer_l3v4": {
148                     "count": 1024,
149                     "dscp": 0,
150                     "dstip4": "152.16.100.20",
151                     "proto": "udp",
152                     "srcip4": "152.16.40.20",
153                     "ttl": 32
154                 },
155                 "outer_l3v6": {
156                     "count": 1024,
157                     "dscp": 0,
158                     "dstip4": "152.16.100.20",
159                     "proto": "udp",
160                     "srcip4": "152.16.40.20",
161                     "ttl": 32
162                 },
163                 "outer_l4": {
164                     "dstport": "1234",
165                     "srcport": "2001"
166                 },
167                 "traffic_type": "continuous"
168             }
169         }
170         ixia_rfc2544.STATIC_TRAFFIC = STATIC_TRAFFIC
171
172         r_f_c2544_profile = IXIARFC2544Profile(self.TRAFFIC_PROFILE)
173         r_f_c2544_profile.rate = 100
174         mac = {"src_mac_0": "00:00:00:00:00:01",
175                "src_mac_1": "00:00:00:00:00:02",
176                "src_mac_2": "00:00:00:00:00:02",
177                "dst_mac_0": "00:00:00:00:00:03",
178                "dst_mac_1": "00:00:00:00:00:04",
179                "dst_mac_2": "00:00:00:00:00:04"}
180         result = r_f_c2544_profile._get_ixia_traffic_profile(self.PROFILE, mac)
181         self.assertIsNotNone(result)
182
183     def test_get_ixia_traffic_profile(self):
184         traffic_generator = mock.Mock(autospec=TrexProfile)
185         traffic_generator.my_ports = [0, 1]
186         traffic_generator.uplink_ports = [-1]
187         traffic_generator.downlink_ports = [1]
188         traffic_generator.client = \
189             mock.Mock(return_value=True)
190         STATIC_TRAFFIC = {
191             IXIARFC2544Profile.UPLINK: {
192                 "id": 1,
193                 "bidir": "False",
194                 "duration": 60,
195                 "iload": "100",
196                 "outer_l2": {
197                     "dstmac": "00:00:00:00:00:03",
198                     "framesPerSecond": True,
199                     "framesize": 64,
200                     "srcmac": "00:00:00:00:00:01"
201                 },
202                 "outer_l3": {
203                     "dscp": 0,
204                     "dstip4": "152.16.40.20",
205                     "proto": "udp",
206                     "srcip4": "152.16.100.20",
207                     "ttl": 32
208                 },
209                 "outer_l3v4": {
210                     "dscp": 0,
211                     "dstip4": "152.16.40.20",
212                     "proto": "udp",
213                     "srcip4": "152.16.100.20",
214                     "ttl": 32,
215                     "count": "1"
216                 },
217                 "outer_l3v6": {
218                     "count": 1024,
219                     "dscp": 0,
220                     "dstip4": "152.16.100.20",
221                     "proto": "udp",
222                     "srcip4": "152.16.40.20",
223                     "ttl": 32,
224                 },
225                 "outer_l4": {
226                     "dstport": "2001",
227                     "srcport": "1234",
228                     "count": "1"
229                 },
230                 "traffic_type": "continuous"
231             },
232             IXIARFC2544Profile.DOWNLINK: {
233                 "id": 2,
234                 "bidir": "False",
235                 "duration": 60,
236                 "iload": "100",
237                 "outer_l2": {
238                     "dstmac": "00:00:00:00:00:04",
239                     "framesPerSecond": True,
240                     "framesize": 64,
241                     "srcmac": "00:00:00:00:00:01"
242                 },
243                 "outer_l3": {
244                     "count": 1024,
245                     "dscp": 0,
246                     "dstip4": "152.16.100.20",
247                     "proto": "udp",
248                     "srcip4": "152.16.40.20",
249                     "ttl": 32
250                 },
251                 "outer_l3v4": {
252                     "count": 1024,
253                     "dscp": 0,
254                     "dstip4": "152.16.100.20",
255                     "proto": "udp",
256                     "srcip4": "152.16.40.20",
257                     "ttl": 32,
258                 },
259                 "outer_l3v6": {
260                     "count": 1024,
261                     "dscp": 0,
262                     "dstip4": "152.16.100.20",
263                     "proto": "udp",
264                     "srcip4": "152.16.40.20",
265                     "ttl": 32,
266                 },
267                 "outer_l4": {
268                     "dstport": "1234",
269                     "srcport": "2001",
270                     "count": "1"
271                 },
272                 "traffic_type": "continuous"
273             }
274         }
275         ixia_rfc2544.STATIC_TRAFFIC = STATIC_TRAFFIC
276
277         r_f_c2544_profile = IXIARFC2544Profile(self.TRAFFIC_PROFILE)
278         r_f_c2544_profile.rate = 100
279         mac = {"src_mac_0": "00:00:00:00:00:01",
280                "src_mac_1": "00:00:00:00:00:02",
281                "src_mac_2": "00:00:00:00:00:02",
282                "dst_mac_0": "00:00:00:00:00:03",
283                "dst_mac_1": "00:00:00:00:00:04",
284                "dst_mac_2": "00:00:00:00:00:04"}
285         result = r_f_c2544_profile._get_ixia_traffic_profile(self.PROFILE, mac)
286         self.assertIsNotNone(result)
287
288     @mock.patch("yardstick.network_services.traffic_profile.ixia_rfc2544.open")
289     def test_get_ixia_traffic_profile_v6(self, *args):
290         traffic_generator = mock.Mock(autospec=TrexProfile)
291         traffic_generator.my_ports = [0, 1]
292         traffic_generator.uplink_ports = [-1]
293         traffic_generator.downlink_ports = [1]
294         traffic_generator.client = \
295             mock.Mock(return_value=True)
296         STATIC_TRAFFIC = {
297             IXIARFC2544Profile.UPLINK: {
298                 "id": 1,
299                 "bidir": "False",
300                 "duration": 60,
301                 "iload": "100",
302                 "outer_l2": {
303                     "dstmac": "00:00:00:00:00:03",
304                     "framesPerSecond": True,
305                     "framesize": 64,
306                     "srcmac": "00:00:00:00:00:01"
307                 },
308                 "outer_l3": {
309                     "dscp": 0,
310                     "dstip4": "152.16.40.20",
311                     "proto": "udp",
312                     "srcip4": "152.16.100.20",
313                     "ttl": 32
314                 },
315                 "outer_l3v4": {
316                     "dscp": 0,
317                     "dstip4": "152.16.40.20",
318                     "proto": "udp",
319                     "srcip4": "152.16.100.20",
320                     "ttl": 32
321                 },
322                 "outer_l3v6": {
323                     "count": 1024,
324                     "dscp": 0,
325                     "dstip4": "152.16.100.20",
326                     "proto": "udp",
327                     "srcip4": "152.16.40.20",
328                     "ttl": 32
329                 },
330                 "outer_l4": {
331                     "dstport": "2001",
332                     "srcport": "1234"
333                 },
334                 "traffic_type": "continuous"
335             },
336             IXIARFC2544Profile.DOWNLINK: {
337                 "id": 2,
338                 "bidir": "False",
339                 "duration": 60,
340                 "iload": "100",
341                 "outer_l2": {
342                     "dstmac": "00:00:00:00:00:04",
343                     "framesPerSecond": True,
344                     "framesize": 64,
345                     "srcmac": "00:00:00:00:00:01"
346                 },
347                 "outer_l3": {
348                     "count": 1024,
349                     "dscp": 0,
350                     "dstip4": "152.16.100.20",
351                     "proto": "udp",
352                     "srcip4": "152.16.40.20",
353                     "ttl": 32
354                 },
355                 "outer_l3v4": {
356                     "count": 1024,
357                     "dscp": 0,
358                     "dstip4": "152.16.100.20",
359                     "proto": "udp",
360                     "srcip4": "152.16.40.20",
361                     "ttl": 32
362                 },
363                 "outer_l3v6": {
364                     "count": 1024,
365                     "dscp": 0,
366                     "dstip4": "152.16.100.20",
367                     "proto": "udp",
368                     "srcip4": "152.16.40.20",
369                     "ttl": 32
370                 },
371                 "outer_l4": {
372                     "dstport": "1234",
373                     "srcport": "2001"
374                 },
375                 "traffic_type": "continuous"
376             }
377         }
378         ixia_rfc2544.STATIC_TRAFFIC = STATIC_TRAFFIC
379
380         r_f_c2544_profile = IXIARFC2544Profile(self.TRAFFIC_PROFILE)
381         r_f_c2544_profile.rate = 100
382         mac = {"src_mac_0": "00:00:00:00:00:01",
383                "src_mac_1": "00:00:00:00:00:02",
384                "src_mac_2": "00:00:00:00:00:02",
385                "dst_mac_0": "00:00:00:00:00:03",
386                "dst_mac_1": "00:00:00:00:00:04",
387                "dst_mac_2": "00:00:00:00:00:04"}
388         profile_data = {'description': 'Traffic profile to run RFC2544',
389                         'name': 'rfc2544',
390                         'traffic_profile':
391                         {'traffic_type': 'IXIARFC2544Profile',
392                          'frame_rate': 100},
393                         IXIARFC2544Profile.DOWNLINK:
394                         {'ipv4':
395                          {'outer_l2': {'framesize':
396                                        {'64B': '100', '1518B': '0',
397                                         '128B': '0', '1400B': '0',
398                                         '256B': '0', '373b': '0',
399                                         '570B': '0'}},
400                           'outer_l3v4': {'dstip4': '1.1.1.1-1.15.255.255',
401                                          'proto': 'udp', 'count': '1',
402                                          'srcip4': '90.90.1.1-90.105.255.255',
403                                          'dscp': 0, 'ttl': 32},
404                           'outer_l3v6': {'dstip6': '1.1.1.1-1.15.255.255',
405                                          'proto': 'udp', 'count': '1',
406                                          'srcip6': '90.90.1.1-90.105.255.255',
407                                          'dscp': 0, 'ttl': 32},
408                           'outer_l4': {'srcport': '2001',
409                                        'dsrport': '1234'}}},
410                         IXIARFC2544Profile.UPLINK: {'ipv4':
411                                     {'outer_l2': {'framesize':
412                                                   {'64B': '100', '1518B': '0',
413                                                    '128B': '0', '1400B': '0',
414                                                    '256B': '0', '373b': '0',
415                                                    '570B': '0'}},
416                                      'outer_l3v4':
417                                      {'dstip4': '9.9.1.1-90.105.255.255',
418                                       'proto': 'udp', 'count': '1',
419                                       'srcip4': '1.1.1.1-1.15.255.255',
420                                       'dscp': 0, 'ttl': 32},
421                                      'outer_l3v6':
422                                      {'dstip6': '9.9.1.1-90.105.255.255',
423                                       'proto': 'udp', 'count': '1',
424                                       'srcip6': '1.1.1.1-1.15.255.255',
425                                       'dscp': 0, 'ttl': 32},
426
427                                      'outer_l4': {'dstport': '2001',
428                                                   'srcport': '1234'}}},
429                         'schema': 'isb:traffic_profile:0.1'}
430         result = r_f_c2544_profile._get_ixia_traffic_profile(profile_data, mac)
431         self.assertIsNotNone(result)
432
433     def test__get_ixia_traffic_profile_default_args(self):
434         r_f_c2544_profile = IXIARFC2544Profile(self.TRAFFIC_PROFILE)
435
436         expected = {}
437         result = r_f_c2544_profile._get_ixia_traffic_profile({})
438         self.assertDictEqual(result, expected)
439
440     def test__ixia_traffic_generate(self):
441         traffic_generator = mock.Mock(autospec=TrexProfile)
442         traffic_generator.networks = {
443             "uplink_0": ["xe0"],
444             "downlink_0": ["xe1"],
445         }
446         traffic_generator.client = \
447             mock.Mock(return_value=True)
448         traffic = {IXIARFC2544Profile.DOWNLINK: {'iload': 10},
449                    IXIARFC2544Profile.UPLINK: {'iload': 10}}
450         ixia_obj = mock.MagicMock()
451         r_f_c2544_profile = IXIARFC2544Profile(self.TRAFFIC_PROFILE)
452         r_f_c2544_profile.rate = 100
453         result = r_f_c2544_profile._ixia_traffic_generate(traffic, ixia_obj)
454         self.assertIsNone(result)
455
456     def test_execute(self):
457         traffic_generator = mock.Mock(autospec=TrexProfile)
458         traffic_generator.networks = {
459             "uplink_0": ["xe0"],
460             "downlink_0": ["xe1"],
461         }
462         traffic_generator.client = \
463             mock.Mock(return_value=True)
464         r_f_c2544_profile = IXIARFC2544Profile(self.TRAFFIC_PROFILE)
465         r_f_c2544_profile.first_run = True
466         r_f_c2544_profile.params = {IXIARFC2544Profile.DOWNLINK: {'iload': 10},
467                                     IXIARFC2544Profile.UPLINK: {'iload': 10}}
468
469         r_f_c2544_profile.get_streams = mock.Mock()
470         r_f_c2544_profile.full_profile = {}
471         r_f_c2544_profile._get_ixia_traffic_profile = mock.Mock()
472         r_f_c2544_profile.get_multiplier = mock.Mock()
473         r_f_c2544_profile._ixia_traffic_generate = mock.Mock()
474         ixia_obj = mock.MagicMock()
475         self.assertIsNone(r_f_c2544_profile.execute_traffic(traffic_generator, ixia_obj))
476
477     def test_update_traffic_profile(self):
478         traffic_generator = mock.Mock(autospec=TrexProfile)
479         traffic_generator.networks = {
480             "uplink_0": ["xe0"],  # private, one value for intfs
481             "downlink_0": ["xe1", "xe2"],  # public, two values for intfs
482             "downlink_1": ["xe3"],  # not in TRAFFIC PROFILE
483             "tenant_0": ["xe4"],  # not public or private
484         }
485
486         ports_expected = [8, 3, 5]
487         traffic_generator.vnfd_helper.port_num.side_effect = ports_expected
488         traffic_generator.client.return_value = True
489
490         traffic_profile = deepcopy(self.TRAFFIC_PROFILE)
491         traffic_profile.update({
492             "uplink_0": ["xe0"],
493             "downlink_0": ["xe1", "xe2"],
494         })
495
496         r_f_c2544_profile = IXIARFC2544Profile(traffic_profile)
497         r_f_c2544_profile.full_profile = {}
498         r_f_c2544_profile.get_streams = mock.Mock()
499
500         self.assertIsNone(r_f_c2544_profile.update_traffic_profile(traffic_generator))
501         self.assertEqual(r_f_c2544_profile.ports, ports_expected)
502
503     def test_get_drop_percentage(self):
504         r_f_c2544_profile = IXIARFC2544Profile(self.TRAFFIC_PROFILE)
505         r_f_c2544_profile.params = self.PROFILE
506         ixia_obj = mock.MagicMock()
507         r_f_c2544_profile.execute = mock.Mock()
508         r_f_c2544_profile._get_ixia_traffic_profile = mock.Mock()
509         r_f_c2544_profile._ixia_traffic_generate = mock.Mock()
510         r_f_c2544_profile.get_multiplier = mock.Mock()
511         r_f_c2544_profile.tmp_throughput = 0
512         r_f_c2544_profile.tmp_drop = 0
513         r_f_c2544_profile.full_profile = {}
514         samples = {}
515         for ifname in range(1):
516             name = "xe{}".format(ifname)
517             samples[name] = {"rx_throughput_fps": 20,
518                              "tx_throughput_fps": 20,
519                              "rx_throughput_mbps": 10,
520                              "tx_throughput_mbps": 10,
521                              "RxThroughput": 10,
522                              "TxThroughput": 10,
523                              "in_packets": 1000,
524                              "out_packets": 1000}
525         tol_min = 100.0
526         tolerance = 0.0
527         self.assertIsNotNone(
528             r_f_c2544_profile.get_drop_percentage(samples, tol_min, tolerance,
529                                                   ixia_obj))
530
531     def test_get_drop_percentage_update(self):
532         r_f_c2544_profile = IXIARFC2544Profile(self.TRAFFIC_PROFILE)
533         r_f_c2544_profile.params = self.PROFILE
534         ixia_obj = mock.MagicMock()
535         r_f_c2544_profile.execute = mock.Mock()
536         r_f_c2544_profile._get_ixia_traffic_profile = mock.Mock()
537         r_f_c2544_profile._ixia_traffic_generate = mock.Mock()
538         r_f_c2544_profile.get_multiplier = mock.Mock()
539         r_f_c2544_profile.tmp_throughput = 0
540         r_f_c2544_profile.tmp_drop = 0
541         r_f_c2544_profile.full_profile = {}
542         samples = {}
543         for ifname in range(1):
544             name = "xe{}".format(ifname)
545             samples[name] = {"rx_throughput_fps": 20,
546                              "tx_throughput_fps": 20,
547                              "rx_throughput_mbps": 10,
548                              "tx_throughput_mbps": 10,
549                              "RxThroughput": 10,
550                              "TxThroughput": 10,
551                              "in_packets": 1000,
552                              "out_packets": 1002}
553         tol_min = 0.0
554         tolerance = 1.0
555         self.assertIsNotNone(
556             r_f_c2544_profile.get_drop_percentage(samples, tol_min, tolerance,
557                                                   ixia_obj))
558
559     def test_get_drop_percentage_div_zero(self):
560         r_f_c2544_profile = IXIARFC2544Profile(self.TRAFFIC_PROFILE)
561         r_f_c2544_profile.params = self.PROFILE
562         ixia_obj = mock.MagicMock()
563         r_f_c2544_profile.execute = mock.Mock()
564         r_f_c2544_profile._get_ixia_traffic_profile = mock.Mock()
565         r_f_c2544_profile._ixia_traffic_generate = mock.Mock()
566         r_f_c2544_profile.get_multiplier = mock.Mock()
567         r_f_c2544_profile.tmp_throughput = 0
568         r_f_c2544_profile.tmp_drop = 0
569         r_f_c2544_profile.full_profile = {}
570         samples = {}
571         for ifname in range(1):
572             name = "xe{}".format(ifname)
573             samples[name] = {"rx_throughput_fps": 20,
574                              "tx_throughput_fps": 20,
575                              "rx_throughput_mbps": 10,
576                              "tx_throughput_mbps": 10,
577                              "RxThroughput": 10,
578                              "TxThroughput": 10,
579                              "in_packets": 1000,
580                              "out_packets": 0}
581         tol_min = 0.0
582         tolerance = 0.0
583         r_f_c2544_profile.tmp_throughput = 0
584         self.assertIsNotNone(
585             r_f_c2544_profile.get_drop_percentage(samples, tol_min, tolerance,
586                                                   ixia_obj))
587
588     def test_get_multiplier(self):
589         r_f_c2544_profile = IXIARFC2544Profile(self.TRAFFIC_PROFILE)
590         r_f_c2544_profile.max_rate = 100
591         r_f_c2544_profile.min_rate = 100
592         self.assertEqual("1.0", r_f_c2544_profile.get_multiplier())
593
594     def test_start_ixia_latency(self):
595         traffic_generator = mock.Mock(autospec=TrexProfile)
596         traffic_generator.networks = {
597             "uplink_0": ["xe0"],
598             "downlink_0": ["xe1"],
599         }
600         traffic_generator.client = \
601             mock.Mock(return_value=True)
602         r_f_c2544_profile = IXIARFC2544Profile(self.TRAFFIC_PROFILE)
603         r_f_c2544_profile.max_rate = 100
604         r_f_c2544_profile.min_rate = 100
605         ixia_obj = mock.MagicMock()
606         r_f_c2544_profile._get_ixia_traffic_profile = \
607             mock.Mock(return_value={})
608         r_f_c2544_profile.full_profile = {}
609         r_f_c2544_profile._ixia_traffic_generate = mock.Mock()
610         self.assertIsNone(
611             r_f_c2544_profile.start_ixia_latency(traffic_generator, ixia_obj))