1 package org.opendaylight.controller.distribution;
4 import java.io.IOException;
5 import java.io.InputStream;
6 import java.io.OutputStream;
10 static void copy(InputStream in, OutputStream out) throws IOException {
18 public static void main(String[] args) throws IOException, InterruptedException {
19 String cwd = System.getProperty("user.dir");
21 System.out.println("Current working directory = " + cwd);
23 // We assume that the program is being run from the sanitytest directory
24 // We need to specify the opendaylight directory as the working directory for the shell/batch scripts
25 File processWorkingDir = new File(cwd, "../opendaylight");
27 String os = System.getProperty("os.name").toLowerCase();
28 String script = "./run.sh";
30 if(os.contains("windows")){
34 ProcessBuilder processBuilder = new ProcessBuilder();
35 processBuilder.directory(processWorkingDir.getCanonicalFile());
36 processBuilder.command(script);
37 Process p = processBuilder.start();
39 copy(p.getInputStream(), System.out);
43 System.out.println("Test exited with exitValue = " + p.exitValue());
45 System.exit(p.exitValue());