Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
class MinifiContainer(Container):
def __init__(self, container_name: str, test_context: MinifiTestContext):
super().__init__(test_context.minifi_container_image, f"{container_name}-{test_context.scenario_id}", test_context.network)
self.flow_config_str: str = ""
self.flow_definition = FlowDefinition()
self.properties: dict[str, str] = {}
self.log_properties: dict[str, str] = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def add_processor(self, processor: Processor):
def get_processor(self, processor_name: str) -> Processor | None:
return next((proc for proc in self.processors if proc.name == processor_name), None)

def get_controller_service(self, controller_service_name: str) -> ControllerService | None:
return next((controller for controller in self.controller_services if controller.name == controller_service_name), None)

def get_parameter_context(self, parameter_context_name: str) -> ParameterContext | None:
return next((parameter_context for parameter_context in self.parameter_contexts if
parameter_context.name == parameter_context_name), None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@

class Processor:
def __init__(self, class_name: str, proc_name: str, scheduling_strategy: str = "TIMER_DRIVEN",
scheduling_period: str = "1 sec", ):
scheduling_period: str = "1 sec", penalization_period: str = "1 sec"):
self.class_name = class_name
self.id: str = str(uuid.uuid4())
self.name = proc_name
self.scheduling_strategy: str = scheduling_strategy
self.scheduling_period: str = scheduling_period
self.penalization_period: str = penalization_period
self.properties: dict[str, str] = {}
self.auto_terminated_relationships: list[str] = []

Expand All @@ -46,6 +47,7 @@ def to_yaml_dict(self) -> dict:
'class': self.class_name,
'scheduling strategy': self.scheduling_strategy,
'scheduling period': self.scheduling_period,
'penalization period': self.penalization_period,
}
if self.auto_terminated_relationships:
data['auto-terminated relationships list'] = self.auto_terminated_relationships
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#

import logging
import uuid
from behave import given, step

from minifi_test_framework.containers.directory import Directory
Expand Down Expand Up @@ -246,8 +247,18 @@ def step_impl(context: MinifiTestContext, property_name: str, processor_name: st
processor.add_property(property_name, filtering)


@given("the \"{property_name}\" properties of the {processor_name_one} and {processor_name_two} processors are set to the same random UUID")
def step_impl(context, property_name, processor_name_one, processor_name_two):
uuid_str = str(uuid.uuid4())
context.get_or_create_default_minifi_container().flow_definition.get_processor(processor_name_one).add_property(property_name, uuid_str)
context.get_or_create_default_minifi_container().flow_definition.get_processor(processor_name_two).add_property(property_name, uuid_str)


# TLS
def add_ssl_context_service_for_minifi(context: MinifiTestContext, cert_name: str):
ssl_context_service = context.get_or_create_default_minifi_container().flow_definition.get_controller_service("SSLContextService")
if ssl_context_service is not None:
return
controller_service = ControllerService(class_name="SSLContextService", service_name="SSLContextService")
controller_service.add_property("Client Certificate", f"/tmp/resources/{cert_name}.crt")
controller_service.add_property("Private Key", f"/tmp/resources/{cert_name}.key")
Expand Down
3 changes: 2 additions & 1 deletion docker/RunBehaveTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,5 @@ exec \
"${docker_dir}/../extensions/opc/tests/features" \
"${docker_dir}/../extensions/kafka/tests/features" \
"${docker_dir}/../extensions/couchbase/tests/features" \
"${docker_dir}/../extensions/elasticsearch/tests/features"
"${docker_dir}/../extensions/elasticsearch/tests/features" \
"${docker_dir}/../extensions/splunk/tests/features"
9 changes: 0 additions & 9 deletions docker/test/integration/cluster/ContainerStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from .containers.HttpProxyContainer import HttpProxyContainer
from .containers.PostgreSQLServerContainer import PostgreSQLServerContainer
from .containers.MqttBrokerContainer import MqttBrokerContainer
from .containers.SplunkContainer import SplunkContainer
from .containers.SyslogUdpClientContainer import SyslogUdpClientContainer
from .containers.SyslogTcpClientContainer import SyslogTcpClientContainer
from .containers.MinifiAsPodInKubernetesCluster import MinifiAsPodInKubernetesCluster
Expand Down Expand Up @@ -169,14 +168,6 @@ def acquire_container(self, context, container_name: str, engine='minifi-cpp', c
network=self.network,
image_store=self.image_store,
command=command))
elif engine == 'splunk':
return self.containers.setdefault(container_name,
SplunkContainer(feature_context=feature_context,
name=container_name,
vols=self.vols,
network=self.network,
image_store=self.image_store,
command=command))
elif engine == "syslog-udp-client":
return self.containers.setdefault(container_name,
SyslogUdpClientContainer(
Expand Down
18 changes: 0 additions & 18 deletions docker/test/integration/cluster/DockerTestCluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from .checkers.GcsChecker import GcsChecker
from .checkers.PostgresChecker import PostgresChecker
from .checkers.PrometheusChecker import PrometheusChecker
from .checkers.SplunkChecker import SplunkChecker
from .checkers.GrafanaLokiChecker import GrafanaLokiChecker
from .checkers.ModbusChecker import ModbusChecker
from .checkers.MqttHelper import MqttHelper
Expand All @@ -48,7 +47,6 @@ def __init__(self, context, feature_id):
self.azure_checker = AzureChecker(self.container_communicator)
self.gcs_checker = GcsChecker(self.container_communicator)
self.postgres_checker = PostgresChecker(self.container_communicator)
self.splunk_checker = SplunkChecker(self.container_communicator)
self.prometheus_checker = PrometheusChecker()
self.grafana_loki_checker = GrafanaLokiChecker()
self.minifi_controller_executor = MinifiControllerExecutor(self.container_communicator)
Expand Down Expand Up @@ -236,22 +234,6 @@ def check_azure_blob_and_snapshot_count(self, blob_and_snapshot_count, timeout_s
def check_azure_blob_storage_is_empty(self, timeout_seconds):
return self.azure_checker.check_azure_blob_storage_is_empty(timeout_seconds)

def check_splunk_event(self, container_name, query):
container_name = self.container_store.get_container_name_with_postfix(container_name)
return self.splunk_checker.check_splunk_event(container_name, query)

def check_splunk_event_with_attributes(self, container_name, query, attributes):
container_name = self.container_store.get_container_name_with_postfix(container_name)
return self.splunk_checker.check_splunk_event_with_attributes(container_name, query, attributes)

def enable_splunk_hec_indexer(self, container_name, hec_name):
container_name = self.container_store.get_container_name_with_postfix(container_name)
return self.splunk_checker.enable_splunk_hec_indexer(container_name, hec_name)

def enable_splunk_hec_ssl(self, container_name, splunk_cert_pem, splunk_key_pem, root_ca_cert_pem):
container_name = self.container_store.get_container_name_with_postfix(container_name)
return self.splunk_checker.enable_splunk_hec_ssl(container_name, splunk_cert_pem, splunk_key_pem, root_ca_cert_pem)

def check_google_cloud_storage(self, gcs_container_name, content):
gcs_container_name = self.container_store.get_container_name_with_postfix(gcs_container_name)
return self.gcs_checker.check_google_cloud_storage(gcs_container_name, content)
Expand Down
5 changes: 0 additions & 5 deletions docker/test/integration/cluster/ImageStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ def get_image(self, container_engine):
image = self.__build_postgresql_server_image()
elif container_engine == "mqtt-broker":
image = self.__build_mqtt_broker_image()
elif container_engine == "splunk":
image = self.__build_splunk_image()
elif container_engine == "kinesis-server":
image = self.__build_kinesis_image()
elif container_engine == "reverse-proxy":
Expand Down Expand Up @@ -295,9 +293,6 @@ def __build_mqtt_broker_image(self):
def __build_kinesis_image(self):
return self.__build_image_by_path(self.test_dir + "/resources/kinesis-mock", 'kinesis-server')

def __build_splunk_image(self):
return self.__build_image_by_path(self.test_dir + "/resources/splunk-hec", 'minifi-splunk')

def __build_reverse_proxy_image(self):
return self.__build_image_by_path(self.test_dir + "/resources/reverse-proxy", 'reverse-proxy')

Expand Down
80 changes: 0 additions & 80 deletions docker/test/integration/cluster/checkers/SplunkChecker.py

This file was deleted.

44 changes: 0 additions & 44 deletions docker/test/integration/cluster/containers/SplunkContainer.py

This file was deleted.

15 changes: 0 additions & 15 deletions docker/test/integration/features/MiNiFi_integration_test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ def acquire_container(self, context, name, engine='minifi-cpp', command=None):
def acquire_transient_minifi(self, context, name, engine='minifi-cpp'):
return self.cluster.acquire_transient_minifi(context=context, name=name, engine=engine)

def start_splunk(self, context):
self.cluster.acquire_container(context=context, name='splunk', engine='splunk')
self.cluster.deploy_container(name='splunk')
assert self.cluster.wait_for_container_startup_to_finish('splunk') or self.cluster.log_app_output()
assert self.cluster.enable_splunk_hec_indexer('splunk', 'splunk_hec_token') or self.cluster.log_app_output()

def start_minifi_c2_server(self, context):
self.cluster.acquire_container(context=context, name="minifi-c2-server", engine="minifi-c2-server")
self.cluster.deploy_container('minifi-c2-server')
Expand Down Expand Up @@ -303,12 +297,6 @@ def check_http_proxy_access(self, http_proxy_container_name, url):
def check_azure_storage_server_data(self, azure_container_name, object_data):
assert self.cluster.check_azure_storage_server_data(azure_container_name, object_data) or self.cluster.log_app_output()

def check_splunk_event(self, splunk_container_name, query):
assert self.cluster.check_splunk_event(splunk_container_name, query) or self.cluster.log_app_output()

def check_splunk_event_with_attributes(self, splunk_container_name, query, attributes):
assert self.cluster.check_splunk_event_with_attributes(splunk_container_name, query, attributes) or self.cluster.log_app_output()

def check_google_cloud_storage(self, gcs_container_name, content):
assert self.cluster.check_google_cloud_storage(gcs_container_name, content) or self.cluster.log_app_output()

Expand Down Expand Up @@ -384,9 +372,6 @@ def enable_prometheus_in_minifi(self):
def enable_prometheus_with_ssl_in_minifi(self):
self.cluster.enable_prometheus_with_ssl_in_minifi()

def enable_splunk_hec_ssl(self, container_name, splunk_cert_pem, splunk_key_pem, root_ca_cert_pem):
self.cluster.enable_splunk_hec_ssl(container_name, splunk_cert_pem, splunk_key_pem, root_ca_cert_pem)

def enable_sql_in_minifi(self):
self.cluster.enable_sql_in_minifi()

Expand Down
Loading
Loading