Merge "Added test descriptors for vCMTS testcase"
[yardstick.git] / yardstick / tests / unit / network_services / vnf_generic / vnf / test_tg_rfc2544_ixia.py
index d84fda7..c3f3e5f 100644 (file)
@@ -115,7 +115,7 @@ class TestIxiaResourceHelper(unittest.TestCase):
         mock_tprofile = mock.Mock()
         mock_tprofile.config.duration = 10
         mock_tprofile.get_drop_percentage.return_value = \
-            True, {'test': 'fake_samples'}
+            True, {'test': 'fake_samples', 'Iteration': 1}
         ixia_rhelper = tg_rfc2544_ixia.IxiaResourceHelper(mock.Mock())
         tasks_queue = mock.Mock()
         tasks_queue.get.return_value = 'RUN_TRAFFIC'
@@ -556,37 +556,29 @@ class TestIxiaBasicScenario(unittest.TestCase):
     def test_generate_samples(self, mock_get_stats):
 
         expected_samples = {'xe0': {
-                                'in_packets': 150,
-                                'out_packets': 150,
-                                'in_bytes': 9600,
-                                'out_bytes': 9600,
-                                'rx_throughput_mbps': 0.0,
-                                'rx_throughput_kps': 0.0,
+                                'InPackets': 150,
+                                'OutPackets': 150,
+                                'InBytes': 9600,
+                                'OutBytes': 9600,
                                 'RxThroughput': 5.0,
                                 'TxThroughput': 5.0,
                                 'RxThroughputBps': 320.0,
                                 'TxThroughputBps': 320.0,
-                                'tx_throughput_mbps': 0.0,
-                                'tx_throughput_kps': 0.0,
-                                'Store-Forward_Max_latency_ns': 100,
-                                'Store-Forward_Min_latency_ns': 100,
-                                'Store-Forward_Avg_latency_ns': 100},
+                                'LatencyMax': 100,
+                                'LatencyMin': 100,
+                                'LatencyAvg': 100},
                             'xe1': {
-                                'in_packets': 150,
-                                'out_packets': 150,
-                                'in_bytes': 9600,
-                                'out_bytes': 9600,
-                                'rx_throughput_mbps': 0.0,
-                                'rx_throughput_kps': 0.0,
+                                'InPackets': 150,
+                                'OutPackets': 150,
+                                'InBytes': 9600,
+                                'OutBytes': 9600,
                                 'RxThroughput': 5.0,
                                 'TxThroughput': 5.0,
                                 'RxThroughputBps': 320.0,
                                 'TxThroughputBps': 320.0,
-                                'tx_throughput_mbps': 0.0,
-                                'tx_throughput_kps': 0.0,
-                                'Store-Forward_Max_latency_ns': 200,
-                                'Store-Forward_Min_latency_ns': 200,
-                                'Store-Forward_Avg_latency_ns': 200}}
+                                'LatencyMax': 200,
+                                'LatencyMin': 200,
+                                'LatencyAvg': 200}}
 
         res_helper = mock.Mock()
         res_helper.vnfd_helper.find_interface_by_port.side_effect = \
@@ -649,11 +641,13 @@ class TestIxiaL3Scenario(TestIxiaBasicScenario):
 
     def test_create_traffic_model(self):
         self.mock_IxNextgen.get_vports.return_value = ['1', '2']
-        self.scenario.create_traffic_model()
+        traffic_profile = 'fake_profile'
+        self.scenario.create_traffic_model(traffic_profile)
         self.scenario.client.get_vports.assert_called_once()
         self.scenario.client.create_ipv4_traffic_model.\
             assert_called_once_with(['1/protocols/static'],
-                                    ['2/protocols/static'])
+                                    ['2/protocols/static'],
+                                    'fake_profile')
 
     def test_apply_config(self):
         self.scenario._add_interfaces = mock.Mock()
@@ -772,7 +766,7 @@ class TestIxiaPppoeClientScenario(unittest.TestCase):
         mock_id_pairs.assert_called_once_with(mock_tp.full_profile)
         mock_obj_pairs.assert_called_once_with(['xe0', 'xe1', 'xe0', 'xe1'])
         self.scenario.client.create_ipv4_traffic_model.assert_called_once_with(
-            uplink_endpoints, downlink_endpoints)
+            uplink_endpoints, downlink_endpoints, mock_tp)
 
     @mock.patch.object(tg_rfc2544_ixia.IxiaPppoeClientScenario,
                        '_get_endpoints_src_dst_id_pairs')
@@ -796,7 +790,7 @@ class TestIxiaPppoeClientScenario(unittest.TestCase):
         mock_id_pairs.assert_called_once_with(mock_tp.full_profile)
         mock_obj_pairs.assert_called_once_with([])
         self.scenario.client.create_ipv4_traffic_model.assert_called_once_with(
-            uplink_topologies, downlink_topologies)
+            uplink_topologies, downlink_topologies, mock_tp)
 
     def test__get_endpoints_src_dst_id_pairs(self):
         full_tp = OrderedDict([
@@ -1209,58 +1203,50 @@ class TestIxiaPppoeClientScenario(unittest.TestCase):
 
         prio_flows_stats = {
             '0': {
-                'in_packets': 6000,
-                'out_packets': 6000,
+                'InPackets': 6000,
+                'OutPackets': 6000,
                 'RxThroughput': 200.0,
                 'TxThroughput': 200.0,
-                'avg_latency_ns': 2,
-                'max_latency_ns': 2,
-                'min_latency_ns': 2
+                'LatencyAvg': 2,
+                'LatencyMax': 2,
+                'LatencyMin': 2
             }
         }
 
         expected_result = {'priority_stats': {
             '0': {'RxThroughput': 200.0,
                   'TxThroughput': 200.0,
-                  'avg_latency_ns': 2,
-                  'max_latency_ns': 2,
-                  'min_latency_ns': 2,
-                  'in_packets': 6000,
-                  'out_packets': 6000}},
+                  'LatencyAvg': 2,
+                  'LatencyMax': 2,
+                  'LatencyMin': 2,
+                  'InPackets': 6000,
+                  'OutPackets': 6000}},
             'xe0': {'RxThroughput': 100.0,
-                    'Store-Forward_Avg_latency_ns': 2,
-                    'Store-Forward_Max_latency_ns': 2,
-                    'Store-Forward_Min_latency_ns': 2,
+                    'LatencyAvg': 2,
+                    'LatencyMax': 2,
+                    'LatencyMin': 2,
                     'TxThroughput': 100.0,
-                    'in_packets': 3000,
-                    'out_packets': 3000,
-                    'in_bytes': 192000,
-                    'out_bytes': 192000,
+                    'InPackets': 3000,
+                    'OutPackets': 3000,
+                    'InBytes': 192000,
+                    'OutBytes': 192000,
                     'RxThroughputBps': 6400.0,
                     'TxThroughputBps': 6400.0,
-                    'rx_throughput_kps': 0.0,
-                    'rx_throughput_mbps': 0.0,
-                    'sessions_down': 0,
-                    'sessions_not_started': 0,
-                    'sessions_total': 1,
-                    'sessions_up': 1,
-                    'tx_throughput_kps': 0.0,
-                    'tx_throughput_mbps': 0.0},
+                    'SessionsDown': 0,
+                    'SessionsNotStarted': 0,
+                    'SessionsTotal': 1,
+                    'SessionsUp': 1},
             'xe1': {'RxThroughput': 100.0,
-                    'Store-Forward_Avg_latency_ns': 2,
-                    'Store-Forward_Max_latency_ns': 2,
-                    'Store-Forward_Min_latency_ns': 2,
+                    'LatencyAvg': 2,
+                    'LatencyMax': 2,
+                    'LatencyMin': 2,
                     'TxThroughput': 100.0,
-                    'in_packets': 3000,
-                    'out_packets': 3000,
-                    'in_bytes': 192000,
-                    'out_bytes': 192000,
+                    'InPackets': 3000,
+                    'OutPackets': 3000,
+                    'InBytes': 192000,
+                    'OutBytes': 192000,
                     'RxThroughputBps': 6400.0,
-                    'TxThroughputBps': 6400.0,
-                    'rx_throughput_kps': 0.0,
-                    'rx_throughput_mbps': 0.0,
-                    'tx_throughput_kps': 0.0,
-                    'tx_throughput_mbps': 0.0}}
+                    'TxThroughputBps': 6400.0}}
 
         mock_get_stats.return_value = ixia_stats
         mock_prio_flow_statistics.return_value = prio_flows_stats