Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 4 additions & 6 deletions tests/integration_tests/functional/test_vsock.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,11 @@ def test_vsock_transport_reset_h2g(
# it shouldn't receive anything.
worker.sock.settimeout(0.25)
response = worker.sock.recv(32)
if response != b"":
# If we reach here, it means the connection did not close.
assert False, "Connection not closed: response recieved '{}'".format(
response.decode("utf-8")
)
assert (
response == b""
), f"Connection not closed: response recieved '{response.decode('utf-8')}'"
except (SocketTimeout, ConnectionResetError, BrokenPipeError):
assert True
pass

# Terminate VM.
metrics = test_vm.flush_metrics()
Expand Down
12 changes: 4 additions & 8 deletions tests/integration_tests/performance/test_huge_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ def test_hugetlbfs_diff_snapshot(microvm_factory, uvm_plain, uffd_handler_paths)
uvm_plain.resume()

# Run command to dirty some pages
rc, _, _ = uvm_plain.ssh.run("sync")
assert not rc
uvm_plain.ssh.check_output("sync")

snapshot_diff = uvm_plain.snapshot_diff()
snapshot_merged = snapshot_diff.rebase_snapshot(base_snapshot)
Expand Down Expand Up @@ -181,13 +180,11 @@ def test_ept_violation_count(

# Wait for microvm to boot. Then spawn fast_page_fault_helper to setup an environment where we can trigger
# a lot of fast_page_faults after restoring the snapshot.
rc, _, _ = vm.ssh.run(
vm.ssh.check_output(
"nohup /usr/local/bin/fast_page_fault_helper >/dev/null 2>&1 </dev/null &"
)
assert not rc

rc, pid, _ = vm.ssh.run("pidof fast_page_fault_helper")
assert not rc
_, pid, _ = vm.ssh.check_output("pidof fast_page_fault_helper")

# Give the helper time to initialize
time.sleep(5)
Expand All @@ -211,8 +208,7 @@ def test_ept_violation_count(
vm.restore_from_snapshot(snapshot, resume=True, uffd_path=SOCKET_PATH)

# Verify if guest can run commands, and also wake up the fast page fault helper to trigger page faults.
rc, _, _ = vm.ssh.run(f"kill -s {signal.SIGUSR1} {pid}")
assert not rc
vm.ssh.check_output(f"kill -s {signal.SIGUSR1} {pid}")

# Give the helper time to touch all its pages
time.sleep(5)
Expand Down
3 changes: 2 additions & 1 deletion tools/devtool
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ CTR_FC_ROOT_DIR="/firecracker"

# Full path to the build dir, as bind-mounted in the container.
CTR_FC_BUILD_DIR="${CTR_FC_ROOT_DIR}/build"
CTR_TEST_RESULTS_DIR="${CTR_FC_ROOT_DIR}/test_results"

# Full path to the cargo target dir, as bind-mounted in the container.
CTR_CARGO_TARGET_DIR="$CTR_FC_BUILD_DIR/cargo_target"
Expand Down Expand Up @@ -230,7 +231,7 @@ cmd_fix_perms() {
run_devctr \
--workdir "$CTR_FC_ROOT_DIR" \
-- \
chown -R "$(id -u):$(id -g)" "$CTR_FC_BUILD_DIR"
chown -R "$(id -u):$(id -g)" "$CTR_FC_BUILD_DIR" "$CTR_TEST_RESULTS_DIR"
}

# Builds the development container from its Dockerfile.
Expand Down
Loading