Skip to content

Commit 192c939

Browse files
authored
Merge branch 'main' into mincore-diff-snapshots
2 parents 4cdcc76 + d9340ef commit 192c939

File tree

7 files changed

+38
-31
lines changed

7 files changed

+38
-31
lines changed

Cargo.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/clippy-tracing/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name = "clippy-tracing"
1010
bench = false
1111

1212
[dependencies]
13-
clap = { version = "4.5.40", features = ["derive"] }
13+
clap = { version = "4.5.41", features = ["derive"] }
1414
itertools = "0.14.0"
1515
proc-macro2 = { version = "1.0.95", features = ["span-locations"] }
1616
quote = "1.0.40"

src/cpu-template-helper/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ bench = false
1313
tracing = ["log-instrument", "vmm/tracing"]
1414

1515
[dependencies]
16-
clap = { version = "4.5.40", features = ["derive", "string"] }
16+
clap = { version = "4.5.41", features = ["derive", "string"] }
1717
displaydoc = "0.2.5"
1818
libc = "0.2.174"
1919
log-instrument = { path = "../log-instrument", optional = true }

src/seccompiler/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ bench = false
1717

1818
[dependencies]
1919
bincode = { version = "2.0.1", features = ["serde"] }
20-
clap = { version = "4.5.40", features = ["derive", "string"] }
20+
clap = { version = "4.5.41", features = ["derive", "string"] }
2121
displaydoc = "0.2.5"
2222
libc = "0.2.174"
2323
serde = { version = "1.0.219", features = ["derive"] }

src/snapshot-editor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ bench = false
1313
tracing = ["log-instrument", "fc_utils/tracing", "vmm/tracing"]
1414

1515
[dependencies]
16-
clap = { version = "4.5.40", features = ["derive", "string"] }
16+
clap = { version = "4.5.41", features = ["derive", "string"] }
1717
displaydoc = "0.2.5"
1818

1919
fc_utils = { package = "utils", path = "../utils" }

src/vmm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ gdb = ["arrayvec", "gdbstub", "gdbstub_arch"]
1717
acpi_tables = { path = "../acpi-tables" }
1818
aes-gcm = { version = "0.10.1", default-features = false, features = ["aes"] }
1919
arrayvec = { version = "0.7.6", optional = true }
20-
aws-lc-rs = { version = "1.13.1", features = ["bindgen"] }
20+
aws-lc-rs = { version = "1.13.2", features = ["bindgen"] }
2121
base64 = "0.22.1"
2222
bincode = { version = "2.0.1", features = ["serde"] }
2323
bitflags = "2.9.1"

tests/integration_tests/performance/test_rate_limiter.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
# The iperf version to run this tests with
1010
IPERF_BINARY = "iperf3"
1111

12+
# iperf server side log path inside guest
13+
GUEST_IPERF_SERVER_LOG = "/tmp/iperf-server.log"
14+
1215
# Interval used by iperf to get maximum bandwidth
1316
IPERF_TRANSMIT_TIME = 4
1417

@@ -127,7 +130,7 @@ def test_rx_rate_limiting_cpu_load(uvm_plain):
127130
threshold=20,
128131
)
129132
with cpu_load_monitor:
130-
_run_iperf_on_host(iperf_cmd)
133+
_run_iperf_on_host(iperf_cmd, test_microvm)
131134

132135

133136
def _check_tx_rate_limiting(test_microvm):
@@ -141,7 +144,7 @@ def _check_tx_rate_limiting(test_microvm):
141144

142145
# First step: get the transfer rate when no rate limiting is enabled.
143146
# We are receiving the result in KBytes from iperf.
144-
print("Run guest TX iperf with no rate-limit")
147+
print("Run guest TX iperf for no rate limiting")
145148
rate_no_limit_kbps = _get_tx_bandwidth_with_duration(
146149
test_microvm, eth0.host_ip, IPERF_TRANSMIT_TIME
147150
)
@@ -157,11 +160,12 @@ def _check_tx_rate_limiting(test_microvm):
157160
assert _get_percentage_difference(rate_no_limit_kbps, expected_kbps) > 100
158161

159162
# Second step: check bandwidth when rate limiting is on.
163+
print("Run guest TX iperf for rate limiting without burst")
160164
_check_tx_bandwidth(test_microvm, eth1.host_ip, expected_kbps)
161165

162166
# Third step: get the number of bytes when rate limiting is on and there is
163167
# an initial burst size from where to consume.
164-
print("Run guest TX iperf with exact burst size")
168+
print("Run guest TX iperf for rate limiting with burst")
165169
# Use iperf to obtain the bandwidth when there is burst to consume from,
166170
# send exactly BURST_SIZE packets.
167171
iperf_cmd = "{} -c {} -n {} -f KBytes -w {} -N".format(
@@ -189,7 +193,7 @@ def _check_rx_rate_limiting(test_microvm):
189193

190194
# First step: get the transfer rate when no rate limiting is enabled.
191195
# We are receiving the result in KBytes from iperf.
192-
print("Run guest RX iperf with no rate-limit")
196+
print("Run guest RX iperf with no rate limiting")
193197
rate_no_limit_kbps = _get_rx_bandwidth_with_duration(
194198
test_microvm, eth0.guest_ip, IPERF_TRANSMIT_TIME
195199
)
@@ -205,11 +209,12 @@ def _check_rx_rate_limiting(test_microvm):
205209
assert _get_percentage_difference(rate_no_limit_kbps, expected_kbps) > 100
206210

207211
# Second step: check bandwidth when rate limiting is on.
212+
print("Run guest RX iperf for rate limiting without burst")
208213
_check_rx_bandwidth(test_microvm, eth1.guest_ip, expected_kbps)
209214

210215
# Third step: get the number of bytes when rate limiting is on and there is
211216
# an initial burst size from where to consume.
212-
print("Run guest RX iperf with exact burst size")
217+
print("Run guest RX iperf for rate limiting with burst")
213218
# Use iperf to obtain the bandwidth when there is burst to consume from,
214219
# send exactly BURST_SIZE packets.
215220
iperf_cmd = "{} {} -c {} -n {} -f KBytes -w {} -N".format(
@@ -219,8 +224,7 @@ def _check_rx_rate_limiting(test_microvm):
219224
BURST_SIZE,
220225
IPERF_TCP_WINDOW,
221226
)
222-
iperf_out = _run_iperf_on_host(iperf_cmd)
223-
print(iperf_out)
227+
iperf_out = _run_iperf_on_host(iperf_cmd, test_microvm)
224228
_, burst_kbps = _process_iperf_output(iperf_out)
225229
print("RX burst_kbps: {}".format(burst_kbps))
226230
# Test that the burst bandwidth is at least as two times the rate limit.
@@ -357,9 +361,7 @@ def _get_rx_bandwidth_with_duration(test_microvm, guest_ip, duration):
357361
duration,
358362
IPERF_TCP_WINDOW,
359363
)
360-
iperf_out = _run_iperf_on_host(iperf_cmd)
361-
print(iperf_out)
362-
364+
iperf_out = _run_iperf_on_host(iperf_cmd, test_microvm)
363365
_, observed_kbps = _process_iperf_output(iperf_out)
364366
print("RX observed_kbps: {}".format(observed_kbps))
365367
return observed_kbps
@@ -383,7 +385,7 @@ def _patch_iface_bw(test_microvm, iface_id, rx_or_tx, new_bucket_size, new_refil
383385

384386
def _start_iperf_server_on_guest(test_microvm):
385387
"""Start iperf in server mode through an SSH connection."""
386-
iperf_cmd = "{} -sD -f KBytes\n".format(IPERF_BINARY)
388+
iperf_cmd = f"{IPERF_BINARY} -sD -f KBytes --logfile {GUEST_IPERF_SERVER_LOG}"
387389
test_microvm.ssh.run(iperf_cmd)
388390

389391
# Wait for the iperf daemon to start.
@@ -411,10 +413,15 @@ def _start_iperf_server_on_host(netns_cmd_prefix):
411413
time.sleep(1)
412414

413415

414-
def _run_iperf_on_host(iperf_cmd):
416+
def _run_iperf_on_host(iperf_cmd, test_microvm):
415417
"""Execute a client related iperf command locally."""
416-
code, stdout, stderr = utils.check_output(iperf_cmd)
417-
assert code == 0, f"stdout: {stdout}\nstderr: {stderr}"
418+
rc, stdout, stderr = utils.run_cmd(iperf_cmd)
419+
assert rc == 0, "stdout:\n{}\nstderr:\n{}\niperf server log:\n{}\n".format(
420+
stdout,
421+
stderr,
422+
test_microvm.ssh.check_output(f"cat {GUEST_IPERF_SERVER_LOG}").stdout,
423+
)
424+
print(f"iperf log:\n{stdout}")
418425

419426
return stdout
420427

0 commit comments

Comments
 (0)