readme: add info about merge in fluent bit tests as integration Signed-off-by: Eduardo Silva edsiper@gmail.com
readme: add info about merge in fluent bit tests as integration
Signed-off-by: Eduardo Silva edsiper@gmail.com
NOTE: This project has been moved in fluent/fluent-bit/tests/integration, so this repo is no longer active.
This suite is included under tests/fluent-bit-test-suite as an in-tree developer test harness.
tests/fluent-bit-test-suite
It is intended for local development, plugin validation, and focused regression work.
It is not wired into the default Fluent Bit CMake test targets, ctest, or the default GitHub Actions workflows in this repository.
ctest
From the repository root:
cd tests/fluent-bit-test-suite ./setup-venv.sh ./run_tests.py --list ./run_tests.py
By default the suite looks for build/bin/fluent-bit. You can override that with FLUENT_BIT_BINARY=/path/to/fluent-bit.
build/bin/fluent-bit
FLUENT_BIT_BINARY=/path/to/fluent-bit
This is a binary-level integration test harness for Fluent Bit.
This project is distributed under the Apache License, Version 2.0.
It starts a real Fluent Bit process, drives real network traffic into it, captures what Fluent Bit emits, and asserts on observable behavior:
The suite is designed as a reusable tool for testing Fluent Bit plugins and protocol behavior with deterministic local infrastructure.
This framework gives you a controlled environment for testing Fluent Bit end to end without depending on external services.
It provides:
That makes it useful both for plugin development and for runtime regression testing.
+----------------------+ | Python test case | | (pytest) | +----------+-----------+ | v +----------------------+ | FluentBitTestService | | port/env orchestration | server lifecycle | bounded waits +----------+-----------+ | v +----------------------+ | FluentBitManager | | start/stop binary | logs/results | readiness | valgrind integration +----------+-----------+ | v +----------------------+ | fluent-bit binary | +-----+----------+-----+ | | input side | | output side v v real clients/tests fake receivers/exporters
src/utils/fluent_bit_manager.py
VALGRIND=1
src/utils/test_service.py
src/utils/http_matrix.py
src/server/http_server.py
src/server/otlp_server.py
src/server/splunk_server.py
src/server/forward_server.py
src/server/kafka_server.py
src/server/s3_server.py
out_s3
test client | | real protocol payload v +------------------+ | Fluent Bit | | input plugin | +------------------+ | | forwarded output v +------------------+ | fake receiver | | http / otlp | +------------------+ | v pytest assertions
Examples:
in_http
in_splunk
in_elasticsearch
in_opentelemetry
in_syslog
source input inside Fluent Bit dummy / metrics / otlp / etc | v +------------------+ | Fluent Bit | | output plugin | +------------------+ | | outbound request v +------------------+ | fake receiver | | http / otlp | +------------------+ | v pytest assertions
out_http
out_opentelemetry
out_prometheus_exporter
out_vivo_exporter
pytest client | v +------------------+ | Fluent Bit | | internal server | +------------------+ | v response validation
internal_http_server
The suite reuses a local certificate pair from:
scenarios/in_splunk/certificate/certificate.pem
scenarios/in_splunk/certificate/private_key.pem
These assets are shared across HTTP and OTLP TLS scenarios.
The HTTP matrix covers, depending on plugin support:
This lets the suite validate not only payload handling, but also the transport behavior exposed by Fluent Bit listeners and endpoints.
The suite currently exercises:
Path: scenarios/in_http
scenarios/in_http
Entry point: scenarios/in_http/tests/test_in_http_001.py
scenarios/in_http/tests/test_in_http_001.py
Covers:
Path: scenarios/in_elasticsearch
scenarios/in_elasticsearch
Entry point: scenarios/in_elasticsearch/tests/test_in_elasticsearch_001.py
scenarios/in_elasticsearch/tests/test_in_elasticsearch_001.py
/_nodes/http
in_forward
Path: scenarios/in_forward
scenarios/in_forward
Entry point: scenarios/in_forward/tests/test_in_forward_001.py
scenarios/in_forward/tests/test_in_forward_001.py
Path: scenarios/in_opentelemetry
scenarios/in_opentelemetry
Entry point: scenarios/in_opentelemetry/tests/test_in_opentelemetry_001.py
scenarios/in_opentelemetry/tests/test_in_opentelemetry_001.py
Path: scenarios/in_splunk
scenarios/in_splunk
Entry point: scenarios/in_splunk/tests/test_in_splunk_001.py
scenarios/in_splunk/tests/test_in_splunk_001.py
in_splunk -> out_splunk
in_prometheus_remote_write
Path: scenarios/in_prometheus_remote_write
scenarios/in_prometheus_remote_write
Entry point: scenarios/in_prometheus_remote_write/tests/test_in_prometheus_remote_write_001.py
scenarios/in_prometheus_remote_write/tests/test_in_prometheus_remote_write_001.py
in_http_max_connections
Path: scenarios/in_http_max_connections
scenarios/in_http_max_connections
Entry point: scenarios/in_http_max_connections/tests/test_in_http_max_connections_001.py
scenarios/in_http_max_connections/tests/test_in_http_max_connections_001.py
http_server.max_connections
in_mqtt
Path: scenarios/in_mqtt
scenarios/in_mqtt
Entry point: scenarios/in_mqtt/tests/test_in_mqtt_001.py
scenarios/in_mqtt/tests/test_in_mqtt_001.py
payload_key
Path: scenarios/in_syslog
scenarios/in_syslog
Entry point: scenarios/in_syslog/tests/test_in_syslog_001.py
scenarios/in_syslog/tests/test_in_syslog_001.py
Path: scenarios/internal_http_server
scenarios/internal_http_server
Entry point: scenarios/internal_http_server/tests/test_internal_http_server_001.py
scenarios/internal_http_server/tests/test_internal_http_server_001.py
Path: scenarios/out_http
scenarios/out_http
Entry point: scenarios/out_http/tests/test_out_http_001.py
scenarios/out_http/tests/test_out_http_001.py
out_azure_logs_ingestion
Path: scenarios/out_azure_logs_ingestion
scenarios/out_azure_logs_ingestion
Entry point: scenarios/out_azure_logs_ingestion/tests/test_out_azure_logs_ingestion_001.py
scenarios/out_azure_logs_ingestion/tests/test_out_azure_logs_ingestion_001.py
out_kafka
Path: scenarios/out_kafka
scenarios/out_kafka
Entry point: scenarios/out_kafka/tests/test_out_kafka_001.py
scenarios/out_kafka/tests/test_out_kafka_001.py
Path: scenarios/out_opentelemetry
scenarios/out_opentelemetry
Entry point: scenarios/out_opentelemetry/tests/test_out_opentelemetry_001.py
scenarios/out_opentelemetry/tests/test_out_opentelemetry_001.py
logs_body_key
logs_body_key_attributes
add_label
batch_size
logs_max_resources
logs_max_scopes
Path: scenarios/out_prometheus_exporter
scenarios/out_prometheus_exporter
Entry point: scenarios/out_prometheus_exporter/tests/test_out_prometheus_exporter_001.py
scenarios/out_prometheus_exporter/tests/test_out_prometheus_exporter_001.py
/metrics
Path: scenarios/out_s3
scenarios/out_s3
Entry point: scenarios/out_s3/tests/test_out_s3_001.py
scenarios/out_s3/tests/test_out_s3_001.py
use_put_object
out_stdout
Path: scenarios/out_stdout
scenarios/out_stdout
Entry point: scenarios/out_stdout/tests/test_out_stdout_001.py
scenarios/out_stdout/tests/test_out_stdout_001.py
Path: scenarios/out_vivo_exporter
scenarios/out_vivo_exporter
Entry point: scenarios/out_vivo_exporter/tests/test_out_vivo_exporter_001.py
scenarios/out_vivo_exporter/tests/test_out_vivo_exporter_001.py
Run the full suite with the wrapper:
./tests/fluent-bit-test-suite/run_tests.py
Run the full suite with raw pytest:
./tests/fluent-bit-test-suite/.venv/bin/pytest -q tests/fluent-bit-test-suite
List tests with the local wrapper:
./tests/fluent-bit-test-suite/run_tests.py --list
Run tests with a simple checkbox progress view:
Run a subset:
./tests/fluent-bit-test-suite/run_tests.py scenarios/in_opentelemetry -k oauth2
Run against a different binary:
FLUENT_BIT_BINARY=/path/to/fluent-bit \ ./tests/fluent-bit-test-suite/.venv/bin/pytest -q tests/fluent-bit-test-suite
Run under Valgrind:
VALGRIND=1 ./tests/fluent-bit-test-suite/.venv/bin/pytest -q tests/fluent-bit-test-suite
Require Valgrind-clean runs:
VALGRIND=1 VALGRIND_STRICT=1 \ ./tests/fluent-bit-test-suite/.venv/bin/pytest -q tests/fluent-bit-test-suite
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
NOTE: This project has been moved in fluent/fluent-bit/tests/integration, so this repo is no longer active.
Fluent Bit Python Integration Test Suite
Status In Fluent Bit
This suite is included under
tests/fluent-bit-test-suiteas an in-tree developer test harness.It is intended for local development, plugin validation, and focused regression work.
It is not wired into the default Fluent Bit CMake test targets,
ctest, or the default GitHub Actions workflows in this repository.Quick Start
From the repository root:
By default the suite looks for
build/bin/fluent-bit. You can override that withFLUENT_BIT_BINARY=/path/to/fluent-bit.What This Is
This is a binary-level integration test harness for Fluent Bit.
This project is distributed under the Apache License, Version 2.0.
It starts a real Fluent Bit process, drives real network traffic into it, captures what Fluent Bit emits, and asserts on observable behavior:
The suite is designed as a reusable tool for testing Fluent Bit plugins and protocol behavior with deterministic local infrastructure.
What This Solves
This framework gives you a controlled environment for testing Fluent Bit end to end without depending on external services.
It provides:
That makes it useful both for plugin development and for runtime regression testing.
High-Level Architecture
Main Components
Process management
src/utils/fluent_bit_manager.pyVALGRIND=1src/utils/test_service.pyTransport matrix
src/utils/http_matrix.pyHelper servers
src/server/http_server.pysrc/server/otlp_server.pysrc/server/splunk_server.pysrc/server/forward_server.pysrc/server/kafka_server.pysrc/server/s3_server.pyout_s3Data Flow
Input plugin tests
Examples:
in_httpin_splunkin_elasticsearchin_opentelemetryin_syslogOutput plugin tests
Examples:
out_httpout_opentelemetryout_prometheus_exporterout_vivo_exporterInternal endpoint tests
Examples:
internal_http_serverout_prometheus_exporterout_vivo_exporterTLS And Protocol Matrix
The suite reuses a local certificate pair from:
scenarios/in_splunk/certificate/certificate.pemscenarios/in_splunk/certificate/private_key.pemThese assets are shared across HTTP and OTLP TLS scenarios.
The HTTP matrix covers, depending on plugin support:
This lets the suite validate not only payload handling, but also the transport behavior exposed by Fluent Bit listeners and endpoints.
Current Coverage
The suite currently exercises:
Scenario Index
in_httpPath:
scenarios/in_httpEntry point:
scenarios/in_http/tests/test_in_http_001.pyCovers:
in_elasticsearchPath:
scenarios/in_elasticsearchEntry point:
scenarios/in_elasticsearch/tests/test_in_elasticsearch_001.pyCovers:
/_nodes/httpendpointsin_forwardPath:
scenarios/in_forwardEntry point:
scenarios/in_forward/tests/test_in_forward_001.pyCovers:
in_opentelemetryPath:
scenarios/in_opentelemetryEntry point:
scenarios/in_opentelemetry/tests/test_in_opentelemetry_001.pyCovers:
in_splunkPath:
scenarios/in_splunkEntry point:
scenarios/in_splunk/tests/test_in_splunk_001.pyCovers:
in_splunk -> out_splunkin_prometheus_remote_writePath:
scenarios/in_prometheus_remote_writeEntry point:
scenarios/in_prometheus_remote_write/tests/test_in_prometheus_remote_write_001.pyCovers:
in_http_max_connectionsPath:
scenarios/in_http_max_connectionsEntry point:
scenarios/in_http_max_connections/tests/test_in_http_max_connections_001.pyCovers:
http_server.max_connectionsin_mqttPath:
scenarios/in_mqttEntry point:
scenarios/in_mqtt/tests/test_in_mqtt_001.pyCovers:
payload_keyin_syslogPath:
scenarios/in_syslogEntry point:
scenarios/in_syslog/tests/test_in_syslog_001.pyCovers:
internal_http_serverPath:
scenarios/internal_http_serverEntry point:
scenarios/internal_http_server/tests/test_internal_http_server_001.pyCovers:
out_httpPath:
scenarios/out_httpEntry point:
scenarios/out_http/tests/test_out_http_001.pyCovers:
out_azure_logs_ingestionPath:
scenarios/out_azure_logs_ingestionEntry point:
scenarios/out_azure_logs_ingestion/tests/test_out_azure_logs_ingestion_001.pyCovers:
out_kafkaPath:
scenarios/out_kafkaEntry point:
scenarios/out_kafka/tests/test_out_kafka_001.pyCovers:
out_opentelemetryPath:
scenarios/out_opentelemetryEntry point:
scenarios/out_opentelemetry/tests/test_out_opentelemetry_001.pyCovers:
logs_body_keylogs_body_key_attributesadd_labelbatch_sizelogs_max_resourceslogs_max_scopesout_prometheus_exporterPath:
scenarios/out_prometheus_exporterEntry point:
scenarios/out_prometheus_exporter/tests/test_out_prometheus_exporter_001.pyCovers:
/metricsout_s3Path:
scenarios/out_s3Entry point:
scenarios/out_s3/tests/test_out_s3_001.pyCovers:
use_put_objectuploadsout_stdoutPath:
scenarios/out_stdoutEntry point:
scenarios/out_stdout/tests/test_out_stdout_001.pyCovers:
out_vivo_exporterPath:
scenarios/out_vivo_exporterEntry point:
scenarios/out_vivo_exporter/tests/test_out_vivo_exporter_001.pyCovers:
Running
Run the full suite with the wrapper:
Run the full suite with raw pytest:
List tests with the local wrapper:
Run tests with a simple checkbox progress view:
Run a subset:
Run against a different binary:
Run under Valgrind:
Require Valgrind-clean runs: