ROX-31266: Implement tests with valid and invalid utf 8 strings#251
ROX-31266: Implement tests with valid and invalid utf 8 strings#251JoukoVirtanen wants to merge 6 commits intomainfrom
Conversation
Molter73
left a comment
There was a problem hiding this comment.
I still need to go through the rust unit tests, my first impression is that they are quite convoluted for testing some functions that are relatively simple and straightforward. The integration tests provide a lot more value because they are testing not just those functions but also the BPF programs and the rest of the userspace logic, I would focus on those.
tests/test_file_open.py
Outdated
| ['0.txt', '1.txt', '2.txt'], | ||
| ['café.txt', 'файл.txt', '测试.txt'], | ||
| ]) | ||
| def test_multiple(fact, monitored_dir, server, filenames): |
There was a problem hiding this comment.
I don't know if there is much value in this change. This test is checking that multiple events are captured, so the actual paths used are not that important. Maybe we want to rollback this part?
| '测试.txt', | ||
| '🚀rocket.txt', | ||
| ]) | ||
| def test_open(fact, monitored_dir, server, filename): |
There was a problem hiding this comment.
Could we expand this to the tests on the other LSM hooks? Namely test_path_unlink.py, test_path_chmod.py and test_path_chown.py.
Description
Parameterized the filename in the existing
test_openandtest_multipletests. The input file names include regular ASCII, accents, Cyrillic, Chinese, and emoji.Unit tests were also added for
slice_to_string,sanitize_d_path, and creation of processes with valid ASCII, Cyrillic, Chinese, Japanese, Arabic, emoji, and invalid UTF-8.Checklist
Automated testing
If any of these don't apply, please comment below.
Testing Performed
CI is sufficient