szaszm commented on code in PR #2077:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2077#discussion_r2606420000
##########
behave_framework/src/minifi_test_framework/containers/container.py:
##########
@@ -418,3 +419,25 @@ def directory_contains_file_with_json_content(self,
directory_path: str, expecte
continue
return False
+
+ def directory_contains_file_with_minimum_size(self, directory_path: str,
expected_size: int) -> bool:
+ if not self.container or not self.not_empty_dir_exists(directory_path):
+ return False
+
+ command = "sh -c {}".format(shlex.quote(f"find {directory_path}
-maxdepth 1 -type f -exec stat -c %s {{}} \\;"))
Review Comment:
This should do it in one command, and the size filtering can be removed from
below. Also I don't think wrapping in `sh -c` is necessary, but I've raised
comment this in an earlier PR too
```suggestion
command = f"find \"{directory_path}\" -maxdepth 1 -type f -size
+{expected_size}"
```
##########
behave_framework/src/minifi_test_framework/containers/nifi_container.py:
##########
@@ -0,0 +1,89 @@
+# 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 io
+import gzip
+from typing import List, Optional
+from minifi_test_framework.containers.file import File
+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.minifi.nifi_flow_definition import
NifiFlowDefinition
+
+
+class NifiContainer(Container):
+ NIFI_VERSION = '2.2.0'
Review Comment:
Can we update this to the latest version? Should be 2.7.1 soon
--
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]