Skip to content

Conversation

@JoukoVirtanen
Copy link
Contributor

@JoukoVirtanen JoukoVirtanen commented Feb 6, 2026

Description

Parameterized the filename in the existing test_open and test_multiple tests. 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

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests
  • Added regression tests

If any of these don't apply, please comment below.

Testing Performed

CI is sufficient

@JoukoVirtanen JoukoVirtanen marked this pull request as ready for review February 6, 2026 06:32
@JoukoVirtanen JoukoVirtanen requested a review from a team as a code owner February 6, 2026 06:32
Copy link
Contributor

@Molter73 Molter73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@JoukoVirtanen JoukoVirtanen force-pushed the jv-ROX-31266-implement-tests-with-valid-and-invalid-utf-8-strings branch from 35fbb9e to 79f1728 Compare February 10, 2026 18:55
@JoukoVirtanen JoukoVirtanen requested review from a team and rhacs-bot as code owners February 10, 2026 18:55
@Molter73
Copy link
Contributor

The test failures you are having should be fixed by #270, try rebasing to that, apologies for the inconvenience!

Copy link
Contributor

@Molter73 Molter73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have few small comments, but overall LGTM! Thanks for tackling this one!

server: The server instance to communicate with.
filename: Name of the file to create and remove (includes UTF-8 test cases).
"""
test_file = join_path_with_filename(monitored_dir, filename)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with other tests, we might want to rename this to fut

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 36 to 40
# Convert filename to string, replacing invalid UTF-8 with U+FFFD
filename_str = path_to_string(filename)

# File Under Test
fut = '/container-dir/test.txt'
fut = f'/container-dir/{filename_str}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be condensed a bit more.

Suggested change
# Convert filename to string, replacing invalid UTF-8 with U+FFFD
filename_str = path_to_string(filename)
# File Under Test
fut = '/container-dir/test.txt'
fut = f'/container-dir/{filename_str}'
# File Under Test
fut = f'/container-dir/{path_to_string(filename)}'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For whatever reason I was not able to add this suggestion to the batch, so I made this change manually.

JoukoVirtanen and others added 8 commits February 11, 2026 09:45
Co-authored-by: Mauro Ezequiel Moltrasio <mmoltras@redhat.com>
Co-authored-by: Mauro Ezequiel Moltrasio <mmoltras@redhat.com>
Co-authored-by: Mauro Ezequiel Moltrasio <mmoltras@redhat.com>
Co-authored-by: Mauro Ezequiel Moltrasio <mmoltras@redhat.com>
@JoukoVirtanen JoukoVirtanen force-pushed the jv-ROX-31266-implement-tests-with-valid-and-invalid-utf-8-strings branch from 840df31 to dc43848 Compare February 11, 2026 17:48
@JoukoVirtanen JoukoVirtanen merged commit 6bdd52d into main Feb 11, 2026
23 checks passed
@JoukoVirtanen JoukoVirtanen deleted the jv-ROX-31266-implement-tests-with-valid-and-invalid-utf-8-strings branch February 11, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants