Changing the file names from run.sh/run.bat to runsanity.sh/runsanity.bat to make...
[controller.git] / opendaylight / distribution / opendaylight / runsanity.sh
diff --git a/opendaylight/distribution/opendaylight/runsanity.sh b/opendaylight/distribution/opendaylight/runsanity.sh
new file mode 100755 (executable)
index 0000000..4ee9555
--- /dev/null
@@ -0,0 +1,24 @@
+# Inject the sanitytest jar as a controller plugin
+cp ./target/dependency/sanitytest*.jar ./target/distribution.opendaylight-osgipackage/opendaylight/plugins
+
+# Store the current working directory in a variable so that we can get back to it later
+cwd=`pwd`
+
+# Switch to the distribution folder
+cd ./target/distribution.opendaylight-osgipackage/opendaylight/
+
+# Run the controller
+./run.sh
+
+# Store the exit value of the controller in a variable
+success=`echo $?`
+
+# Switch back to the directory from which this script was invoked
+cd $cwd
+
+# Remove the sanitytest jar from the plugins directory
+rm ./target/distribution.opendaylight-osgipackage/opendaylight/plugins/sanitytest*.jar
+
+# Exit using the exit code that we had captured earlier after running the controller
+exit $success
+