1
0

.kitchen.yml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. ---
  2. <% vagrant = system('gem list -i kitchen-vagrant 2>/dev/null >/dev/null') %>
  3. <% version = '2018.3.3' %>
  4. <% platformsfile = ENV['SALT_KITCHEN_PLATFORMS'] || '.kitchen/platforms.yml' %>
  5. <% driverfile = ENV['SALT_KITCHEN_DRIVER'] || '.kitchen/driver.yml' %>
  6. <% verifierfile = ENV['SALT_KITCHEN_VERIFIER'] || '.kitchen/verifier.yml' %>
  7. <% if File.exists?(driverfile) %>
  8. <%= ERB.new(File.read(driverfile)).result %>
  9. <% else %>
  10. driver:
  11. name: docker
  12. use_sudo: false
  13. hostname: salt
  14. privileged: true
  15. username: kitchen
  16. volume:
  17. - /var/run/docker.sock:/docker.sock
  18. cap_add:
  19. - sys_admin
  20. disable_upstart: false
  21. provision_command:
  22. - echo 'L /run/docker.sock - - - - /docker.sock' > /etc/tmpfiles.d/docker.conf
  23. transport:
  24. name: rsync
  25. <% end %>
  26. provisioner:
  27. name: salt_solo
  28. salt_install: bootstrap
  29. salt_version: latest
  30. salt_bootstrap_url: https://bootstrap.saltstack.com
  31. salt_bootstrap_options: -X -p rsync git v<%= version %>
  32. log_level: info
  33. sudo: true
  34. require_chef: false
  35. retry_on_exit_code:
  36. - 139
  37. max_retries: 2
  38. remote_states:
  39. name: git://github.com/saltstack/salt-jenkins.git
  40. branch: neon
  41. repo: git
  42. testingdir: /testing
  43. salt_copy_filter:
  44. - __pycache__
  45. - '*.pyc'
  46. - .bundle
  47. - .tox
  48. - .nox
  49. - .kitchen
  50. - artifacts
  51. - Gemfile.lock
  52. state_top:
  53. base:
  54. "os:Windows":
  55. - match: grain
  56. - windows
  57. "*":
  58. - <%= ENV['KITCHEN_STATE'] || 'git.salt' %>
  59. pillars:
  60. top.sls:
  61. base:
  62. "*":
  63. - jenkins
  64. "os:Windows":
  65. - match: grain
  66. - windows
  67. jenkins.sls:
  68. testing_dir: "{{salt.config.get('root_dir')|replace('\\', '\\\\')}}/testing"
  69. clone_repo: false
  70. salttesting_namespec: salttesting==2017.6.1
  71. windows.sls:
  72. virtualenv_path: 'c:\Python27\Scripts\pip.exe'
  73. <% if File.exists?(platformsfile) %>
  74. <%= ERB.new(File.read(platformsfile)).result %>
  75. <% else %>
  76. platforms:
  77. - name: fedora
  78. driver_config:
  79. image: fedora:latest
  80. run_command: /usr/lib/systemd/systemd
  81. provisioner:
  82. salt_bootstrap_options: -X -p rsync git v<%= version %> >/dev/null
  83. - name: centos-7
  84. driver_config:
  85. run_command: /usr/lib/systemd/systemd
  86. - name: centos-6
  87. driver_config:
  88. run_command: /sbin/init
  89. provision_command:
  90. - yum install -y upstart
  91. provisioner:
  92. salt_bootstrap_options: -P -p rsync -y -x python2.7 -X git v<%= version %> >/dev/null
  93. - name: ubuntu-18.04
  94. driver_config:
  95. run_command: /lib/systemd/systemd
  96. provision_command:
  97. - apt-get install -y python3-venv
  98. - name: ubuntu-16.04
  99. driver_config:
  100. run_command: /lib/systemd/systemd
  101. - name: ubuntu-14.04
  102. driver_config:
  103. run_command: /sbin/init
  104. provision_command:
  105. - rm -f /sbin/initctl
  106. - dpkg-divert --local --rename --remove /sbin/initctl
  107. - name: debian-8
  108. driver_config:
  109. run_command: /lib/systemd/systemd
  110. provision_command:
  111. - apt-get install -y dbus
  112. - echo 'L /run/docker.sock - - - - /docker.sock' > /etc/tmpfiles.d/docker.conf
  113. - name: debian-9
  114. driver_config:
  115. run_command: /lib/systemd/systemd
  116. - name: arch
  117. driver_config:
  118. image: archlinux/base
  119. run_command: /usr/lib/systemd/systemd
  120. provision_command:
  121. - pacman -Syu --noconfirm systemd
  122. - systemctl enable sshd
  123. - echo 'L /run/docker.sock - - - - /docker.sock' > /etc/tmpfiles.d/docker.conf
  124. provisioner:
  125. salt_bootstrap_options: -X -p rsync git v<%= version %> >/dev/null
  126. - name: opensuse-15
  127. driver_config:
  128. image: opensuse/leap:15.0
  129. run_command: /usr/lib/systemd/systemd
  130. provision_command:
  131. - zypper --non-interactive install --auto-agree-with-licenses dbus-1
  132. - systemctl enable sshd.service
  133. - echo 'L /run/docker.sock - - - - /docker.sock' > /etc/tmpfiles.d/docker.conf
  134. provisioner:
  135. salt_bootstrap_options: -qXU -x python2 git v<%= @version %>
  136. - name: opensuse-42.3
  137. driver_config:
  138. image: opensuse/leap:42.3
  139. run_command: /usr/lib/systemd/systemd
  140. provision_command:
  141. - zypper --non-interactive install --auto-agree-with-licenses dbus-1
  142. - systemctl enable sshd.service
  143. - echo 'L /run/docker.sock - - - - /docker.sock' > /etc/tmpfiles.d/docker.conf
  144. <% if vagrant != false %>
  145. - name: windows-2012r2
  146. driver:
  147. box: mwrock/Windows2012R2
  148. name: vagrant
  149. gui: true
  150. transport:
  151. name: winrm
  152. username: Administrator
  153. password: Pass@word1
  154. provisioner:
  155. init_environment: |
  156. Clear-Host
  157. $AddedLocation ="c:\salt;c:\salt\bin\Scripts"
  158. $Reg = "Registry::HKLM\System\CurrentControlSet\Control\Session Manager\Environment"
  159. $OldPath = (Get-ItemProperty -Path $Reg -Name PATH).Path
  160. $NewPath= $OldPath + ";" + $AddedLocation
  161. Set-ItemProperty -Path $Reg -Value $NewPath -Name PATH
  162. reg add "hklm\system\currentcontrolset\control\session manager\memory management" /v pagingfiles /t reg_multi_sz /d "d:\pagefile.sys 4096 8192" /f
  163. winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="5000"}'
  164. salt_bootstrap_url: https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.ps1
  165. salt_bootstrap_options: ''
  166. verifier:
  167. windows: true
  168. types:
  169. - unit
  170. coverage_xml: false
  171. save:
  172. $env:TEMP/salt-runtests.log: artifacts/logs/salt-runtests.log
  173. /salt/var/log/salt/minion: artifacts/logs/minion
  174. - name: windows-2016
  175. driver:
  176. box: mwrock/Windows2016
  177. name: vagrant
  178. gui: true
  179. customize:
  180. cpus: 4
  181. memory: 8192
  182. transport:
  183. name: winrm
  184. username: Vagrant
  185. password: vagrant
  186. provisioner:
  187. salt_bootstrap_url: https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.ps1
  188. salt_bootstrap_options: -version <%= version %>
  189. init_environment: |
  190. Clear-Host
  191. $AddedLocation ="c:\salt;c:\salt\bin\Scripts"
  192. $Reg = "Registry::HKLM\System\CurrentControlSet\Control\Session Manager\Environment"
  193. $OldPath = (Get-ItemProperty -Path $Reg -Name PATH).Path
  194. $NewPath= $OldPath + ";" + $AddedLocation
  195. Set-ItemProperty -Path $Reg -Value $NewPath -Name PATH
  196. reg add "hklm\system\currentcontrolset\control\session manager\memory management" /v pagingfiles /t reg_multi_sz /d "d:\pagefile.sys 4096 8192" /f
  197. winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="5000"}'
  198. salt_bootstrap_url: https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.ps1
  199. salt_bootstrap_options: ''
  200. verifier:
  201. windows: true
  202. types:
  203. - unit
  204. coverage_xml: false
  205. xml: /tmp/xml-unittests-output/
  206. save:
  207. /tmp/xml-unittests-output/: artifacts/
  208. $env:TEMP/salt-runtests.log: artifacts/logs/salt-runtests.log
  209. /salt/var/log/salt/minion: artifacts/logs/minion
  210. <% end %>
  211. <% end %>
  212. suites:
  213. - name: py2
  214. verifier:
  215. python_bin: python2.7
  216. - name: py3
  217. excludes:
  218. - centos-6
  219. - ubuntu-14.04
  220. verifier:
  221. python_bin: python3
  222. provisioner:
  223. pillars:
  224. jenkins.sls:
  225. py3: true
  226. windows.sls:
  227. virtualenv_path: 'c:\Python35\Scripts\pip.exe'
  228. <% if File.exists?(verifierfile) %>
  229. <%= ERB.new(File.read(verifierfile)).result %>
  230. <% else %>
  231. verifier:
  232. name: runtests
  233. sudo: true
  234. run_destructive: true
  235. transport: zeromq
  236. enable_filenames: true
  237. types:
  238. - ssh
  239. xml: /tmp/xml-unittests-output/
  240. coverage_xml: /tmp/coverage.xml
  241. save:
  242. /tmp/xml-unittests-output: artifacts/
  243. /tmp/coverage.xml: artifacts/coverage/coverage.xml
  244. /tmp/kitchen/var/log/salt/minion: artifacts/logs/minion
  245. /tmp/salt-runtests.log: artifacts/logs/salt-runtests.log
  246. <% end %>