lordgamez commented on code in PR #2091:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2091#discussion_r2797756414


##########
behave_framework/src/minifi_test_framework/containers/container.py:
##########
@@ -50,6 +51,23 @@ def __init__(self, image_name: str, container_name: str, 
network: Network, comma
     def add_host_file(self, host_path: str, container_path: str, mode: str = 
"ro"):
         self.host_files.append(HostFile(container_path, host_path, mode))
 
+    def add_file_to_running_container(self, content: str, path: str):
+        if not self.container:
+            logging.error("Container is not running. Cannot add file.")
+            raise RuntimeError("Container is not running. Cannot add file.")
+
+        mkdir_command = f"mkdir -p {shlex.quote(path)}"
+        exit_code, output = self.exec_run(mkdir_command)
+        if exit_code != 0:
+            logging.error(f"Error creating directory '{path}' in container: 
{output}")
+            raise RuntimeError(f"Error creating directory '{path}' in 
container: {output}")
+
+        file_name = str(uuid.uuid4())
+        exit_code, output = self.exec_run(f"sh -c \"printf %s '{content}' > 
{os.path.join(path, file_name)}\"")

Review Comment:
   Updated in 
https://github.com/apache/nifi-minifi-cpp/pull/2091/commits/7fbce69752eac921b6cc10cbb85cffb650eed5dc



##########
behave_framework/src/minifi_test_framework/steps/core_steps.py:
##########
@@ -95,11 +112,31 @@ def step_impl(context: MinifiTestContext):
     context.get_or_create_default_minifi_container().stop()
 
 
+@when("\"{container_name}\" flow is stopped")

Review Comment:
   Updated in 
https://github.com/apache/nifi-minifi-cpp/pull/2091/commits/7fbce69752eac921b6cc10cbb85cffb650eed5dc



##########
extensions/mqtt/tests/features/steps/mqtt_broker_container.py:
##########
@@ -0,0 +1,63 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import logging
+import re
+from textwrap import dedent
+
+from minifi_test_framework.containers.container import Container
+from minifi_test_framework.core.helpers import wait_for_condition
+from minifi_test_framework.core.minifi_test_context import MinifiTestContext
+from minifi_test_framework.containers.docker_image_builder import 
DockerImageBuilder
+from docker.errors import ContainerError
+
+
+class MqttBrokerContainer(Container):
+    def __init__(self, test_context: MinifiTestContext):
+        dockerfile = dedent("""\
+            FROM {base_image}
+            RUN echo 'log_dest stderr' >> /mosquitto-no-auth.conf
+            CMD ["/usr/sbin/mosquitto", "--verbose", "--config-file", 
"/mosquitto-no-auth.conf"]
+            """.format(base_image='eclipse-mosquitto:2.0.14'))

Review Comment:
   Updated in 
https://github.com/apache/nifi-minifi-cpp/pull/2091/commits/7fbce69752eac921b6cc10cbb85cffb650eed5dc



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to