From: Moiz Raja Date: Wed, 9 Oct 2013 20:28:39 +0000 (-0700) Subject: Reduce the fragility of the Sanity Test by not trying to access anything outside... X-Git-Tag: jenkins-controller-bulk-release-prepare-only-2-1~646 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=f82471366b2cfb6ab10ac6942cf2502284b5e441 Reduce the fragility of the Sanity Test by not trying to access anything outside the current project Change-Id: I4f563ae82becde73ff412aeddc159cf7c7051433 Signed-off-by: Moiz Raja --- diff --git a/opendaylight/distribution/opendaylight/pom.xml b/opendaylight/distribution/opendaylight/pom.xml index 74d2b74f11..905e3a4eca 100644 --- a/opendaylight/distribution/opendaylight/pom.xml +++ b/opendaylight/distribution/opendaylight/pom.xml @@ -1063,10 +1063,9 @@ java -cp - ../sanitytest/target/classes + ./target/dependency/* org.opendaylight.controller.distribution.Sanity - ${exec.workingdir}/../../sanitytest diff --git a/opendaylight/distribution/opendaylight/src/main/resources/run.sh b/opendaylight/distribution/opendaylight/src/main/resources/run.sh index 6caf3e3f57..31bf3c6632 100755 --- a/opendaylight/distribution/opendaylight/src/main/resources/run.sh +++ b/opendaylight/distribution/opendaylight/src/main/resources/run.sh @@ -10,6 +10,9 @@ fi if [[ $platform == 'linux' ]]; then fullpath=`readlink -f $0` + + [[ -z ${JAVA_HOME} ]] && [[ -x "/usr/lib/jvm/java-1.7.0" ]] && export JAVA_HOME=`/usr/lib/jvm/java-1.7.0`; + elif [[ $platform == 'osx' ]]; then TARGET_FILE=$0 cd `dirname $TARGET_FILE` diff --git a/opendaylight/distribution/sanitytest/src/main/java/org/opendaylight/controller/distribution/Sanity.java b/opendaylight/distribution/sanitytest/src/main/java/org/opendaylight/controller/distribution/Sanity.java index 378ea8a52d..33ff8ea18a 100644 --- a/opendaylight/distribution/sanitytest/src/main/java/org/opendaylight/controller/distribution/Sanity.java +++ b/opendaylight/distribution/sanitytest/src/main/java/org/opendaylight/controller/distribution/Sanity.java @@ -1,6 +1,5 @@ package org.opendaylight.controller.distribution; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -20,19 +19,16 @@ public class Sanity { System.out.println("Current working directory = " + cwd); - // We assume that the program is being run from the sanitytest directory - // We need to specify the opendaylight directory as the working directory for the shell/batch scripts - File processWorkingDir = new File(cwd, "../opendaylight"); - String os = System.getProperty("os.name").toLowerCase(); String script = "./run.sh"; if(os.contains("windows")){ - script = "run.bat"; + System.out.println("Sorry no sanity testing on Windows yet"); + System.exit(0); + return; } ProcessBuilder processBuilder = new ProcessBuilder(); - processBuilder.directory(processWorkingDir.getCanonicalFile()); processBuilder.command(script); Process p = processBuilder.start();