1
0

.kitchen.yml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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: 2018.3
  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. - name: ubuntu-16.04
  97. driver_config:
  98. run_command: /lib/systemd/systemd
  99. - name: ubuntu-14.04
  100. driver_config:
  101. run_command: /sbin/init
  102. provision_command:
  103. - rm -f /sbin/initctl
  104. - dpkg-divert --local --rename --remove /sbin/initctl
  105. - name: debian-8
  106. driver_config:
  107. run_command: /lib/systemd/systemd
  108. provision_command:
  109. - apt-get install -y dbus
  110. - echo 'L /run/docker.sock - - - - /docker.sock' > /etc/tmpfiles.d/docker.conf
  111. - name: debian-9
  112. driver_config:
  113. run_command: /lib/systemd/systemd
  114. - name: arch
  115. driver_config:
  116. image: archlinux/base
  117. run_command: /usr/lib/systemd/systemd
  118. provision_command:
  119. - pacman -Syu --noconfirm systemd
  120. - systemctl enable sshd
  121. - echo 'L /run/docker.sock - - - - /docker.sock' > /etc/tmpfiles.d/docker.conf
  122. provisioner:
  123. salt_bootstrap_options: -X -p rsync git v<%= version %> >/dev/null
  124. - name: opensuse-15
  125. driver_config:
  126. image: opensuse/leap:15.0
  127. run_command: /usr/lib/systemd/systemd
  128. provision_command:
  129. - zypper --non-interactive install --auto-agree-with-licenses dbus-1
  130. - systemctl enable sshd.service
  131. - echo 'L /run/docker.sock - - - - /docker.sock' > /etc/tmpfiles.d/docker.conf
  132. provisioner:
  133. salt_bootstrap_options: -qXU -x python2 git v<%= @version %>
  134. - name: opensuse-42.3
  135. driver_config:
  136. image: opensuse/leap:42.3
  137. run_command: /usr/lib/systemd/systemd
  138. provision_command:
  139. - zypper --non-interactive install --auto-agree-with-licenses dbus-1
  140. - systemctl enable sshd.service
  141. - echo 'L /run/docker.sock - - - - /docker.sock' > /etc/tmpfiles.d/docker.conf
  142. <% if vagrant != false %>
  143. - name: windows-2012r2
  144. driver:
  145. box: mwrock/Windows2012R2
  146. name: vagrant
  147. gui: true
  148. transport:
  149. name: winrm
  150. username: Administrator
  151. password: Pass@word1
  152. provisioner:
  153. init_environment: |
  154. Clear-Host
  155. $AddedLocation ="c:\salt;c:\salt\bin\Scripts"
  156. $Reg = "Registry::HKLM\System\CurrentControlSet\Control\Session Manager\Environment"
  157. $OldPath = (Get-ItemProperty -Path $Reg -Name PATH).Path
  158. $NewPath= $OldPath + ";" + $AddedLocation
  159. Set-ItemProperty -Path $Reg -Value $NewPath -Name PATH
  160. reg add "hklm\system\currentcontrolset\control\session manager\memory management" /v pagingfiles /t reg_multi_sz /d "d:\pagefile.sys 4096 8192" /f
  161. winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="5000"}'
  162. salt_bootstrap_url: https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.ps1
  163. salt_bootstrap_options: ''
  164. verifier:
  165. windows: true
  166. types:
  167. - unit
  168. coverage_xml: false
  169. save:
  170. $env:TEMP/salt-runtests.log: artifacts/logs/salt-runtests.log
  171. /salt/var/log/salt/minion: artifacts/logs/minion
  172. - name: windows-2016
  173. driver:
  174. box: mwrock/Windows2016
  175. name: vagrant
  176. gui: true
  177. customize:
  178. cpus: 4
  179. memory: 8192
  180. transport:
  181. name: winrm
  182. username: Vagrant
  183. password: vagrant
  184. provisioner:
  185. salt_bootstrap_url: https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.ps1
  186. salt_bootstrap_options: -version <%= version %>
  187. init_environment: |
  188. Clear-Host
  189. $AddedLocation ="c:\salt;c:\salt\bin\Scripts"
  190. $Reg = "Registry::HKLM\System\CurrentControlSet\Control\Session Manager\Environment"
  191. $OldPath = (Get-ItemProperty -Path $Reg -Name PATH).Path
  192. $NewPath= $OldPath + ";" + $AddedLocation
  193. Set-ItemProperty -Path $Reg -Value $NewPath -Name PATH
  194. reg add "hklm\system\currentcontrolset\control\session manager\memory management" /v pagingfiles /t reg_multi_sz /d "d:\pagefile.sys 4096 8192" /f
  195. winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="5000"}'
  196. salt_bootstrap_url: https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.ps1
  197. salt_bootstrap_options: ''
  198. verifier:
  199. windows: true
  200. types:
  201. - unit
  202. coverage_xml: false
  203. xml: /tmp/xml-unittests-output/
  204. save:
  205. /tmp/xml-unittests-output/: artifacts/
  206. $env:TEMP/salt-runtests.log: artifacts/logs/salt-runtests.log
  207. /salt/var/log/salt/minion: artifacts/logs/minion
  208. <% end %>
  209. <% end %>
  210. suites:
  211. - name: py2
  212. verifier:
  213. python_bin: python2.7
  214. - name: py3
  215. excludes:
  216. - centos-6
  217. - ubuntu-14.04
  218. verifier:
  219. python_bin: python3
  220. provisioner:
  221. pillars:
  222. jenkins.sls:
  223. py3: true
  224. windows.sls:
  225. virtualenv_path: 'c:\Python35\Scripts\pip.exe'
  226. <% if File.exists?(verifierfile) %>
  227. <%= ERB.new(File.read(verifierfile)).result %>
  228. <% else %>
  229. verifier:
  230. name: runtests
  231. sudo: true
  232. run_destructive: true
  233. transport: zeromq
  234. enable_filenames: true
  235. types:
  236. - ssh
  237. xml: /tmp/xml-unittests-output/
  238. coverage_xml: /tmp/coverage.xml
  239. save:
  240. /tmp/xml-unittests-output: artifacts/
  241. /tmp/coverage.xml: artifacts/coverage/coverage.xml
  242. /tmp/kitchen/var/log/salt/minion: artifacts/logs/minion
  243. /tmp/salt-runtests.log: artifacts/logs/salt-runtests.log
  244. <% end %>