Zachary Ware | 6b6e687 | 2017-06-10 14:58:42 -0500 | [diff] [blame] | 1 | @echo off |
Victor Stinner | 2d98c53 | 2017-06-16 14:38:34 +0200 | [diff] [blame] | 2 | rem Used by the buildbot "test" step. |
Zachary Ware | 6b6e687 | 2017-06-10 14:58:42 -0500 | [diff] [blame] | 3 | setlocal |
| 4 | |
Paul Monson | a195212 | 2019-06-20 09:33:32 -0700 | [diff] [blame] | 5 | set PATH=%PATH%;%SystemRoot%\SysNative\OpenSSH;%SystemRoot%\System32\OpenSSH |
Zachary Ware | 6b6e687 | 2017-06-10 14:58:42 -0500 | [diff] [blame] | 6 | set here=%~dp0 |
| 7 | set rt_opts=-q -d |
| 8 | set regrtest_args=-j1 |
Paul Monson | 67ff6a1 | 2019-05-15 15:42:29 -0700 | [diff] [blame] | 9 | set arm32_ssh= |
Zachary Ware | 6b6e687 | 2017-06-10 14:58:42 -0500 | [diff] [blame] | 10 | |
| 11 | :CheckOpts |
| 12 | if "%1"=="-x64" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts |
Paul Monson | e7e5039 | 2019-06-07 10:58:41 -0700 | [diff] [blame] | 13 | if "%1"=="-arm64" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts |
Paul Monson | 67ff6a1 | 2019-05-15 15:42:29 -0700 | [diff] [blame] | 14 | if "%1"=="-arm32" (set rt_opts=%rt_opts% %1) & (set arm32_ssh=true) & shift & goto CheckOpts |
Zachary Ware | 6b6e687 | 2017-06-10 14:58:42 -0500 | [diff] [blame] | 15 | if "%1"=="-d" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts |
| 16 | if "%1"=="-O" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts |
| 17 | if "%1"=="-q" (set rt_opts=%rt_opts% %1) & shift & goto CheckOpts |
| 18 | if "%1"=="+d" (set rt_opts=%rt_opts:-d=%) & shift & goto CheckOpts |
| 19 | if "%1"=="+q" (set rt_opts=%rt_opts:-q=%) & shift & goto CheckOpts |
| 20 | if NOT "%1"=="" (set regrtest_args=%regrtest_args% %1) & shift & goto CheckOpts |
| 21 | |
Paul Monson | f355069 | 2019-06-19 13:09:54 -0700 | [diff] [blame] | 22 | if "%PROCESSOR_ARCHITECTURE%"=="ARM" if "%arm32_ssh%"=="true" goto NativeExecution |
Paul Monson | 67ff6a1 | 2019-05-15 15:42:29 -0700 | [diff] [blame] | 23 | if "%arm32_ssh%"=="true" goto :Arm32Ssh |
| 24 | |
Paul Monson | f355069 | 2019-06-19 13:09:54 -0700 | [diff] [blame] | 25 | :NativeExecution |
Victor Stinner | 0056118 | 2017-06-30 16:44:08 +0200 | [diff] [blame] | 26 | call "%here%..\..\PCbuild\rt.bat" %rt_opts% -uall -rwW --slowest --timeout=1200 --fail-env-changed %regrtest_args% |
Paul Monson | 51394b8 | 2019-05-24 09:15:39 -0700 | [diff] [blame] | 27 | exit /b %ERRORLEVEL% |
Paul Monson | 67ff6a1 | 2019-05-15 15:42:29 -0700 | [diff] [blame] | 28 | |
| 29 | :Arm32Ssh |
Paul Monson | f8dd77d | 2019-06-21 09:40:05 -0700 | [diff] [blame] | 30 | set dashU=-unetwork -udecimal -usubprocess -uurlfetch -utzdata |
Paul Monson | 67ff6a1 | 2019-05-15 15:42:29 -0700 | [diff] [blame] | 31 | if "%SSH_SERVER%"=="" goto :Arm32SshHelp |
| 32 | if "%PYTHON_SOURCE%"=="" (set PYTHON_SOURCE=%here%..\..\) |
| 33 | if "%REMOTE_PYTHON_DIR%"=="" (set REMOTE_PYTHON_DIR=C:\python\) |
Paul Monson | f355069 | 2019-06-19 13:09:54 -0700 | [diff] [blame] | 34 | if NOT "%REMOTE_PYTHON_DIR:~-1,1%"=="\" (set REMOTE_PYTHON_DIR=%REMOTE_PYTHON_DIR%\) |
Paul Monson | a195212 | 2019-06-20 09:33:32 -0700 | [diff] [blame] | 35 | |
Paul Monson | 67ff6a1 | 2019-05-15 15:42:29 -0700 | [diff] [blame] | 36 | set TEMP_ARGS=--temp %REMOTE_PYTHON_DIR%temp |
Paul Monson | 67ff6a1 | 2019-05-15 15:42:29 -0700 | [diff] [blame] | 37 | |
| 38 | set rt_args=%rt_opts% %dashU% -rwW --slowest --timeout=1200 --fail-env-changed %regrtest_args% %TEMP_ARGS% |
Steve Dower | 10772ec | 2020-07-08 00:24:39 +0100 | [diff] [blame] | 39 | ssh %SSH_SERVER% "set TEMP=%REMOTE_PYTHON_DIR%temp& cd %REMOTE_PYTHON_DIR% & %REMOTE_PYTHON_DIR%PCbuild\rt.bat" %rt_args% |
| 40 | set ERR=%ERRORLEVEL% |
| 41 | scp %SSH_SERVER%:"%REMOTE_PYTHON_DIR%test-results.xml" "%PYTHON_SOURCE%\test-results.xml" |
| 42 | exit /b %ERR% |
Paul Monson | 67ff6a1 | 2019-05-15 15:42:29 -0700 | [diff] [blame] | 43 | |
| 44 | :Arm32SshHelp |
| 45 | echo SSH_SERVER environment variable must be set to administrator@[ip address] |
| 46 | echo where [ip address] is the address of a Windows IoT Core ARM32 device. |
| 47 | echo. |
| 48 | echo The test worker should have the SSH agent running. |
| 49 | echo Also a key must be created with ssh-keygen and added to both the buildbot worker machine |
| 50 | echo and the ARM32 worker device: see https://docs.microsoft.com/en-us/windows/iot-core/connect-your-device/ssh |
| 51 | exit /b 127 |