mirror of
https://github.com/google/cdc-file-transfer.git
synced 2026-09-13 01:10:44 +03:00
[cdc_rsync] Enable local syncing (#75)
Adds support for local syncs of files and folders on the same Windows machine, e.g. cdc_rsync C:\source C:\dest. The two main changes are - Skip the check whether the port is available remotely with PortManager. - Do not deploy cdc_rsync_server. - Run cdc_rsync_server directly, not through an SSH tunnel. The current implementation is not optimal as it starts cdc_rsync_server as a separate process and communicates to it via a TCP port.
This commit is contained in:
@@ -228,18 +228,25 @@ TEST_F(ParamsTest, ParseSucceedsWithNoSftpCommand) {
|
||||
ExpectError(NeedsValueError("sftp-command"));
|
||||
}
|
||||
|
||||
TEST_F(ParamsTest, ParseFailsOnNoUserHost) {
|
||||
TEST_F(ParamsTest, ParseSucceedsOnNoUserHost) {
|
||||
const char* argv[] = {"cdc_rsync.exe", kSrc, kDst, NULL};
|
||||
EXPECT_FALSE(
|
||||
Parse(static_cast<int>(std::size(argv)) - 1, argv, ¶meters_));
|
||||
ExpectError("No remote host specified");
|
||||
EXPECT_TRUE(Parse(static_cast<int>(std::size(argv)) - 1, argv, ¶meters_));
|
||||
}
|
||||
|
||||
TEST_F(ParamsTest, ParseDoesNotThinkCIsAHost) {
|
||||
TEST_F(ParamsTest, ParseDoesNotThinkDriveIsAHost) {
|
||||
const char* argv[] = {"cdc_rsync.exe", kSrc, "C:\\foo", NULL};
|
||||
EXPECT_FALSE(
|
||||
Parse(static_cast<int>(std::size(argv)) - 1, argv, ¶meters_));
|
||||
ExpectError("No remote host specified");
|
||||
EXPECT_TRUE(Parse(static_cast<int>(std::size(argv)) - 1, argv, ¶meters_));
|
||||
EXPECT_TRUE(parameters_.user_host.empty());
|
||||
|
||||
const char* argv2[] = {"cdc_rsync.exe", kSrc, "\\\\.\\C:\\foo", NULL};
|
||||
EXPECT_TRUE(
|
||||
Parse(static_cast<int>(std::size(argv2)) - 1, argv, ¶meters_));
|
||||
EXPECT_TRUE(parameters_.user_host.empty());
|
||||
|
||||
const char* argv3[] = {"cdc_rsync.exe", kSrc, "\\\\?\\C:\\foo", NULL};
|
||||
EXPECT_TRUE(
|
||||
Parse(static_cast<int>(std::size(argv3)) - 1, argv, ¶meters_));
|
||||
EXPECT_TRUE(parameters_.user_host.empty());
|
||||
}
|
||||
|
||||
TEST_F(ParamsTest, ParseWithoutParametersFailsOnMissingSourceAndDestination) {
|
||||
|
||||
Reference in New Issue
Block a user