| 1 |
@echo off |
| 2 |
rem Used by the buildbot "test" step. |
| 3 |
setlocal |
| 4 |
|
| 5 |
set PATH=%PATH%;%SystemRoot%\SysNative\OpenSSH;%SystemRoot%\System32\OpenSSH |
| 6 |
set here=%~dp0 |
| 7 |
set rt_opts=-q -d |
| 8 |
set regrtest_args= |
| 9 |
set arm32_ssh= |
| 10 |
set cmdline_args=%* |
| 11 |
set cmdline_args=%cmdline_args:,=#COMMA#% |
| 12 |
|
| 13 |
call:CheckOpts %cmdline_args% |
| 14 |
|
| 15 |
if "%PROCESSOR_ARCHITECTURE%"=="ARM" if "%arm32_ssh%"=="true" goto NativeExecution |
| 16 |
if "%arm32_ssh%"=="true" goto :Arm32Ssh |
| 17 |
|
| 18 |
:NativeExecution |
| 19 |
call "%here%..\..\PCbuild\rt.bat" %rt_opts% --slow-ci %regrtest_args% |
| 20 |
exit /b %ERRORLEVEL% |
| 21 |
|
| 22 |
:Arm32Ssh |
| 23 |
set dashU=-unetwork -udecimal -usubprocess -uurlfetch -utzdata |
| 24 |
if "%SSH_SERVER%"=="" goto :Arm32SshHelp |
| 25 |
if "%PYTHON_SOURCE%"=="" (set PYTHON_SOURCE=%here%..\..\) |
| 26 |
if "%REMOTE_PYTHON_DIR%"=="" (set REMOTE_PYTHON_DIR=C:\python\) |
| 27 |
if NOT "%REMOTE_PYTHON_DIR:~-1,1%"=="\" (set REMOTE_PYTHON_DIR=%REMOTE_PYTHON_DIR%\) |
| 28 |
|
| 29 |
set TEMP_ARGS=--temp %REMOTE_PYTHON_DIR%temp |
| 30 |
|
| 31 |
set rt_args=%rt_opts% --slow-ci %dashU% %regrtest_args% %TEMP_ARGS% |
| 32 |
ssh %SSH_SERVER% "set TEMP=%REMOTE_PYTHON_DIR%temp& cd %REMOTE_PYTHON_DIR% & %REMOTE_PYTHON_DIR%PCbuild\rt.bat" %rt_args% |
| 33 |
set ERR=%ERRORLEVEL% |
| 34 |
scp %SSH_SERVER%:"%REMOTE_PYTHON_DIR%test-results.xml" "%PYTHON_SOURCE%\test-results.xml" |
| 35 |
exit /b %ERR% |
| 36 |
|
| 37 |
:Arm32SshHelp |
| 38 |
echo SSH_SERVER environment variable must be set to administrator@[ip address] |
| 39 |
echo where [ip address] is the address of a Windows IoT Core ARM32 device. |
| 40 |
echo. |
| 41 |
echo The test worker should have the SSH agent running. |
| 42 |
echo Also a key must be created with ssh-keygen and added to both the buildbot worker machine |
| 43 |
echo and the ARM32 worker device: see https://docs.microsoft.com/en-us/windows/iot-core/connect-your-device/ssh |
| 44 |
exit /b 127 |
| 45 |
|
| 46 |
:CheckOpts |
| 47 |
set arg="%~1" |
| 48 |
if %arg%=="-x64" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts |
| 49 |
if %arg%=="-arm64" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts |
| 50 |
if %arg%=="-arm32" (set rt_opts=%rt_opts% %1) & (set arm32_ssh=true) & shift & goto CheckOpts |
| 51 |
if %arg%=="-d" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts |
| 52 |
if %arg%=="-O" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts |
| 53 |
if %arg%=="-q" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts |
| 54 |
if %arg%=="+d" (set rt_opts=%rt_opts:-d=%) & shift & goto CheckOpts |
| 55 |
if %arg%=="+q" (set rt_opts=%rt_opts:-q=%) & shift & goto CheckOpts |
| 56 |
if NOT %arg%=="" (set regrtest_args=%regrtest_args% %arg:#COMMA#=,%) & shift & goto CheckOpts |
| 57 |
goto:eof |