How splunk/pytest-splunk-addon works
pytest-splunk-addon is a dynamic testing tool for Splunk apps and add-ons. Its user-facing workflow is to configure a Splunk app, derive test inputs and sample events, run checks against a Splunk instance, and optionally produce CIM compliance output. The graph includes app parsing, sample generation and ingestion, CIM and field validation, and Splunk integration. Some subsystem paths are supported by the tree and SOURCE INDEX, but their internal calls were not sampled; those relationships are left out or marked unverified.
Main entry points: base_event_ingestor.py Ingestor interface · __init__.py Addon config parser · splunk.py Splunk fixtures · transforms_parser.py Transforms parser
Components 22
App Parsing
- Addon config parser
pytest_splunk_addon/addon_parser/__init__.py - Props parser
pytest_splunk_addon/addon_parser/props_parser.py - Transforms parser
pytest_splunk_addon/addon_parser/transforms_parser.py - Field definitions
pytest_splunk_addon/addon_parser/fields.py - Parser cache
pytest_splunk_addon/addon_parser/parser_cache.py
Samples and Ingestion
- Sample config parser
pytest_splunk_addon/sample_generation/pytest_splunk_addon_data_parser.py - Sample stanza
pytest_splunk_addon/sample_generation/sample_stanza.py - Sample rules
pytest_splunk_addon/sample_generation/rule.py - Sample event
pytest_splunk_addon/sample_generation/sample_event.py - Sample generator
pytest_splunk_addon/sample_generation/sample_generator.py - Ingestion dispatcher
pytest_splunk_addon/event_ingestors/ingestor_helper.py - Ingestor interface
pytest_splunk_addon/event_ingestors/base_event_ingestor.py - HEC event ingestion
pytest_splunk_addon/event_ingestors/hec_event_ingestor.py - HEC raw ingestion
pytest_splunk_addon/event_ingestors/hec_raw_ingestor.py - File monitoring ingestion
pytest_splunk_addon/event_ingestors/file_monitor_ingestor.py
Addon Validation
- CIM data models
pytest_splunk_addon/cim_tests/data_model_handler.py - CIM field checks
pytest_splunk_addon/cim_tests/field_test_helper.py - Compliance reports
pytest_splunk_addon/cim_compliance/cim_report_generator.py - Markdown output
pytest_splunk_addon/cim_compliance/markdown_report.py
Splunk Runtime
- Splunk fixtures
pytest_splunk_addon/splunk.py - Splunk service
Other components
- Addon developer
Connections 20
- Addon developer → Splunk fixtures: configures tests
- Addon config parser → Props parser: parses config
pytest_splunk_addon/addon_parser/__init__.py - Addon config parser → Transforms parser: parses config
pytest_splunk_addon/addon_parser/__init__.py - Addon config parser → Field definitions: loads fields
pytest_splunk_addon/addon_parser/__init__.py - Props parser → Transforms parser: reads transforms
pytest_splunk_addon/addon_parser/props_parser.py - Transforms parser → Parser cache: caches parsing
pytest_splunk_addon/addon_parser/transforms_parser.py - Sample config parser → Sample stanza: creates stanzas
pytest_splunk_addon/sample_generation/pytest_splunk_addon_data_parser.py - Sample config parser → Sample rules: uses rules
pytest_splunk_addon/sample_generation/pytest_splunk_addon_data_parser.py - Sample generator → Sample event: creates events
pytest_splunk_addon/sample_generation/__init__.py - Splunk fixtures → Ingestion dispatcher: dispatches ingestion
pytest_splunk_addon/splunk.py - Ingestion dispatcher → Ingestor interface: selects ingestor
pytest_splunk_addon/event_ingestors/ingestor_helper.py - Ingestor interface → HEC event ingestion: implemented by
pytest_splunk_addon/event_ingestors/hec_event_ingestor.py - Ingestor interface → HEC raw ingestion: implemented by
pytest_splunk_addon/event_ingestors/hec_raw_ingestor.py - Ingestor interface → File monitoring ingestion: implemented by
pytest_splunk_addon/event_ingestors/file_monitor_ingestor.py - HEC event ingestion → Splunk service: sends events
pytest_splunk_addon/event_ingestors/hec_event_ingestor.py - HEC raw ingestion → Splunk service: sends raw data
pytest_splunk_addon/event_ingestors/hec_raw_ingestor.py - File monitoring ingestion → Splunk service: configures forwarder
pytest_splunk_addon/event_ingestors/file_monitor_ingestor.py - CIM data models → Addon config parser: maps event tags
pytest_splunk_addon/cim_tests/data_model_handler.py - Compliance reports → Markdown output: renders report
pytest_splunk_addon/cim_compliance/cim_report_generator.py - Splunk fixtures → Splunk service: connects to
pytest_splunk_addon/splunk.py