- # ... and packets to be sent
- self.sleep(0.1)
- vectors = self.statistics.get_counter('/nodes/pg1-tx/vectors')
-
- self.assertEqual(tx[0]['bytes'] - tx_before_sending[0]['bytes'],
- bytes_to_send)
- self.assertEqual(tx[0]['packets'] - tx_before_sending[0]['packets'],
- 5)
- self.assertEqual(rx[0]['bytes'] - rx_before_sending[0]['bytes'],
- bytes_to_send)
- self.assertEqual(rx[0]['packets'] - rx_before_sending[0]['packets'],
- 5)
- self.assertEqual(vectors[0], rx[0]['packets'])
-
- for i in self.pg_interfaces:
- i.unconfig()
- i.admin_down()
+ self.virtual_sleep(1)
+ vectors = self.statistics.get_counter("/nodes/pg1-tx/vectors")
+
+ rx_bytes = 0
+ rx_packets = 0
+ tx_bytes = 0
+ tx_packets = 0
+ for i in range(1 + self.vpp_worker_count):
+ rx_bytes += rx[i]["bytes"] - rx_before_sending[i]["bytes"]
+ rx_packets += rx[i]["packets"] - rx_before_sending[i]["packets"]
+ tx_bytes += tx[i]["bytes"] - tx_before_sending[i]["bytes"]
+ tx_packets += tx[i]["packets"] - tx_before_sending[i]["packets"]
+ self.assertEqual(tx_bytes, bytes_to_send)
+ self.assertEqual(tx_packets, 5)
+ self.assertEqual(rx_bytes, bytes_to_send)
+ self.assertEqual(rx_packets, 5)
+ self.assertEqual(vectors[0], rx[0]["packets"])