|
@@ 169-181 (lines=13) @@
|
| 166 |
|
|
| 167 |
|
self.assertEqual(json_response, 40) |
| 168 |
|
|
| 169 |
|
def test_bytes_count_per_flow(self): |
| 170 |
|
"""Test bytes_count_per_flow rest call.""" |
| 171 |
|
flow_id = "1" |
| 172 |
|
rest_name = "bytes_count/per_flow" |
| 173 |
|
self._patch_switch_flow(flow_id) |
| 174 |
|
|
| 175 |
|
dpid_id = 111 |
| 176 |
|
response = self._get_rest_response(rest_name, dpid_id) |
| 177 |
|
|
| 178 |
|
json_response = json.loads(response.data) |
| 179 |
|
self.assertEqual(json_response[0]["flow_id"], flow_id) |
| 180 |
|
self.assertEqual(json_response[0]["bytes_counter"], 10) |
| 181 |
|
self.assertEqual(json_response[0]["bits_per_second"], 4.0) |
| 182 |
|
|
| 183 |
|
def test_bytes_count_sum(self): |
| 184 |
|
"""Test bytes_count_sum rest call.""" |
|
@@ 143-155 (lines=13) @@
|
| 140 |
|
self.assertEqual(json_response["bytes_counter"], 10) |
| 141 |
|
self.assertEqual(json_response["bits_per_second"], 4.0) |
| 142 |
|
|
| 143 |
|
def test_packet_count_per_flow(self): |
| 144 |
|
"""Test packet_count_per_flow rest call.""" |
| 145 |
|
flow_id = "1" |
| 146 |
|
rest_name = "packet_count/per_flow" |
| 147 |
|
self._patch_switch_flow(flow_id) |
| 148 |
|
|
| 149 |
|
dpid_id = 111 |
| 150 |
|
response = self._get_rest_response(rest_name, dpid_id) |
| 151 |
|
|
| 152 |
|
json_response = json.loads(response.data) |
| 153 |
|
self.assertEqual(json_response[0]["flow_id"], flow_id) |
| 154 |
|
self.assertEqual(json_response[0]["packet_counter"], 40) |
| 155 |
|
self.assertEqual(json_response[0]["packet_per_second"], 2.0) |
| 156 |
|
|
| 157 |
|
def test_packet_count_sum(self): |
| 158 |
|
"""Test packet_count_sum rest call.""" |