Mola-maker opened a new issue, #9082:
URL: https://github.com/apache/opendal/issues/9082

   ### OpenDAL version or commit
   
   main (f5ef36e)
   
   ### Affected service or component
   
   services/ftp: lister (`core/services/ftp/src/lister.rs`, `reader.rs`)
   
   ### Describe the bug
   
   Listing `dir/` is expected to return `dir/` itself before its children. fs, 
sftp and the other services do this, and the behavior tests check it. The ftp 
lister drops `.` entries and never emits the directory, so:
   
   - listing an empty directory returns nothing,
   - a listing is missing the entry the behavior tests expect.
   
   The ftp behavior tests are disabled in CI 
(`.github/services/ftp/vsftpd/disable_action.yml`), so this has not been caught 
there.
   
   ### Steps to Reproduce
   
   Serve `services::Fs` over FTP with OpenDAL's own `integrations/unftp-sbe` 
(libunftp 0.23), then run the ftp behavior tests against it:
   
   ```
   OPENDAL_TEST=ftp OPENDAL_FTP_ENDPOINT=ftp://127.0.0.1:2128 
OPENDAL_FTP_ROOT=/ \
   OPENDAL_FTP_USER=anonymous OPENDAL_FTP_PASSWORD=x \
     cargo test --test behavior --features tests,services-ftp -- 
--test-threads=1
   ```
   
   ```
   test result: FAILED. 105 passed; 13 failed
   ---- behavior::test_list_empty_dir ----
   assertion `left == right` failed: only return the dir itself, but found: {}
   ---- behavior::test_list_nested_dir ----
   assertion `left == right` failed: parent should got 2 entry
   ---- behavior::test_list_rich_dir ----
   assertion `left == right` failed
   ```
   
   The other 10 failures are ranged reads. unftp-sbe deliberately rejects 
`REST`, so they are not related to this bug.
   
   ### Actual Behavior
   
   The listed directory itself is never returned.
   
   ### Expected Behavior
   
   `list("dir/")` returns `dir/` first when the directory exists, and nothing 
when it does not.
   
   ### Additional Context
   
   Some servers answer `LIST` on a missing path with an empty success, so an 
empty listing alone does not prove the directory exists. Confirming it in the 
parent listing distinguishes an empty directory from a missing one.
   
   ### Reproduction confirmation
   
   - [x] I reproduced this issue against the affected component. For a 
service-specific report, I used the actual service rather than only a mock, 
emulator, or source-code analysis.
   
   ### Are you willing to submit a PR to fix this bug?
   
   - [x] Yes, I would like to submit a PR.
   


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