:wave: Hello -- I'm working on tests for a table t...
# general
b
👋 Hello -- I'm working on tests for a table that parses data from a file on the local filesystem. I had a couple of questions that I'm having trouble solving with the osquery docs. I'm hoping someone here might be able to point me in the right direction. 1. How do fuzz_paths work? I understand the concept of fuzzing in general but it's unclear how it's setup and used for tables. Looking at other table spec files, the paths seem somewhat arbitrary. Is there documentation I could look at that can help me understand how to properly use this feature in osquery? 2. Is there a location to put test files? I have unit tests setup with expected file content but it would be nice to test query execution with an actual file as well.
s
The
fuzz_paths
keyword is unused, it's something from an old setup for fuzzing which is not present anymore. test files are normally in a
tests
folder near the place where the source code/module is. Normally those tests use the APIs or table functions directly. Then theres
tests/integration/tables
, and there the tests mainly query the table, verifying that the result format/schema is near to what we would expect, but there are also some that tests returned values. Ideally those tests are only to test the whole workflow and result format, while testing the actual implementation happens in the other tests, accessing the functions directly (not by calling the gen* functions).
b
That makes sense. This was very helpful, thank you!