Skip to content

Commit

Permalink
tests/test_uffd: revert to correct working dir
Browse files Browse the repository at this point in the history
`spawn_pf_handler` changes the current working directory to `/`
which causes some tests that are run after this call to fail.
Revert to the correct working directory before exiting from
spawn_pf_handler.

Signed-off-by: Alexandru-Cezar Sardan <alsardan@amazon.com>
  • Loading branch information
Alexandru-Cezar Sardan authored and alsrdn committed May 6, 2022
1 parent 93c3eb2 commit 77cfb9c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/integration_tests/functional/test_uffd.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def spawn_pf_handler(vm, handler_path, mem_path):

uffd_handler = UffdHandler(handler_name, args)
real_root = os.open("/", os.O_RDONLY)
working_dir = os.getcwd()

os.chroot(vm.chroot())
os.chdir('/')
Expand All @@ -89,6 +90,7 @@ def spawn_pf_handler(vm, handler_path, mem_path):

os.fchdir(real_root)
os.chroot(".")
os.chdir(working_dir)

return uffd_handler

Expand Down

0 comments on commit 77cfb9c

Please sign in to comment.