Add code for working sanity test in windows.
[controller.git] / opendaylight / distribution / opendaylight / run.bat
index 8981709bb1e9131c2079aad11ab621efe402ff03..f219828bad3dc0c927689e2bbc33f04f066984f0 100644 (file)
@@ -1 +1,23 @@
-REM This is where the sanity test execution for windows needs to go (see run.sh)
+rem Inject the sanitytest jar as a controller plugin
+copy .\target\dependency\sanitytest*.jar .\target\distribution.opendaylight-osgipackage\opendaylight\plugins
+
+rem Store the current working directory in a variable so that we can get back to it later
+set cwd=%cd%
+
+rem Switch to the distribution folder
+cd .\target\distribution.opendaylight-osgipackage\opendaylight
+
+rem Run the controller
+cmd.exe /c run.bat
+
+rem Store the exit value of the controller in a variable
+set success=%ERRORLEVEL%
+
+rem Switch back to the directory from which this script was invoked
+cd %cwd%
+
+rem Remove the sanitytest jar from the plugins directory
+del .\target\distribution.opendaylight-osgipackage\opendaylight\plugins\sanitytest*.jar
+
+rem Exit using the exit code that we had captured earlier after running the controller
+exit /b %SUCCESS%
\ No newline at end of file