Skip to content

Commit 1bd63b2

Browse files
committed
test(perf/vsock): copy iperf binary only once
Problem: Currently we copy the iperf3-vsock binary into the guest in spawn_iperf3_client that is called by every client (we have 2). If by the time the second binary is being copied that first one is already executing, we get the "Text file busy" error. Solution: Move the copy into the test construction to copy the binary only once. Signed-off-by: Nikita Kalyazin <[email protected]>
1 parent 286aa17 commit 1bd63b2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/integration_tests/performance/test_vsock.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ def __init__(self, microvm, mode, payload_length):
4141
iperf="/usr/local/bin/iperf3-vsock",
4242
payload_length=payload_length,
4343
)
44+
# The rootfs does not have iperf3-vsock
45+
iperf3_guest = "/tmp/iperf3-vsock"
46+
47+
self._microvm.ssh.scp_put(self._iperf, iperf3_guest)
48+
self._guest_iperf = iperf3_guest
4449

4550
def host_command(self, port_offset):
4651
return (
@@ -58,11 +63,6 @@ def spawn_iperf3_client(self, client_idx, client_mode_flag):
5863
make_host_port_path(VSOCK_UDS_PATH, self._base_port + client_idx),
5964
)
6065
)
61-
# The rootfs does not have iperf3-vsock
62-
iperf3_guest = "/tmp/iperf3-vsock"
63-
64-
self._microvm.ssh.scp_put(self._iperf, iperf3_guest)
65-
self._guest_iperf = iperf3_guest
6666
return super().spawn_iperf3_client(client_idx, client_mode_flag)
6767

6868
def guest_command(self, port_offset):

0 commit comments

Comments
 (0)