Sanity test to verify that the bundles that are included as plugins in the controller...
[controller.git] / opendaylight / distribution / opendaylight / run.sh
index e23552d5f8d6bc0006c3d7d21253cdb536199da2..4ee9555b97fc747c411bf8afa42b2c7da736c036 100755 (executable)
@@ -1,8 +1,24 @@
-cp ../sanitytest/target/sanitytest-0.4.1-SNAPSHOT.jar ./target/distribution.opendaylight-osgipackage/opendaylight/plugins
-pushd ./target/distribution.opendaylight-osgipackage/opendaylight/
+# 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 $?`
-popd
-rm ./target/distribution.opendaylight-osgipackage/opendaylight/plugins/sanitytest-0.4.1-SNAPSHOT.jar
+
+# 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