blob: 25c796a60e173d289267aabcb72411e5651ace3c [file] [log] [blame]
Zachary Ware6b6e6872017-06-10 14:58:42 -05001@echo off
Victor Stinner2d98c532017-06-16 14:38:34 +02002rem Used by the buildbot "test" step.
Zachary Ware6b6e6872017-06-10 14:58:42 -05003setlocal
4
Paul Monsona1952122019-06-20 09:33:32 -07005set PATH=%PATH%;%SystemRoot%\SysNative\OpenSSH;%SystemRoot%\System32\OpenSSH
Zachary Ware6b6e6872017-06-10 14:58:42 -05006set here=%~dp0
7set rt_opts=-q -d
8set regrtest_args=-j1
Paul Monson67ff6a12019-05-15 15:42:29 -07009set arm32_ssh=
Zachary Ware6b6e6872017-06-10 14:58:42 -050010
11:CheckOpts
12if "%1"=="-x64" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
Paul Monsone7e50392019-06-07 10:58:41 -070013if "%1"=="-arm64" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
Paul Monson67ff6a12019-05-15 15:42:29 -070014if "%1"=="-arm32" (set rt_opts=%rt_opts% %1) & (set arm32_ssh=true) & shift & goto CheckOpts
Zachary Ware6b6e6872017-06-10 14:58:42 -050015if "%1"=="-d" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
16if "%1"=="-O" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
17if "%1"=="-q" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts
18if "%1"=="+d" (set rt_opts=%rt_opts:-d=%) & shift & goto CheckOpts
19if "%1"=="+q" (set rt_opts=%rt_opts:-q=%) & shift & goto CheckOpts
20if NOT "%1"=="" (set regrtest_args=%regrtest_args% %1) & shift & goto CheckOpts
21
Paul Monsonf3550692019-06-19 13:09:54 -070022if "%PROCESSOR_ARCHITECTURE%"=="ARM" if "%arm32_ssh%"=="true" goto NativeExecution
Paul Monson67ff6a12019-05-15 15:42:29 -070023if "%arm32_ssh%"=="true" goto :Arm32Ssh
24
Paul Monsonf3550692019-06-19 13:09:54 -070025:NativeExecution
Victor Stinner00561182017-06-30 16:44:08 +020026call "%here%..\..\PCbuild\rt.bat" %rt_opts% -uall -rwW --slowest --timeout=1200 --fail-env-changed %regrtest_args%
Paul Monson51394b82019-05-24 09:15:39 -070027exit /b %ERRORLEVEL%
Paul Monson67ff6a12019-05-15 15:42:29 -070028
29:Arm32Ssh
Paul Monsonf8dd77d2019-06-21 09:40:05 -070030set dashU=-unetwork -udecimal -usubprocess -uurlfetch -utzdata
Paul Monson67ff6a12019-05-15 15:42:29 -070031if "%SSH_SERVER%"=="" goto :Arm32SshHelp
32if "%PYTHON_SOURCE%"=="" (set PYTHON_SOURCE=%here%..\..\)
33if "%REMOTE_PYTHON_DIR%"=="" (set REMOTE_PYTHON_DIR=C:\python\)
Paul Monsonf3550692019-06-19 13:09:54 -070034if NOT "%REMOTE_PYTHON_DIR:~-1,1%"=="\" (set REMOTE_PYTHON_DIR=%REMOTE_PYTHON_DIR%\)
Paul Monsona1952122019-06-20 09:33:32 -070035
Paul Monson67ff6a12019-05-15 15:42:29 -070036set TEMP_ARGS=--temp %REMOTE_PYTHON_DIR%temp
Paul Monson67ff6a12019-05-15 15:42:29 -070037
38set rt_args=%rt_opts% %dashU% -rwW --slowest --timeout=1200 --fail-env-changed %regrtest_args% %TEMP_ARGS%
Steve Dower10772ec2020-07-08 00:24:39 +010039ssh %SSH_SERVER% "set TEMP=%REMOTE_PYTHON_DIR%temp& cd %REMOTE_PYTHON_DIR% & %REMOTE_PYTHON_DIR%PCbuild\rt.bat" %rt_args%
40set ERR=%ERRORLEVEL%
41scp %SSH_SERVER%:"%REMOTE_PYTHON_DIR%test-results.xml" "%PYTHON_SOURCE%\test-results.xml"
42exit /b %ERR%
Paul Monson67ff6a12019-05-15 15:42:29 -070043
44:Arm32SshHelp
45echo SSH_SERVER environment variable must be set to administrator@[ip address]
46echo where [ip address] is the address of a Windows IoT Core ARM32 device.
47echo.
48echo The test worker should have the SSH agent running.
49echo Also a key must be created with ssh-keygen and added to both the buildbot worker machine
50echo and the ARM32 worker device: see https://docs.microsoft.com/en-us/windows/iot-core/connect-your-device/ssh
51exit /b 127