def test_after(self, vm: Qemu, title, x): vm.change_qemu_parameters({"count_packets_from_guest_on": 0}) sleep(0.5) with open("/tmp/qemu_packets_count", "rb") as f: packet_count = int.from_bytes(f.read(8), byteorder='little', signed=False) total_size = int.from_bytes(f.read(8), byteorder='little', signed=False) self.packet_count_graph.add_data(title, x, packet_count) self.packet_size_graph.add_data( title, x, float(total_size) / (float(packet_count) + 0.01))
def test_before(self, vm: Qemu): vm.change_qemu_parameters({"count_packets_from_guest_on": 1})