Skip to content

Add option to redirect guest serial console output to file #5350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Aug 18, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 9 additions & 28 deletions tests/framework/utils_iperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ def run_test(self, first_free_cpu):

clients = []
for client_idx in range(self._num_clients):
client_mode = self.client_mode(client_idx)
client_mode_flag = self.client_mode_to_iperf3_flag(client_mode)
client_future = executor.submit(
self.spawn_iperf3_client, client_idx, client_mode_flag
self.spawn_iperf3_client,
client_idx,
self.client_mode_to_iperf3_flag,
)
clients.append((client_mode, client_future))
clients.append((self._mode, client_future))

data = {"cpu_load_raw": cpu_load_future.result(), "g2h": [], "h2g": []}

Expand All @@ -79,31 +79,12 @@ def run_test(self, first_free_cpu):

return data

def client_mode(self, client_idx):
"""Converts client index into client mode"""
match self._mode:
case "g2h":
client_mode = "g2h"
case "h2g":
client_mode = "h2g"
case "bd":
# in bidirectional mode we alternate
# modes
if client_idx % 2 == 0:
client_mode = "g2h"
else:
client_mode = "h2g"
return client_mode

@staticmethod
def client_mode_to_iperf3_flag(client_mode):
@property
def client_mode_to_iperf3_flag(self):
"""Converts client mode into iperf3 mode flag"""
match client_mode:
case "g2h":
client_mode_flag = ""
case "h2g":
client_mode_flag = "-R"
return client_mode_flag
if self._mode == "h2g":
return "-R"
return ""

def spawn_iperf3_client(self, client_idx, client_mode_flag):
"""
Expand Down
8 changes: 1 addition & 7 deletions tests/integration_tests/performance/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_network_latency(network_microvm, metrics):
@pytest.mark.timeout(120)
@pytest.mark.parametrize("network_microvm", [1, 2], indirect=True)
@pytest.mark.parametrize("payload_length", ["128K", "1024K"], ids=["p128K", "p1024K"])
@pytest.mark.parametrize("mode", ["g2h", "h2g", "bd"])
@pytest.mark.parametrize("mode", ["g2h", "h2g"])
def test_network_tcp_throughput(
network_microvm,
payload_length,
Expand All @@ -109,12 +109,6 @@ def test_network_tcp_throughput(
# Time (in seconds) for which iperf runs after warmup is done
runtime_sec = 20

# We run bi-directional tests only on uVM with more than 2 vCPus
# because we need to pin one iperf3/direction per vCPU, and since we
# have two directions, we need at least two vCPUs.
if mode == "bd" and network_microvm.vcpus_count < 2:
pytest.skip("bidrectional test only done with at least 2 vcpus")

metrics.set_dimensions(
{
"performance_test": "test_network_tcp_throughput",
Expand Down
7 changes: 1 addition & 6 deletions tests/integration_tests/performance/test_vsock.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def guest_command(self, port_offset):
@pytest.mark.nonci
@pytest.mark.parametrize("vcpus", [1, 2], ids=["1vcpu", "2vcpu"])
@pytest.mark.parametrize("payload_length", ["64K", "1024K"], ids=["p64K", "p1024K"])
@pytest.mark.parametrize("mode", ["g2h", "h2g", "bd"])
@pytest.mark.parametrize("mode", ["g2h", "h2g"])
def test_vsock_throughput(
uvm_plain_acpi,
vcpus,
Expand All @@ -85,11 +85,6 @@ def test_vsock_throughput(
"""
Test vsock throughput for multiple vm configurations.
"""
# We run bi-directional tests only on uVM with more than 2 vCPus
# because we need to pin one iperf3/direction per vCPU, and since we
# have two directions, we need at least two vCPUs.
if mode == "bd" and vcpus < 2:
pytest.skip("bidrectional test only done with at least 2 vcpus")

mem_size_mib = 1024
vm = uvm_plain_acpi
Expand Down