[JIRA] (JENKINS-13753) plink call in build.bat file doesn't execute remote shell script

2013-03-13 Thread rgat...@itrsgroup.com (JIRA)














































Robin Gatter
 commented on  JENKINS-13753


plink call in build.bat file doesnt execute remote shell script















I have an extremely similar problem: plink won't run under Jenkins, but the same (java) code runs fine in my IDE (IntelliJ). This is completely blocking black box tests that I want to write. Here is the complete Junit test code:

package com.itrsgroup.openaccess.testing.framework;

import static org.junit.Assert.assertEquals;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.junit.Test;

public class TempTest
{
private class StreamReader extends Thread {
private final InputStream inputStream;

public StreamReader(final InputStream in) {
inputStream = in;
}

public void run() {
try {
BufferedReader input = new BufferedReader(new InputStreamReader(inputStream));
String line;

while( (line = input.readLine()) != null ) {
System.out.println(line);
}
}
catch(IOException e) {
System.out.println("StreamReader IOException " + e.getMessage());
}
}
}

@Test
public void testStderrMergedToStdout()
{
int errorCode = -1;
String cmd[] = {"\"C:\\Program Files (x86)\\PuTTY\\plink.exe\"",
"rgatter@192.168.220.83",
"$SCRIPTS/testoutput.sh"};

try {
Process process = new ProcessBuilder(cmd).redirectErrorStream(true).start();
StreamReader outputStream = new StreamReader(process.getInputStream());
outputStream.start();
errorCode = process.waitFor();
System.out.println("Error code: " + errorCode);
}
catch(IOException e) {
System.out.println("I/O exception");
}
catch(InterruptedException e) {
System.out.println("Interrupted exception");
}

assertEquals(errorCode, 0);
}
}

Here is the output when run in IntelliJ:

stdout message
stderr message
Error code: 0

Process finished with exit code 0

Here is the output when run under Jenkins:

---
 T E S T S
---
Running com.itrsgroup.openaccess.testing.framework.TempTest

and that's the lot - the test code hangs at this point.

I can successfully start other executables (e.g. cmd.exe), but careful monitoring has shown that plink.exe doesn't even start under Jenkins and the process running this code just hangs forever. I'm running Jenkins 1.505 as a service on Windows 7 64-bit, and I've changed the service properties so that it uses my own login credentials. Using plink -V gives "plink: Development snapshot 2008-12-11:r8371", which I believe to be the latest release.



























This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira







-- 
You received this message because you are subscribed to the Google Groups Jenkins Issues group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[JIRA] (JENKINS-13753) plink call in build.bat file doesn't execute remote shell script

2013-03-13 Thread rgat...@itrsgroup.com (JIRA)














































Robin Gatter
 commented on  JENKINS-13753


plink call in build.bat file doesnt execute remote shell script















Just discovered I wasn't after all using the most recent vesion of plink.exe, but same problem exists with latest verson (Release 0.62).



























This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira







-- 
You received this message because you are subscribed to the Google Groups Jenkins Issues group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.