summaryrefslogtreecommitdiffstats
path: root/Tools/buildbot
diff options
context:
space:
mode:
authorPaul Monson <paulmon@users.noreply.github.com>2019-06-19 20:09:54 (GMT)
committerSteve Dower <steve.dower@python.org>2019-06-19 20:09:54 (GMT)
commitf355069a3337711642c3403429afb9faef93f512 (patch)
treec2a749be8e1921205c676ecdb22fe8703d947c42 /Tools/buildbot
parent12f1c726d8328e5e096c35c36901f6d19bc942d3 (diff)
downloadcpython-f355069a3337711642c3403429afb9faef93f512.zip
cpython-f355069a3337711642c3403429afb9faef93f512.tar.gz
cpython-f355069a3337711642c3403429afb9faef93f512.tar.bz2
bpo-36511: Add buildbot scripts and fix tests for Windows ARM32 buildbot (GH-13454)
Diffstat (limited to 'Tools/buildbot')
-rw-r--r--Tools/buildbot/remoteDeploy.bat48
-rw-r--r--Tools/buildbot/remotePythonInfo.bat34
-rw-r--r--Tools/buildbot/test.bat16
3 files changed, 87 insertions, 11 deletions
diff --git a/Tools/buildbot/remoteDeploy.bat b/Tools/buildbot/remoteDeploy.bat
new file mode 100644
index 0000000..ac1e38b
--- /dev/null
+++ b/Tools/buildbot/remoteDeploy.bat
@@ -0,0 +1,48 @@
+@echo off
+rem Used by the buildbot "remotedeploy" step.
+setlocal
+
+set here=%~dp0
+set arm32_ssh=
+
+:CheckOpts
+if "%1"=="-arm32" (set arm32_ssh=true) & shift & goto CheckOpts
+if NOT "%1"=="" (echo unrecognized option %1) & goto Arm32SshHelp
+
+if "%arm32_ssh%"=="true" goto :Arm32Ssh
+
+:Arm32Ssh
+if "%SSH_SERVER%"=="" goto :Arm32SshHelp
+if "%SSH%"=="" if EXIST %WINDIR%\System32\OpenSSH\ssh.exe (set SSH=%WINDIR%\System32\OpenSSH\ssh.exe)
+if "%SCP%"=="" if EXIST %WINDIR%\System32\OpenSSH\scp.exe (set SCP=%WINDIR%\System32\OpenSSH\scp.exe)
+echo SSH = %SSH%
+echo SCP = %SCP%
+if "%PYTHON_SOURCE%"=="" (set PYTHON_SOURCE=%here%..\..\)
+if "%REMOTE_PYTHON_DIR%"=="" (set REMOTE_PYTHON_DIR=C:\python\)
+if NOT "%REMOTE_PYTHON_DIR:~-1,1%"=="\" (set REMOTE_PYTHON_DIR=%REMOTE_PYTHON_DIR%\)
+%SSH% %SSH_SERVER% "if EXIST %REMOTE_PYTHON_DIR% (rd %REMOTE_PYTHON_DIR% /s/q)"
+%SSH% %SSH_SERVER% "md %REMOTE_PYTHON_DIR%PCBuild\arm32"
+%SSH% %SSH_SERVER% "md %REMOTE_PYTHON_DIR%temp"
+%SSH% %SSH_SERVER% "md %REMOTE_PYTHON_DIR%Modules"
+%SSH% %SSH_SERVER% "md %REMOTE_PYTHON_DIR%PC"
+for /f "USEBACKQ" %%i in (`dir PCbuild\*.bat /b`) do @%SCP% PCBuild\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild"
+for /f "USEBACKQ" %%i in (`dir PCbuild\*.py /b`) do @%SCP% PCBuild\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild"
+for /f "USEBACKQ" %%i in (`dir PCbuild\arm32\*.exe /b`) do @%SCP% PCBuild\arm32\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild\arm32"
+for /f "USEBACKQ" %%i in (`dir PCbuild\arm32\*.pyd /b`) do @%SCP% PCBuild\arm32\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild\arm32"
+for /f "USEBACKQ" %%i in (`dir PCbuild\arm32\*.dll /b`) do @%SCP% PCBuild\arm32\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild\arm32"
+%SCP% -r "%PYTHON_SOURCE%Include" "%SSH_SERVER%:%REMOTE_PYTHON_DIR%Include"
+%SCP% -r "%PYTHON_SOURCE%Lib" "%SSH_SERVER%:%REMOTE_PYTHON_DIR%Lib"
+%SCP% -r "%PYTHON_SOURCE%Tools" "%SSH_SERVER%:%REMOTE_PYTHON_DIR%Tools"
+%SCP% "%PYTHON_SOURCE%Modules\Setup" "%SSH_SERVER%:%REMOTE_PYTHON_DIR%Modules"
+%SCP% "%PYTHON_SOURCE%PC\pyconfig.h" "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PC"
+
+exit /b %ERRORLEVEL%
+
+:Arm32SshHelp
+echo SSH_SERVER environment variable must be set to administrator@[ip address]
+echo where [ip address] is the address of a Windows IoT Core ARM32 device.
+echo.
+echo The test worker should have the SSH agent running.
+echo Also a key must be created with ssh-keygen and added to both the buildbot worker machine
+echo and the ARM32 worker device: see https://docs.microsoft.com/en-us/windows/iot-core/connect-your-device/ssh
+exit /b 127
diff --git a/Tools/buildbot/remotePythonInfo.bat b/Tools/buildbot/remotePythonInfo.bat
new file mode 100644
index 0000000..263808c
--- /dev/null
+++ b/Tools/buildbot/remotePythonInfo.bat
@@ -0,0 +1,34 @@
+@echo off
+rem Used by the buildbot "remotedeploy" step.
+setlocal
+
+set here=%~dp0
+set arm32_ssh=
+set suffix=_d
+if "%REMOTE_PYTHON_DIR%"=="" (set REMOTE_PYTHON_DIR=C:\python\)
+if NOT "%REMOTE_PYTHON_DIR:~-1,1%"=="\" (set REMOTE_PYTHON_DIR=%REMOTE_PYTHON_DIR%\)
+
+:CheckOpts
+if "%1"=="-arm32" (set arm32_ssh=true) & (set prefix=%REMOTE_PYTHON_DIR%pcbuild\arm32) & shift & goto CheckOpts
+if "%1"=="-d" (set suffix=_d) & shift & goto CheckOpts
+if "%1"=="+d" (set suffix=) & shift & goto CheckOpts
+if NOT "%1"=="" (echo unrecognized option %1) & goto Arm32SshHelp
+
+if "%arm32_ssh%"=="true" goto :Arm32Ssh
+
+:Arm32Ssh
+if "%SSH_SERVER%"=="" goto :Arm32SshHelp
+if "%SSH%"=="" if EXIST %WINDIR%\System32\OpenSSH\ssh.exe (set SSH=%WINDIR%\System32\OpenSSH\ssh.exe)
+set PYTHON_EXE=%prefix%\python%suffix%.exe
+echo on
+%SSH% %SSH_SERVER% %PYTHON_EXE% -m test.pythoninfo
+exit /b %ERRORLEVEL%
+
+:Arm32SshHelp
+echo SSH_SERVER environment variable must be set to administrator@[ip address]
+echo where [ip address] is the address of a Windows IoT Core ARM32 device.
+echo.
+echo The test worker should have the SSH agent running.
+echo Also a key must be created with ssh-keygen and added to both the buildbot worker machine
+echo and the ARM32 worker device: see https://docs.microsoft.com/en-us/windows/iot-core/connect-your-device/ssh
+exit /b 127
diff --git a/Tools/buildbot/test.bat b/Tools/buildbot/test.bat
index 1566f46..685f73d 100644
--- a/Tools/buildbot/test.bat
+++ b/Tools/buildbot/test.bat
@@ -18,8 +18,10 @@ if "%1"=="+d" (set rt_opts=%rt_opts:-d=%) & shift & goto CheckOpts
if "%1"=="+q" (set rt_opts=%rt_opts:-q=%) & shift & goto CheckOpts
if NOT "%1"=="" (set regrtest_args=%regrtest_args% %1) & shift & goto CheckOpts
+if "%PROCESSOR_ARCHITECTURE%"=="ARM" if "%arm32_ssh%"=="true" goto NativeExecution
if "%arm32_ssh%"=="true" goto :Arm32Ssh
+:NativeExecution
call "%here%..\..\PCbuild\rt.bat" %rt_opts% -uall -rwW --slowest --timeout=1200 --fail-env-changed %regrtest_args%
exit /b %ERRORLEVEL%
@@ -28,20 +30,12 @@ set dashU=-unetwork,decimal,subprocess,urlfetch,tzdata
if "%SSH_SERVER%"=="" goto :Arm32SshHelp
if "%PYTHON_SOURCE%"=="" (set PYTHON_SOURCE=%here%..\..\)
if "%REMOTE_PYTHON_DIR%"=="" (set REMOTE_PYTHON_DIR=C:\python\)
+if NOT "%REMOTE_PYTHON_DIR:~-1,1%"=="\" (set REMOTE_PYTHON_DIR=%REMOTE_PYTHON_DIR%\)
+if "%SSH%"=="" if EXIST %WINDIR%\System32\OpenSSH\ssh.exe (set SSH=%WINDIR%\System32\OpenSSH\ssh.exe)
set TEMP_ARGS=--temp %REMOTE_PYTHON_DIR%temp
-ssh %SSH_SERVER% "if EXIST %REMOTE_PYTHON_DIR% (rd %REMOTE_PYTHON_DIR% /s/q)"
-ssh %SSH_SERVER% "md %REMOTE_PYTHON_DIR%PCBuild\arm32"
-ssh %SSH_SERVER% "md %REMOTE_PYTHON_DIR%temp"
-for /f "USEBACKQ" %%i in (`dir PCbuild\*.bat /b`) do @scp PCBuild\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild"
-for /f "USEBACKQ" %%i in (`dir PCbuild\*.py /b`) do @scp PCBuild\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild"
-for /f "USEBACKQ" %%i in (`dir PCbuild\arm32\*.exe /b`) do @scp PCBuild\arm32\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild\arm32"
-for /f "USEBACKQ" %%i in (`dir PCbuild\arm32\*.pyd /b`) do @scp PCBuild\arm32\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild\arm32"
-for /f "USEBACKQ" %%i in (`dir PCbuild\arm32\*.dll /b`) do @scp PCBuild\arm32\%%i "%SSH_SERVER%:%REMOTE_PYTHON_DIR%PCBuild\arm32"
-scp -r "%PYTHON_SOURCE%Include" "%SSH_SERVER%:%REMOTE_PYTHON_DIR%Include"
-scp -r "%PYTHON_SOURCE%Lib" "%SSH_SERVER%:%REMOTE_PYTHON_DIR%Lib"
set rt_args=%rt_opts% %dashU% -rwW --slowest --timeout=1200 --fail-env-changed %regrtest_args% %TEMP_ARGS%
-ssh %SSH_SERVER% "set TEMP=%REMOTE_PYTHON_DIR%temp& %REMOTE_PYTHON_DIR%PCbuild\rt.bat" %rt_args%
+%SSH% %SSH_SERVER% "set TEMP=%REMOTE_PYTHON_DIR%temp& %REMOTE_PYTHON_DIR%PCbuild\rt.bat" %rt_args%
exit /b %ERRORLEVEL%
:Arm32SshHelp