osquery / osquery/osquery

Update and simplify python tests handling of osquery configuration

Open
#7,659 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

configuration test
Dominant language
C++
Stars
23.6k
Forks
2.6k
Avg merge
6d 7h
Merged PRs (30d)
14

Description

This is followup/cleanup work for PR https://github.com/osquery/osquery/pull/7561, which when it will be merged, the python tests will report in the logs that several flags cannot be set, because they are passed via config.

The configuration system in the python tests is not flexible enough to avoid using flags in the config file; one currently has two options: either the flags get sent to the process and set in the options section of the config file, or they are only set in the options sections.

There's also unnecessary complications with the python test reading the config file and potentially modifying it in memory to the rewrite it back to disk for osquery to read.

We would actually want to have a parameter to set flags to pass only via startup and then a separate way to generate a config file on disk which will be read by osquery, with the --config_path flag passed via flags at startup.

At the same time we could also have, for testing, a way to generate a flagfile to pass the flags.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing PR 7561 and the Python test configuration handling it affects; no specific file or test path is named here. Trace how flags and config files are currently read, modified, and passed to osquery. Done means startup-only flags, disk-generated config files, and test flagfiles can be provided separately without unnecessary in-memory config rewriting.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.