Skip to content

WeTest creates temporary files which are not removed #89

@vnadot

Description

@vnadot

I run a first time the script (with macros) as user a. The script works fine. Then I try to run it as user b and I got the following message:

$ ./${WETEST_PATH}/${WETEST_NAME} ./test/misc/WeTest/destination/WeTest_sbct_destinations.yaml --no-gui --force-play --propagate-macros -m on_failure="continue"
Traceback (most recent call last):
  File "/nix/store/pnkbr2dx35h9rz9zn3fgvcgvfr73smvs-python3.9-wetest-2.0.0rc1/bin/..wetest-wrapped-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/pnkbr2dx35h9rz9zn3fgvcgvfr73smvs-python3.9-wetest-2.0.0rc1/lib/python3.9/site-packages/wetest/command_line.py", line 426, in main
    suite, configs = generate_tests(
  File "/nix/store/pnkbr2dx35h9rz9zn3fgvcgvfr73smvs-python3.9-wetest-2.0.0rc1/lib/python3.9/site-packages/wetest/command_line.py", line 171, in generate_tests
    tests_data = ScenarioReader(
  File "/nix/store/pnkbr2dx35h9rz9zn3fgvcgvfr73smvs-python3.9-wetest-2.0.0rc1/lib/python3.9/site-packages/wetest/testing/reader.py", line 343, in __init__
    self.deserialized = self._deserialize()
  File "/nix/store/pnkbr2dx35h9rz9zn3fgvcgvfr73smvs-python3.9-wetest-2.0.0rc1/lib/python3.9/site-packages/wetest/testing/reader.py", line 437, in _deserialize
    new_sc = ScenarioReader(
  File "/nix/store/pnkbr2dx35h9rz9zn3fgvcgvfr73smvs-python3.9-wetest-2.0.0rc1/lib/python3.9/site-packages/wetest/testing/reader.py", line 356, in __init__
    with open(tempo_file_path, "w") as yml_wo_macros:
PermissionError: [Errno 13] Permission denied: '/tmp/no_macros.yml'

The 2 users can write in /tmp but can't overwrite the `/tmp/no_macros.yml' file of the other user.

I think that WeTest should remove these files at the end of WeTest execution (and should manage the case of a savage exit (ctrl-c in terminal for example).

(for CEA agent only: this happened here)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions