-
Notifications
You must be signed in to change notification settings - Fork 6
/
.kitchen.yml
96 lines (91 loc) · 2.71 KB
/
.kitchen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<% root_path='/tmp/kitchen' %>
<% @test_configs = ['multirepo'] %>
<% @salt_versions = [
['stable', '3004.2'],
['onedir', '3005.1'],
['onedir', '3006.1'],
] %>
<% @python_versions_options = ['python3'] %>
driver:
name: docker
use_sudo: false
privileged: true
platforms:
- name: debian
driver_config:
image: debian:11
platform: debian
provisioner:
name: salt_solo
is_file_root: true
root_path: <%= root_path %>
salt_copy_filter:
- .git
- .gitignore
- .kitchen
- .kitchen.yml
- .bundle
- Gemfile
- Gemfile.lock
- README.md
- LICENSE
- vendor
- docs
state_top:
base:
'*':
- tests.sandbox
pillars:
kitchen.sls:
kitchen:
provisioner:
root_path: <%= root_path %>
test_key: 'test_value'
multirepo_config.sls:
gitstack_config:
ext_pillar:
- gitstack:
- master file://<%= root_path %>/srv/salt/tests/repo_a:
- stack:
- _stack/stack1.cfg
- _stack/stack2.cfg
- master file://<%= root_path %>/srv/salt/tests/repo_b:
- stack: _stack/stack.cfg
- root: pillar1
- name: repo_b1
- master file://<%= root_path %>/srv/salt/tests/repo_b:
- stack: _stack/stack.cfg
- root: pillar2
- name: repo_b2
- git:
- master file://<%= root_path %>/srv/salt/tests/repo_a
- master file://<%= root_path %>/srv/salt/tests/repo_b:
- root: pillar1
- name: repo_b1
- master file://<%= root_path %>/srv/salt/tests/repo_b:
- root: pillar2
- name: repo_b2
suites:
<% @salt_versions.each do |version| %>
<% @test_configs.each do |config| %>
<% @python_versions_options.each do |py_ver| %>
<% major_version = version[1].gsub(/^v?(\d+)\..*/, '\1').to_i %>
- name: <%= "#{py_ver}-#{version[1].gsub(/^v/, '').gsub('.', '-')}-#{config}" %>
provisioner:
salt_bootstrap_options: -X -n -p git -p <%= py_ver.tr('2', '') %>-pygit2 -x <%= py_ver %> <%= version[0] %> <%= version[1] %>
<% if version[0] == "onedir" || major_version >= 3006 %>
pre_salt_command: sudo salt-pip install pygit2
<% end %>
pillars:
top.sls:
base:
'*':
- kitchen
- <%= config %>_config
<% end %>
<% end %>
<% end %>
verifier:
name: shell
remote_exec: false
command: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -o LogLevel=ERROR -i ${KITCHEN_SSH_KEY} -p ${KITCHEN_PORT} ${KITCHEN_USERNAME}@${KITCHEN_HOSTNAME} sh <%= root_path %>/srv/salt/tests/suites/${KITCHEN_SUITE##*-}/verify.sh