|
@@ 175-187 (lines=13) @@
|
| 172 |
|
|
| 173 |
|
self.assertEqual(json_response, 40) |
| 174 |
|
|
| 175 |
|
def test_bytes_count_per_flow(self): |
| 176 |
|
"""Test bytes_count_per_flow rest call.""" |
| 177 |
|
flow_id = "1" |
| 178 |
|
rest_name = "bytes_count/per_flow" |
| 179 |
|
self._patch_switch_flow(flow_id) |
| 180 |
|
|
| 181 |
|
dpid_id = 111 |
| 182 |
|
response = self._get_rest_response(rest_name, dpid_id) |
| 183 |
|
|
| 184 |
|
json_response = json.loads(response.data) |
| 185 |
|
self.assertEqual(json_response[0]["flow_id"], flow_id) |
| 186 |
|
self.assertEqual(json_response[0]["bytes_counter"], 10) |
| 187 |
|
self.assertEqual(json_response[0]["bits_per_second"], 4.0) |
| 188 |
|
|
| 189 |
|
def test_bytes_count_sum(self): |
| 190 |
|
"""Test bytes_count_sum rest call.""" |
|
@@ 149-161 (lines=13) @@
|
| 146 |
|
self.assertEqual(json_response["bytes_counter"], 10) |
| 147 |
|
self.assertEqual(json_response["bits_per_second"], 4.0) |
| 148 |
|
|
| 149 |
|
def test_packet_count_per_flow(self): |
| 150 |
|
"""Test packet_count_per_flow rest call.""" |
| 151 |
|
flow_id = "1" |
| 152 |
|
rest_name = "packet_count/per_flow" |
| 153 |
|
self._patch_switch_flow(flow_id) |
| 154 |
|
|
| 155 |
|
dpid_id = 111 |
| 156 |
|
response = self._get_rest_response(rest_name, dpid_id) |
| 157 |
|
|
| 158 |
|
json_response = json.loads(response.data) |
| 159 |
|
self.assertEqual(json_response[0]["flow_id"], flow_id) |
| 160 |
|
self.assertEqual(json_response[0]["packet_counter"], 40) |
| 161 |
|
self.assertEqual(json_response[0]["packet_per_second"], 2.0) |
| 162 |
|
|
| 163 |
|
def test_packet_count_sum(self): |
| 164 |
|
"""Test packet_count_sum rest call.""" |