teemtee / tmt

Test Management Tool
MIT License
81 stars 122 forks source link

/var/tmp/tmt result dir is removed if it is symlink and replaced by regular directory #3151

Open jscotka opened 1 month ago

jscotka commented 1 month ago

Hi, I wanted to avoid to set TMT_WORKDIR_ROOT everytime so I've decided to do symlink /var/tmp/tmt -> /home/jscotka/tmt-output to my home dir. And TMT removed my symlink and replaced it by directory. I see there 2 possible issues:

  1. TMT should not remove any file if exist, it is dangerous if user can have there some data.
  2. TMT should folow /var/tmp/tmt symlink and after it found the target is dir TMT should be happy enough and use it.

    Thanks&Regards Honza

lukaszachy commented 1 month ago

@jscotka Could you please provide step-by-step, ideally on fresh machine? I wasn't able to reproduce with:

# tmt --version
tmt version: 1.35.0

# ls -l /var/tmp/
total 4
lrwxrwxrwx. 1 root root 14 Aug 27 16:38 tmt -> /home/foo/THIS
-rw-r--r--. 1 root root  0 Aug 27 16:38 tmt-test.pid.lock

# tmt run
....
total: 1 test passed

# ls -l /var/tmp/
total 4
lrwxrwxrwx. 1 root root 14 Aug 27 16:38 tmt -> /home/foo/THIS
-rw-r--r--. 1 root root  0 Aug 27 16:38 tmt-test.pid.lock