Skip to content
Open
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 @@ -31,6 +31,13 @@
from .minifi_protocol import MinifiProtocol


CA_CERT_PATHS = [
"/usr/local/share/certs/ca-root-nss.crt",
"/etc/ssl/certs/ca-certificates.crt",
"/etc/pki/tls/certs/ca-bundle.crt"
]


class NormalDeployment:
def __init__(self):
self.conf_path = "/opt/minifi/minifi-current/conf"
Expand Down Expand Up @@ -67,9 +74,10 @@ def __init__(self, container_name: str, test_context: MinifiTestContext,
minifi_client_cert, minifi_client_key = make_cert_without_extended_usage(common_name=self.container_name,
ca_cert=test_context.root_ca_cert,
ca_key=test_context.root_ca_key)
self.files.append(File("/usr/local/share/certs/ca-root-nss.crt", dump_cert(test_context.root_ca_cert)))
self.files.append(File("/tmp/resources/root_ca.crt", dump_cert(test_context.root_ca_cert)))
self.files.append(File("/etc/ssl/certs/ca-certificates.crt", dump_cert(test_context.root_ca_cert)))
if test_context.override_default_ca_cert_files:
for ca_cert_path in CA_CERT_PATHS:
self.files.append(File(ca_cert_path, dump_cert(test_context.root_ca_cert)))
self.files.append(File("/tmp/resources/minifi_client.crt", dump_cert(minifi_client_cert)))
self.files.append(File("/tmp/resources/minifi_client.key", dump_key(minifi_client_key)))
self.files.append(
Expand Down Expand Up @@ -143,5 +151,5 @@ def _get_log_properties_file_content(self):
return "\n".join(lines)

def add_example_python_processors(self):
run_minifi_cmd = f'{self.deployment_type.bin_path}/minifi.sh run'
run_minifi_cmd = f'{self.deployment_type.bin_path}/minifi'
self.command = f'sh -c "cp -r {self.deployment_type.minifi_python_examples_path} {self.deployment_type.minifi_python_path}/examples && {run_minifi_cmd}"'
1 change: 1 addition & 0 deletions behave_framework/src/minifi_behave/core/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def common_before_scenario(context: Context, scenario: Scenario):
context.containers = {}
context.resource_dir = None
context.root_ca_cert, context.root_ca_key = make_self_signed_cert("root CA")
context.override_default_ca_cert_files = True

for step in scenario.steps:
inject_scenario_id(context, step)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class MinifiTestContext(Context):
resource_dir: str | None
root_ca_key: RSAPrivateKey
root_ca_cert: Certificate
override_default_ca_cert_files: bool

def get_or_create_minifi_container(self, container_name: str) -> MinifiContainer:
if container_name not in self.containers:
Expand Down
1 change: 1 addition & 0 deletions extensions/python/tests/features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def before_scenario(context, scenario):

common_before_scenario(context, scenario)
context.minifi_container_image = "apacheminificpp-python:latest"
context.override_default_ca_cert_files = False


def after_scenario(context, scenario):
Expand Down
Loading