Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test setattr operation for the mountpoint on linux and macos #9353

Open
5 tasks
FirelightFlagboy opened this issue Jan 16, 2025 · 0 comments
Open
5 tasks

Test setattr operation for the mountpoint on linux and macos #9353

FirelightFlagboy opened this issue Jan 16, 2025 · 0 comments
Assignees
Labels
A-Client Area: Parsec desktop application I-Mountpoint Impact: Mountpoint-related issue I-Rust Impact: Rust-related stuff I-Test Test-related issue

Comments

@FirelightFlagboy
Copy link
Contributor

FirelightFlagboy commented Jan 16, 2025

Add test for setattr operations on Linux and macOS

Those test would typically lie in libparsec/crates/platform_mountpoint/tests/unit/operations/unix_setattr.rs

The osascript in question is:
#!/usr/bin/osascript

on run argv
    try
        -- Get file and dest path from arguments
        set file_path to item 1 of argv
        set dest_path to item 2 of argv

        -- Use Finder to copy the file to dest
        tell application "Finder"
            set source_file to POSIX file file_path as alias
            set destination_folder to POSIX file dest_path as alias
            duplicate source_file to destination_folder
        end tell

    on error err_msg number err_num
        -- Print error message to stderr
        do shell script "echo " & quoted form of ("Error: " & err_msg) & " >&2"
        return err_num
    end try
end run

The script is not perfect:

  • On failure, the return seems to always be 0
  • On failure, no message seems to be displayed

Originally posted by @touilleMan in #9351 (review)

@FirelightFlagboy FirelightFlagboy self-assigned this Jan 17, 2025
@FirelightFlagboy FirelightFlagboy added I-Mountpoint Impact: Mountpoint-related issue I-Rust Impact: Rust-related stuff A-Client Area: Parsec desktop application I-Test Test-related issue labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Client Area: Parsec desktop application I-Mountpoint Impact: Mountpoint-related issue I-Rust Impact: Rust-related stuff I-Test Test-related issue
Projects
None yet
Development

No branches or pull requests

1 participant