Commit graph

22 commits

Author SHA1 Message Date
Tomas Kopecek
b030b46f74 remove unittest2 2020-10-06 15:00:23 +02:00
Yu Ming Zhu
52a63f732d util: [rmtree] try best to catch errors for race condition
fixes: #2481

This approach is ugly, but just working.

ENOENT and ESTALE errors are catched in `chdir`, `listdir` calls to stomach the deletion by other process/thread

ENOTEMPTY is catched when calling `os.rmdir(path)` in `rmtree()` too. It happens when `path` is on an NFS like where ESTALE happens.
2020-10-05 10:14:34 +02:00
Ken Dreyer
e35b571196 util: handle ENOENT in _stripcwd() listdir loop
After we call listdir(), another thread or process might delete files
from the current directory. We cannot always expect lstat() to succeed
in a loop over the initial listdir entries.

If lstat() raises ENOENT, consider this file deleted and move on.
2020-08-27 13:36:27 +02:00
Tomas Kopecek
a4863c0f26 lib: check consistency of rpm from openRemoteFile
Fixes: https://pagure.io/koji/issue/2130
2020-06-05 10:58:38 +02:00
Tomas Kopecek
8ea4a7245b lib: retry openRemoteFile and check size 2020-06-05 10:58:38 +02:00
Tomas Kopecek
aad9fac8d9 move from urrlib.request.urlopen to requests.get
Fixes: https://pagure.io/koji/issue/1530
2019-11-25 11:31:08 +01:00
Yuming Zhu
b2b8d5f9cc strict per item in config_files 2019-10-15 09:14:16 +02:00
Yu Ming Zhu
4c1928f377 extract read_config_files util for config parsing 2019-10-15 09:14:16 +02:00
Mike McLean
f0cdeaab07 tests for joinpath 2019-10-09 08:41:15 -04:00
Tomas Kopecek
6fd33bfd1f use LANG=C for running tests comparing human-readable output 2019-06-26 15:58:48 -04:00
Yu Ming Zhu
dc208d0555 fix invokings and unittests 2019-02-17 21:26:13 -05:00
Yu Ming Zhu
9ddae41877 using ConfigParser.read_file for PY3 2019-02-17 21:26:13 -05:00
Tomas Kopecek
9963877545 move move_and_symlink to koji.util 2018-11-28 16:27:30 -05:00
Tomas Kopecek
caae1a0a8b workaround unnecessary list conversions 2018-07-11 17:37:40 -04:00
Tomas Kopecek
bcee24e50c python-modernize -f libmodernize.fixes.fix_dict_six 2018-07-11 17:37:39 -04:00
Tomas Kopecek
c68396c059 Use unittest2 for rhel6 compatibility
Fixes: https://pagure.io/koji/issue/830
2018-06-07 09:39:39 -04:00
Tomas Kopecek
2eff45f763 Drop pre-2.6 compat function koji.util._relpath
Fixes: https://pagure.io/koji/issue/818
2018-03-08 10:23:44 -05:00
Yuming Zhu
377fecbbfc fix unit test - test_formatChangelog 2017-12-06 14:08:37 +08:00
Mike McLean
1da06800cf adjustments to test_formatChangelog 2017-12-06 13:32:51 +08:00
Franz Chih-Ping Hsieh
efe68e54df - add unit test for koji/util: (coverage 58%->100%)
- minor fix: check if input string time is valid
2017-11-07 09:58:21 -05:00
Tomas Kopecek
5b23fb1629 consolidate safe_rmtree, rmtree and shutil.rmtree
shutil.rmtree should be avoided in almost all cases
safe_rmtree has its usage in tasks module, but innards are replaced with
koji.util.rmtree, so we don't have two implementations of same task

Related: https://pagure.io/koji/issue/648
2017-10-30 12:09:04 -04:00
Mike McLean
c4a48efd83 move lib tests into subdir 2017-06-01 09:39:24 +02:00
Renamed from tests/test_utils.py (Browse further)