Skip to content

Commit

Permalink
test: hugepages: use SSHConnection.check_output instead of run
Browse files Browse the repository at this point in the history
Seems like it got missed during the big refactor that introduced
`check_output` somehow.

Fixes: acbef3c
Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
  • Loading branch information
roypat committed Sep 12, 2024
1 parent ab90734 commit c873765
Showing 1 changed file with 4 additions and 8 deletions.
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 @@ -132,8 +132,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 @@ -186,13 +185,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 @@ -217,8 +214,7 @@ def test_ept_violation_count(
vm.wait_for_up()

# 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

0 comments on commit c873765

Please sign in to comment.