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


##########
behave_framework/src/minifi_test_framework/steps/flow_building_steps.py:
##########
@@ -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 guid")

Review Comment:
   Good point, updated in 
https://github.com/apache/nifi-minifi-cpp/pull/2068/commits/b8250775e0b5cc7bcdf119015c8903c8584e57ac



##########
extensions/splunk/tests/features/splunk.feature:
##########
@@ -17,51 +17,67 @@
 @ENABLE_SPLUNK
 Feature: Sending data to Splunk HEC using PutSplunkHTTP
 
-  Background:
-    Given the content of "/tmp/output" is monitored
-
   Scenario: A MiNiFi instance transfers data to a Splunk HEC
     Given a Splunk HEC is set up and running
     And a GetFile processor with the "Input Directory" property set to 
"/tmp/input"
     And a file with the content "foobar" is present in "/tmp/input"
-    And a PutSplunkHTTP processor set up to communicate with the Splunk HEC 
instance
-    And a QuerySplunkIndexingStatus processor set up to communicate with the 
Splunk HEC Instance
+    And a PutSplunkHTTP processor
+    And PutSplunkHTTP is EVENT_DRIVEN
+    And a QuerySplunkIndexingStatus processor
+    And QuerySplunkIndexingStatus is EVENT_DRIVEN
     And the "Splunk Request Channel" properties of the PutSplunkHTTP and 
QuerySplunkIndexingStatus processors are set to the same random guid
     And the "Source" property of the PutSplunkHTTP processor is set to 
"my-source"
     And the "Source Type" property of the PutSplunkHTTP processor is set to 
"my-source-type"
     And the "Host" property of the PutSplunkHTTP processor is set to "my-host"
+    And the "Hostname" property of the PutSplunkHTTP processor is set to 
"http://splunk-${scenario_id}";
+    And the "Port" property of the PutSplunkHTTP processor is set to "8088"
+    And the "Token" property of the PutSplunkHTTP processor is set to "Splunk 
176fae97-f59d-4f08-939a-aa6a543f2485"
+    And the "Hostname" property of the QuerySplunkIndexingStatus processor is 
set to "http://splunk-${scenario_id}";
+    And the "Port" property of the QuerySplunkIndexingStatus processor is set 
to "8088"
+    And the "Token" property of the QuerySplunkIndexingStatus processor is set 
to "Splunk 176fae97-f59d-4f08-939a-aa6a543f2485"
     And a PutFile processor with the "Directory" property set to "/tmp/output"
+    And PutFile is EVENT_DRIVEN
+
     And the "success" relationship of the GetFile processor is connected to 
the PutSplunkHTTP
     And the "success" relationship of the PutSplunkHTTP processor is connected 
to the QuerySplunkIndexingStatus
     And the "undetermined" relationship of the QuerySplunkIndexingStatus 
processor is connected to the QuerySplunkIndexingStatus
     And the "acknowledged" relationship of the QuerySplunkIndexingStatus 
processor is connected to the PutFile
-    And the "Hostname" property of the PutSplunkHTTP processor is set to 
"http://splunk-${feature_id}";
-    And the "Hostname" property of the QuerySplunkIndexingStatus processor is 
set to "http://splunk-${feature_id}";
+    And PutFile's success relationship is auto-terminated
 
-    When both instances start up
-    Then a flowfile with the content "foobar" is placed in the monitored 
directory in less than 20 seconds
+    When the MiNiFi instance starts up
+    Then there is a single file with "foobar" content in the "/tmp/output" 
directory in less than 120 seconds
     And an event is registered in Splunk HEC with the content "foobar" with 
"my-source" set as source and "my-source-type" set as sourcetype and "my-host" 
set as host
 
-
   Scenario: A MiNiFi instance transfers data to a Splunk HEC with SSL enabled
     Given a Splunk HEC is set up and running
     And a GetFile processor with the "Input Directory" property set to 
"/tmp/input"
     And a file with the content "foobar" is present in "/tmp/input"
-    And a PutSplunkHTTP processor set up to communicate with the Splunk HEC 
instance
-    And a QuerySplunkIndexingStatus processor set up to communicate with the 
Splunk HEC Instance
+    And a PutSplunkHTTP processor
+    And PutSplunkHTTP is EVENT_DRIVEN
+    And a QuerySplunkIndexingStatus processor
+    And QuerySplunkIndexingStatus is EVENT_DRIVEN
     And the "Splunk Request Channel" properties of the PutSplunkHTTP and 
QuerySplunkIndexingStatus processors are set to the same random guid
     And the "Source" property of the PutSplunkHTTP processor is set to 
"my-source"
     And the "Source Type" property of the PutSplunkHTTP processor is set to 
"my-source-type"
     And the "Host" property of the PutSplunkHTTP processor is set to "my-host"
+    And the "Hostname" property of the PutSplunkHTTP processor is set to 
"https://splunk-${scenario_id}";
+    And the "Port" property of the PutSplunkHTTP processor is set to "8088"
+    And the "Token" property of the PutSplunkHTTP processor is set to "Splunk 
176fae97-f59d-4f08-939a-aa6a543f2485"
+    And the "Hostname" property of the QuerySplunkIndexingStatus processor is 
set to "https://splunk-${scenario_id}";
+    And the "Port" property of the QuerySplunkIndexingStatus processor is set 
to "8088"
+    And the "Token" property of the QuerySplunkIndexingStatus processor is set 
to "Splunk 176fae97-f59d-4f08-939a-aa6a543f2485"
+    And an ssl context service is set up for PutSplunkHTTP
+    And an ssl context service is set up for QuerySplunkIndexingStatus
     And a PutFile processor with the "Directory" property set to "/tmp/output"
+    And PutFile is EVENT_DRIVEN
+
     And the "success" relationship of the GetFile processor is connected to 
the PutSplunkHTTP
     And the "success" relationship of the PutSplunkHTTP processor is connected 
to the QuerySplunkIndexingStatus
     And the "undetermined" relationship of the QuerySplunkIndexingStatus 
processor is connected to the QuerySplunkIndexingStatus
     And the "acknowledged" relationship of the QuerySplunkIndexingStatus 
processor is connected to the PutFile
+    And PutFile's success relationship is auto-terminated
     And SSL is enabled for the Splunk HEC and the SSL context service is set 
up for PutSplunkHTTP and QuerySplunkIndexingStatus
-    And the "Hostname" property of the PutSplunkHTTP processor is set to 
"https://splunk-${feature_id}";
-    And the "Hostname" property of the QuerySplunkIndexingStatus processor is 
set to "https://splunk-${feature_id}";
 
-    When both instances start up
-    Then a flowfile with the content "foobar" is placed in the monitored 
directory in less than 20 seconds
+    When the MiNiFi instance starts up
+    Then there is a single file with "foobar" content in the "/tmp/output" 
directory in less than 120 seconds

Review Comment:
   It seems the test scenario runtime was increased due to the default 
penalization period of 30 seconds instead of the previously used 1 second in 
tests. After changing it to 1 second I could restore the original timeout in 
https://github.com/apache/nifi-minifi-cpp/pull/2068/commits/b8250775e0b5cc7bcdf119015c8903c8584e57ac



##########
extensions/splunk/tests/features/steps/splunk_container.py:
##########
@@ -0,0 +1,116 @@
+# 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 json
+
+from OpenSSL import crypto
+from minifi_test_framework.containers.container import Container
+from minifi_test_framework.core.minifi_test_context import MinifiTestContext
+from minifi_test_framework.core.helpers import wait_for_condition, retry_check
+from minifi_test_framework.containers.file import File
+from minifi_test_framework.core.ssl_utils import make_server_cert
+
+
+class SplunkContainer(Container):
+    def __init__(self, test_context: MinifiTestContext):
+        super().__init__("splunk/splunk:9.2.1-patch2", 
f"splunk-{test_context.scenario_id}", test_context.network)
+        self.user = None
+
+        self.environment = ["SPLUNK_LICENSE_URI=Free",
+                            "SPLUNK_START_ARGS=--accept-license",
+                            "SPLUNK_PASSWORD=splunkadmin"]
+
+        splunk_config_content = """
+splunk:
+  hec:
+    enable: True
+    ssl: False
+    port: 8088
+    token: 176fae97-f59d-4f08-939a-aa6a543f2485
+"""
+        self.files.append(File("/tmp/defaults/default.yml", 
splunk_config_content, mode="rw", permissions=0o644))
+
+        splunk_cert, splunk_key = make_server_cert(self.container_name, 
test_context.root_ca_cert, test_context.root_ca_key)
+        splunk_cert_content = crypto.dump_certificate(crypto.FILETYPE_PEM, 
splunk_cert)
+        splunkt_key_content = crypto.dump_privatekey(crypto.FILETYPE_PEM, 
splunk_key)
+        root_ca_content = crypto.dump_certificate(crypto.FILETYPE_PEM, 
test_context.root_ca_cert)
+        self.files.append(File("/opt/splunk/etc/auth/splunk_cert.pem", 
splunk_cert_content.decode() + splunkt_key_content.decode() + 
root_ca_content.decode(), permissions=0o644))

Review Comment:
   Fixed in 
https://github.com/apache/nifi-minifi-cpp/pull/2068/commits/b8250775e0b5cc7bcdf119015c8903c8584e57ac



-- 
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