Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix test cases with PermissionError on /var/cache
Some test cases fail when run without root permission, because they want to read/write to `/var/cache`: ``` python3 -m pytest -ra tests/pytests/unit/state/test_state_format_slots.py ``` `test_format_slots_parallel` fails with: ``` Process ParallelState(always-changes-and-succeeds): Traceback (most recent call last): File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "salt/utils/process.py", line 996, in wrapped_run_func return run_func() File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "salt/state.py", line 2023, in _call_parallel_target with salt.utils.files.fopen(tfile, "wb+") as fp_: File "salt/utils/files.py", line 385, in fopen f_handle = open(*args, **kwargs) # pylint: disable=resource-leakage FileNotFoundError: [Errno 2] No such file or directory: '/var/cache/salt/minion/123/174993d470c5f21b548d929d1904021966cb279f' ``` fixes saltstack#61148 Signed-off-by: Benjamin Drung <[email protected]>
- Loading branch information