diff --git a/test_tools/fs_utils.py b/test_tools/fs_utils.py index 497fb07..648f1b3 100644 --- a/test_tools/fs_utils.py +++ b/test_tools/fs_utils.py @@ -108,17 +108,18 @@ def copy(source: str, destination: str, force: bool = False, recursive: bool = False, - dereference: bool = False): + dereference: bool = False, + timeout: timedelta = timedelta(minutes=30)): cmd = f"cp{' --force' if force else ''}" \ f"{' --recursive' if recursive else ''}" \ f"{' --dereference' if dereference else ''} " \ f"{source} {destination}" - return TestRun.executor.run_expect_success(cmd) + return TestRun.executor.run_expect_success(cmd, timeout) -def move(source, destination, force: bool = False): +def move(source, destination, force: bool = False, timeout: timedelta = timedelta(minutes=30)): cmd = f"mv{' --force' if force else ''} \"{source}\" \"{destination}\"" - return TestRun.executor.run_expect_success(cmd) + return TestRun.executor.run_expect_success(cmd, timeout) def remove(path: str, force: bool = False, recursive: bool = False, ignore_errors: bool = False): diff --git a/test_utils/filesystem/file.py b/test_utils/filesystem/file.py index 369b510..6848598 100644 --- a/test_utils/filesystem/file.py +++ b/test_utils/filesystem/file.py @@ -54,8 +54,9 @@ class File(FsItem): destination, force: bool = False, recursive: bool = False, - dereference: bool = False): - fs_utils.copy(str(self), destination, force, recursive, dereference) + dereference: bool = False, + timeout: timedelta = timedelta(minutes=30)): + fs_utils.copy(str(self), destination, force, recursive, dereference, timeout) if fs_utils.check_if_directory_exists(destination): path = f"{destination}{'/' if destination[-1] != '/' else ''}{self.name}" else: