[
https://issues.apache.org/jira/browse/NIFI-15387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pierre Villard updated NIFI-15387:
----------------------------------
Fix Version/s: 2.8.0
Resolution: Fixed
Status: Resolved (was: Patch Available)
> Re-enable tests TestFetchFile, TestListFile and TestPutFile to run on Windows
> -----------------------------------------------------------------------------
>
> Key: NIFI-15387
> URL: https://issues.apache.org/jira/browse/NIFI-15387
> Project: Apache NiFi
> Issue Type: Improvement
> Reporter: Daniel Stieglitz
> Assignee: Daniel Stieglitz
> Priority: Minor
> Fix For: 2.8.0
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> The TestFetchFile class is currently disabled for running on Windows all
> eleven of its tests. This seems unnecessary as only the following two tests
> fail on Windows:
> # testMoveOnCompleteWithTargetExistsButNotWritable
> # testMoveOnCompleteWithParentOfTargetDirNotAccessible
> The reason they fail is related to the following Java
> [bug|https://bugs.java.com/bugdatabase/view_bug?bug_id=6728842] where it
> states
> {quote}File's setReadOnly method [Also setWritable(false)] does not make a
> directory read-only on Windows. Instead, it sets the DOS readonly attribute
> that prevents the directory from being deleted.
> {quote}
> The aforementioned tests are trying to make the directory (or its parent)
> where the file is to be copied to read only thereby preventing the ability to
> copy a file from one directory to another. On Linux this works but not on
> Windows due to the reported bug.
> TestListFile is currently disabled for running on Windows all eighteen of its
> tests although only the following need to be disabled
> # testListWithUnreadableFiles
> # testListWithinUnreadableDirectory
> # testListingNeedsSufficientPrivilegesAndFittingFilter
> # testAttributesSet
> The first three need to be disabled on Windows as they use java.io.File
> setReadable(false) which as explained earlier does not work on Windows. The
> last one expects the file owner attribute to contain the user name but it is
> not (not sure why).
> TestPutFile is also currently disabled for running on Windows for all nine of
> its tests. This is also unnecessary as only one of its tests testPutFile
> should be disabled since it relies on POSIX permissions which is only
> relevant on Linux since Windows isn't natively POSIX compliant.
> The purpose of this ticket is to re-enable the nine other tests in
> TestFetchFile on Windows, re-enable the other fourteen tests in TestListFile
> on Windows, re-enable the other eight tests in TestPutFile on Windows and
> only disable the aforementioned tests.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)