1
0

.kitchen.yml 7.2 KB

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