Skip to content

Commit 77cfb9c

Browse files
Alexandru-Cezar Sardanalsrdn
Alexandru-Cezar Sardan
authored andcommitted
tests/test_uffd: revert to correct working dir
`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 <[email protected]>
1 parent 93c3eb2 commit 77cfb9c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/integration_tests/functional/test_uffd.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def spawn_pf_handler(vm, handler_path, mem_path):
6868

6969
uffd_handler = UffdHandler(handler_name, args)
7070
real_root = os.open("/", os.O_RDONLY)
71+
working_dir = os.getcwd()
7172

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

9091
os.fchdir(real_root)
9192
os.chroot(".")
93+
os.chdir(working_dir)
9294

9395
return uffd_handler
9496

0 commit comments

Comments
 (0)