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

smb: add support for SMB #6448

Merged
merged 19 commits into from Sep 30, 2022
Merged

smb: add support for SMB #6448

merged 19 commits into from Sep 30, 2022

Conversation

Lesmiscore
Copy link
Contributor

What is the purpose of this change?

Add the SMB backend

Was the change discussed in an issue or in the forum before?

Closes #2042

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

@albertony
Copy link
Contributor

albertony commented Sep 17, 2022

Interesting! 👍

Maybe we should cross-link its doc page with the local backend, which today mentions:

Network paths in UNC format, \\server\share, are also supported.

I assume this SMB backend will overlap with that? And then what are the (dis-)advantages with either of them?

Edit: Of course, the above relates to Windows-specific local backend.

@Lesmiscore
Copy link
Contributor Author

Maybe we should cross-link its doc page with the local backend, which today mentions:

Network paths in UNC format, \server\share, are also supported.

I guess so

I assume this SMB backend will overlap with that? And then what are the (dis-)advantages with either of them?

The benefit for this is that it works without Windows or GVFS installation, even on embedded devices or CIs

backend/smb/smb.go Outdated Show resolved Hide resolved
@ncw
Copy link
Member

ncw commented Sep 19, 2022

This is a great piece of work - thank you :-)

How are the integration tests looking?

Do you think you could make a docker image so we can run integration tests automatically, something like

https://github.com/rclone/rclone/blob/master/fstest/testserver/init.d/TestFTPProftpd

?

Maybe using something like this? https://hub.docker.com/r/dperson/samba

@Lesmiscore
Copy link
Contributor Author

How are the integration tests looking?

$ go test -v backend/smb/smb_test.go -args --verbose --remote samba-test:extrastorage/sambatransfer/rcloneintegrationtest/
=== RUN   TestIntegration
    fstests.go:454: Using remote "samba-test:extrastorage/sambatransfer/rcloneintegrationtest/"
2022/09/20 13:22:35 DEBUG : Creating backend with remote "samba-test:extrastorage/sambatransfer/rcloneintegrationtest//rclone-test-kuyujof0wumanig8fiqapal6"
2022/09/20 13:22:35 DEBUG : Using config file from "/home/lesmi/.config/rclone/rclone.conf"
=== RUN   TestIntegration/FsCheckWrap
    fstests.go:495: Not a wrapping Fs
=== RUN   TestIntegration/FsCommand
    fstests.go:523: No commands in this remote
=== RUN   TestIntegration/FsRmdirNotFound
    fstests.go:538: Skipping test as non root bucket-based remote
=== RUN   TestIntegration/FsString
=== RUN   TestIntegration/FsName
=== RUN   TestIntegration/FsRoot
=== RUN   TestIntegration/FsRmdirEmpty
=== RUN   TestIntegration/FsMkdir
=== RUN   TestIntegration/FsMkdir/FsMkdirRmdirSubdir
2022/09/20 13:22:35 DEBUG : dir/subdir: Making directory
2022/09/20 13:22:35 INFO  : dir/subdir: Removing directory
2022/09/20 13:22:35 INFO  : dir: Removing directory
=== RUN   TestIntegration/FsMkdir/FsListEmpty
=== RUN   TestIntegration/FsMkdir/FsListDirEmpty
=== RUN   TestIntegration/FsMkdir/FsListRDirEmpty
    fstests.go:415: FS has no ListR interface
=== RUN   TestIntegration/FsMkdir/FsListDirNotFound
2022/09/20 13:22:35 ERROR : does not exist: error listing: directory not found
=== RUN   TestIntegration/FsMkdir/FsListRDirNotFound
    fstests.go:415: FS has no ListR interface
=== RUN   TestIntegration/FsMkdir/FsEncoding
=== RUN   TestIntegration/FsMkdir/FsEncoding/control_chars
    fstests.go:710: testing "␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟␡"
=== RUN   TestIntegration/FsMkdir/FsEncoding/dot
    fstests.go:710: testing "."
=== RUN   TestIntegration/FsMkdir/FsEncoding/dot_dot
    fstests.go:710: testing ".."
=== RUN   TestIntegration/FsMkdir/FsEncoding/punctuation
    fstests.go:710: testing "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
=== RUN   TestIntegration/FsMkdir/FsEncoding/leading_space
    fstests.go:710: testing " leading space"
=== RUN   TestIntegration/FsMkdir/FsEncoding/leading_tilde
    fstests.go:710: testing "~leading tilde"
=== RUN   TestIntegration/FsMkdir/FsEncoding/leading_CR
    fstests.go:710: testing "␍leading CR"
=== RUN   TestIntegration/FsMkdir/FsEncoding/leading_LF
    fstests.go:710: testing "␊leading LF"
=== RUN   TestIntegration/FsMkdir/FsEncoding/leading_HT
    fstests.go:710: testing "␉leading HT"
=== RUN   TestIntegration/FsMkdir/FsEncoding/leading_VT
    fstests.go:710: testing "␋leading VT"
=== RUN   TestIntegration/FsMkdir/FsEncoding/leading_dot
    fstests.go:710: testing ".leading dot"
=== RUN   TestIntegration/FsMkdir/FsEncoding/trailing_space
    fstests.go:710: testing "trailing space "
=== RUN   TestIntegration/FsMkdir/FsEncoding/trailing_CR
    fstests.go:710: testing "trailing CR␍"
=== RUN   TestIntegration/FsMkdir/FsEncoding/trailing_LF
    fstests.go:710: testing "trailing LF␊"
=== RUN   TestIntegration/FsMkdir/FsEncoding/trailing_HT
    fstests.go:710: testing "trailing HT␉"
=== RUN   TestIntegration/FsMkdir/FsEncoding/trailing_VT
    fstests.go:710: testing "trailing VT␋"
=== RUN   TestIntegration/FsMkdir/FsEncoding/trailing_dot
    fstests.go:710: testing "trailing dot."
=== RUN   TestIntegration/FsMkdir/FsEncoding/invalid_UTF-8
    fstests.go:710: testing "invalid utf-8\xfe"
=== RUN   TestIntegration/FsMkdir/FsEncoding/URL_encoding
    fstests.go:710: testing "test%46.txt"
=== RUN   TestIntegration/FsMkdir/FsNewObjectNotFound
=== RUN   TestIntegration/FsMkdir/FsPutError
2022/09/20 13:22:36 DEBUG : hello? sausage/êé/Hello, 世界/ " ' @ < > & ? + ≠/z.txt: removed after failed upload: potato
=== RUN   TestIntegration/FsMkdir/FsPutZeroLength
=== RUN   TestIntegration/FsMkdir/FsOpenWriterAt
    fstests.go:783: FS has no OpenWriterAt interface
=== RUN   TestIntegration/FsMkdir/FsChangeNotify
    fstests.go:819: FS has no ChangeNotify interface
=== RUN   TestIntegration/FsMkdir/FsPutFiles
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListDirFile2
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListRDirFile2
    fstests.go:415: FS has no ListR interface
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListR
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListRSubdir
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListDirRoot
2022/09/20 13:22:36 DEBUG : Creating backend with remote "samba-test:extrastorage/sambatransfer/rcloneintegrationtest/"
2022/09/20 13:22:37 DEBUG : smb://guest@100.123.26.48:445/extrastorage/sambatransfer/rcloneintegrationtest: Using root directory "extrastorage/sambatransfer/rcloneintegrationtest"
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListRDirRoot
    fstests.go:415: FS has no ListR interface
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListSubdir
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListRSubdir#01
    fstests.go:415: FS has no ListR interface
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListLevel2
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListRLevel2
    fstests.go:415: FS has no ListR interface
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListFile1
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsNewObject
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsNewObjectCaseInsensitive
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsNewObjectCaseInsensitive/Dir
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsListFile1and2
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsNewObjectDir
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsPurge
    fstests.go:1104: FS has no Purge interface
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsCopy
    fstests.go:1141: FS has no Copier interface
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsMove
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsDirMove
2022/09/20 13:22:37 DEBUG : Creating backend with remote "samba-test:extrastorage/sambatransfer/rcloneintegrationtest//rclone-test-gogoruc6wokihub8fizutik5"
2022/09/20 13:22:37 DEBUG : smb://guest@100.123.26.48:445/extrastorage/sambatransfer/rcloneintegrationtest/rclone-test-gogoruc6wokihub8fizutik5: Purge dir "new_name"
2022/09/20 13:22:37 DEBUG : smb://guest@100.123.26.48:445/extrastorage/sambatransfer/rcloneintegrationtest/rclone-test-gogoruc6wokihub8fizutik5: Purge dir ""
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsRmdirFull
    fstests.go:1301: Skipping test as non root bucket-based remote
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsPrecision
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectString
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectFs
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectRemote
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectHashes
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectModTime
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectMimeType
    fstests.go:1379: MimeType method not supported
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectMetadata
    fstests.go:1408: Metadata method not supported
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectSetModTime
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectSize
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectOpen
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectOpenSeek
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectOpenRange
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectPartialRead
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectUpdate
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectStorable
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsIsFile
2022/09/20 13:22:37 DEBUG : Creating backend with remote "samba-test:extrastorage/sambatransfer/rcloneintegrationtest//rclone-test-kuyujof0wumanig8fiqapal6/hello? sausage/êé/Hello, 世界/ \" ' @ < > & ? + ≠/z.txt"
2022/09/20 13:22:37 DEBUG : smb://guest@100.123.26.48:445/extrastorage/sambatransfer/rcloneintegrationtest/rclone-test-kuyujof0wumanig8fiqapal6/hello? sausage/êé/Hello, 世界/ " ' @ < > & ? + ≠: Using root directory "extrastorage/sambatransfer/rcloneintegrationtest/rclone-test-kuyujof0wumanig8fiqapal6/hello? sausage/êé/Hello, 世界/ \" ' @ < > & ? + ≠"
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsIsFileNotFound
2022/09/20 13:22:37 DEBUG : Creating backend with remote "samba-test:extrastorage/sambatransfer/rcloneintegrationtest//rclone-test-kuyujof0wumanig8fiqapal6/not found.txt"
2022/09/20 13:22:37 ERROR : : error listing: directory not found
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FromRoot
    fstests.go:1601: Can't list from root on this remote
=== RUN   TestIntegration/FsMkdir/FsPutFiles/PublicLink
    fstests.go:1705: FS has no PublicLinker interface
=== RUN   TestIntegration/FsMkdir/FsPutFiles/SetTier
    fstests.go:428: FS has no SetTier & GetTier interfaces
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectCheckWrap
    fstests.go:1808: Not a wrapping Fs
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectRemove
=== RUN   TestIntegration/FsMkdir/FsPutFiles/ObjectAbout
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsPutStream
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsPutStream/0
=== RUN   TestIntegration/FsMkdir/FsPutFiles/FsPutStream/100
=== RUN   TestIntegration/FsMkdir/FsPutFiles/Internal
    fstests.go:1904: *smb.Fs does not implement InternalTester
=== RUN   TestIntegration/FsMkdir/FsPutChunked
    fstests.go:1921: *smb.Fs does not implement SetUploadChunkSizer
=== RUN   TestIntegration/FsMkdir/FsUploadUnknownSize
=== RUN   TestIntegration/FsMkdir/FsUploadUnknownSize/FsPutUnknownSize
=== RUN   TestIntegration/FsMkdir/FsUploadUnknownSize/FsUpdateUnknownSize
=== RUN   TestIntegration/FsMkdir/FsRootCollapse
2022/09/20 13:22:37 DEBUG : Creating backend with remote "samba-test:extrastorage/sambatransfer/rcloneintegrationtest//rclone-test-kuyujof0wumanig8fiqapal6/deeper/nonexisting/directory"
2022/09/20 13:22:37 DEBUG : Waiting for deletions to finish
2022/09/20 13:22:37 INFO  : hello? sausage/êé/Hello, 世界/ " ' @ < > & ? + ≠/z.txt: Deleted
2022/09/20 13:22:37 INFO  : hello? sausage/êé/Hello, 世界/ " ' @ < > & ? + ≠: Removing directory
2022/09/20 13:22:37 INFO  : hello? sausage/êé/Hello, 世界: Removing directory
2022/09/20 13:22:37 INFO  : hello? sausage/êé: Removing directory
2022/09/20 13:22:37 INFO  : hello? sausage: Removing directory
2022/09/20 13:22:37 INFO  : smb://guest@100.123.26.48:445/extrastorage/sambatransfer/rcloneintegrationtest/rclone-test-kuyujof0wumanig8fiqapal6: Removing directory
2022/09/20 13:22:37 ERROR : : error listing: directory not found
=== RUN   TestIntegration/FsShutdown
2022/09/20 13:22:37 DEBUG : smb://guest@100.123.26.48:445/extrastorage/sambatransfer/rcloneintegrationtest/rclone-test-kuyujof0wumanig8fiqapal6: Closing 2 unused connections
--- PASS: TestIntegration (1.85s)
    --- SKIP: TestIntegration/FsCheckWrap (0.00s)
    --- SKIP: TestIntegration/FsCommand (0.00s)
    --- SKIP: TestIntegration/FsRmdirNotFound (0.00s)
    --- PASS: TestIntegration/FsString (0.00s)
    --- PASS: TestIntegration/FsName (0.00s)
    --- PASS: TestIntegration/FsRoot (0.00s)
    --- PASS: TestIntegration/FsRmdirEmpty (0.01s)
    --- PASS: TestIntegration/FsMkdir (1.74s)
        --- PASS: TestIntegration/FsMkdir/FsMkdirRmdirSubdir (0.11s)
        --- PASS: TestIntegration/FsMkdir/FsListEmpty (0.01s)
        --- PASS: TestIntegration/FsMkdir/FsListDirEmpty (0.01s)
        --- SKIP: TestIntegration/FsMkdir/FsListRDirEmpty (0.00s)
        --- PASS: TestIntegration/FsMkdir/FsListDirNotFound (0.01s)
        --- SKIP: TestIntegration/FsMkdir/FsListRDirNotFound (0.00s)
        --- PASS: TestIntegration/FsMkdir/FsEncoding (0.81s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/control_chars (0.12s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/dot (0.04s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/dot_dot (0.03s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/punctuation (0.03s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/leading_space (0.02s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/leading_tilde (0.05s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/leading_CR (0.06s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/leading_LF (0.06s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/leading_HT (0.03s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/leading_VT (0.02s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/leading_dot (0.02s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/trailing_space (0.02s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/trailing_CR (0.02s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/trailing_LF (0.03s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/trailing_HT (0.05s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/trailing_VT (0.05s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/trailing_dot (0.06s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/invalid_UTF-8 (0.05s)
            --- PASS: TestIntegration/FsMkdir/FsEncoding/URL_encoding (0.03s)
        --- PASS: TestIntegration/FsMkdir/FsNewObjectNotFound (0.00s)
        --- PASS: TestIntegration/FsMkdir/FsPutError (0.01s)
        --- PASS: TestIntegration/FsMkdir/FsPutZeroLength (0.01s)
        --- SKIP: TestIntegration/FsMkdir/FsOpenWriterAt (0.00s)
        --- SKIP: TestIntegration/FsMkdir/FsChangeNotify (0.00s)
        --- PASS: TestIntegration/FsMkdir/FsPutFiles (0.65s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListDirFile2 (0.03s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/FsListRDirFile2 (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListR (0.04s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListRSubdir (0.03s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListDirRoot (0.04s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/FsListRDirRoot (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListSubdir (0.02s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/FsListRSubdir#01 (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListLevel2 (0.01s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/FsListRLevel2 (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListFile1 (0.04s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsNewObject (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsNewObjectCaseInsensitive (0.01s)
                --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsNewObjectCaseInsensitive/Dir (0.01s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsListFile1and2 (0.02s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsNewObjectDir (0.00s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/FsPurge (0.00s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/FsCopy (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsMove (0.09s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsDirMove (0.07s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/FsRmdirFull (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsPrecision (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectString (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectFs (0.01s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectRemote (0.02s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectHashes (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectModTime (0.00s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/ObjectMimeType (0.00s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/ObjectMetadata (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectSetModTime (0.01s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectSize (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectOpen (0.01s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectOpenSeek (0.01s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectOpenRange (0.01s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectPartialRead (0.01s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectUpdate (0.01s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectStorable (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsIsFile (0.01s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsIsFileNotFound (0.01s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/FromRoot (0.00s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/PublicLink (0.00s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/SetTier (0.00s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/ObjectCheckWrap (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectRemove (0.02s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/ObjectAbout (0.00s)
            --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsPutStream (0.02s)
                --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsPutStream/0 (0.01s)
                --- PASS: TestIntegration/FsMkdir/FsPutFiles/FsPutStream/100 (0.01s)
            --- SKIP: TestIntegration/FsMkdir/FsPutFiles/Internal (0.00s)
        --- SKIP: TestIntegration/FsMkdir/FsPutChunked (0.00s)
        --- PASS: TestIntegration/FsMkdir/FsUploadUnknownSize (0.03s)
            --- PASS: TestIntegration/FsMkdir/FsUploadUnknownSize/FsPutUnknownSize (0.01s)
            --- PASS: TestIntegration/FsMkdir/FsUploadUnknownSize/FsUpdateUnknownSize (0.02s)
        --- PASS: TestIntegration/FsMkdir/FsRootCollapse (0.01s)
    --- PASS: TestIntegration/FsShutdown (0.00s)
PASS
ok      command-line-arguments  1.857s

Everything is okay

Do you think you could make a docker image so we can run integration tests automatically, something like

Maybe using something like this? hub.docker.com/r/dperson/samba

I think that docker image works. The tests above are carried out by using the servers with smbd

@ncw
Copy link
Member

ncw commented Sep 20, 2022

Nice!

Do you want to add the docker image to fstest/testserver/init.d/TestSMB and add it to fstest/test_all/config.yml ?

I can do that if you want.

Other than that, do you think the code is ready to merge?

@Lesmiscore
Copy link
Contributor Author

Do you want to add the docker image to fstest/testserver/init.d/TestSMB and add it to fstest/test_all/config.yml ?

Can you please make one for it? I'm not familiar with how these tests are done

Other than that, do you think the code is ready to merge?

Yes

@ncw
Copy link
Member

ncw commented Sep 20, 2022

I've added a commit which fixes these

  • password should be called pass to be consistent with other backends and needs to have obscure.Reveal run on it
  • username should be called user to be consistent with other backends

I've added another commit which adds a docker command which runs a local smb server in a docker container. This will run if you do go test -v or test_all -backends smb

I added a 3rd commit to fix the lint problem.

All the tests pass - super job - well done :-)

I'll give the code a review now.

Copy link
Member

@ncw ncw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks great 👍

I put some minor comments inline.

backend/smb/smb.go Outdated Show resolved Hide resolved
backend/smb/smb.go Outdated Show resolved Hide resolved
backend/smb/smb.go Outdated Show resolved Hide resolved
backend/smb/smb.go Outdated Show resolved Hide resolved
backend/smb/smb.go Show resolved Hide resolved
docs/content/smb.md Outdated Show resolved Hide resolved
docs/content/smb.md Outdated Show resolved Hide resolved
- you can type an empty password
- clarify the situation that filename turns into 8.3
@Lesmiscore Lesmiscore requested a review from ncw September 21, 2022 17:14
@Lesmiscore
Copy link
Contributor Author

@ncw ping

@Lesmiscore
Copy link
Contributor Author

@ncw Ping again

Copy link
Member

@ncw ncw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is looking really good - all the tests pass.

The docs could do with filling out a bit (@albertony maybe you could help here?) but we can do that after merge.

Thank you for a great feature

@ncw ncw merged commit 2aa264b into rclone:master Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: read/write from/to samba (smb) drives
4 participants