Skip to content
Snippets Groups Projects
Commit 815f4e33 authored by brinn's avatar brinn
Browse files

Do not convert the sshExecutable to Unix path convention (fix for Windows) and...

Do not convert the sshExecutable to Unix path convention (fix for Windows) and convert it from a relative to an absolute path.

SVN: 26546
parent 051e39d5
No related branches found
No related tags found
No related merge requests found
...@@ -640,7 +640,7 @@ public final class RsyncCopier implements IPathCopier, IDirectoryImmutableCopier ...@@ -640,7 +640,7 @@ public final class RsyncCopier implements IPathCopier, IDirectoryImmutableCopier
private final static String getSshExecutableArgument(final String sshExecutable) private final static String getSshExecutableArgument(final String sshExecutable)
{ {
return toUnix(sshExecutable) + " -oBatchMode=yes"; return new File(sshExecutable).getAbsolutePath() + " -oBatchMode=yes";
} }
/** /**
......
...@@ -379,6 +379,29 @@ public final class RsyncCopierTest ...@@ -379,6 +379,29 @@ public final class RsyncCopierTest
assertEquals(expectedRsyncCmdLine, observedRsyncCmdLine); assertEquals(expectedRsyncCmdLine, observedRsyncCmdLine);
} }
@Test(groups =
{ "requires_unix" })
public void testRsyncWithSSHDirectoryOK() throws IOException, InterruptedException
{
final File parametersLogFile = new File(workingDirectory, "parameters.log");
final File loggingRsyncBinary =
createRsync("2.6.7",
String.format("echo \"$@\" > %s", parametersLogFile.getAbsolutePath()));
final RsyncCopier copier =
new RsyncCopier(loggingRsyncBinary, new File("ssh"), false, false);
final Status status =
copier.copyToRemote(sourceDirectory, destinationDirectory.getAbsolutePath(),
"localhost", null, null);
assertEquals(Status.OK, status);
final String expectedRsyncCmdLine =
String.format(
"--archive --delete-before --inplace --append --rsh %s -oBatchMode=yes %s localhost:%s/\n",
new File("ssh").getAbsolutePath(), sourceDirectory.getAbsolutePath(),
destinationDirectory.getAbsolutePath());
final String observedRsyncCmdLine = FileUtilities.loadToString(parametersLogFile);
assertEquals(expectedRsyncCmdLine, observedRsyncCmdLine);
}
@Test(groups = @Test(groups =
{ "requires_unix" }) { "requires_unix" })
public void testRsyncDirectoryContentOK() throws IOException, InterruptedException public void testRsyncDirectoryContentOK() throws IOException, InterruptedException
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment