forked from test-kitchen/test-kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkitchen_action_commands.feature
164 lines (149 loc) · 5.91 KB
/
kitchen_action_commands.feature
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
Feature: Running instance actions
In order to trigger discrete instance lifecyle actions
As an operator
I want to run a action commands
Background:
Given a file named ".kitchen.yml" with:
"""
---
driver:
name: dummy
provisioner:
name: dummy
verifier:
name: dummy
platforms:
- name: cool
- name: beans
suites:
- name: client
- name: server
"""
@spawn
Scenario: Creating a single instance
When I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+\<Not Created\>\Z/
When I run `kitchen create client-beans`
Then the output should contain "Finished creating <client-beans>"
And the exit status should be 0
When I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Created\Z/
@spawn
Scenario: Creating a single instance that fails
Given a file named ".kitchen.local.yml" with:
"""
---
driver:
fail_create: true
"""
When I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+\<Not Created\>\Z/
When I run `kitchen create client-beans`
Then the output should contain "Create failed on instance <client-beans>"
And the exit status should not be 0
When I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+\<Not Created\>\Z/
@spawn
Scenario: Converging a single instance
When I successfully run `kitchen create client-beans`
And I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Created\Z/
When I run `kitchen converge client-beans`
Then the output should contain "Finished converging <client-beans>"
And the exit status should be 0
When I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Converged\Z/
@spawn
Scenario: Converging a single instance that fails
Given a file named ".kitchen.local.yml" with:
"""
---
provisioner:
fail: true
"""
When I successfully run `kitchen create client-beans`
And I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Created\Z/
When I run `kitchen converge client-beans`
Then the output should contain "Converge failed on instance <client-beans>"
And the exit status should not be 0
When I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Created\Z/
@spawn
Scenario: Setting up a single instance
When I successfully run `kitchen converge client-beans`
And I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Converged\Z/
When I run `kitchen setup client-beans`
Then the output should contain "Finished setting up <client-beans>"
And the exit status should be 0
When I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Set Up\Z/
@spawn
Scenario: Setting up a single instance that fails
Given a file named ".kitchen.local.yml" with:
"""
---
verifier:
fail: true
"""
When I successfully run `kitchen converge client-beans`
And I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Converged\Z/
When I run `kitchen verify client-beans`
Then the output should contain "Verify failed on instance <client-beans>"
And the exit status should not be 0
When I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Set Up\Z/
@spawn
Scenario: Verifying a single instance
When I successfully run `kitchen setup client-beans`
And I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Set Up\Z/
When I run `kitchen verify client-beans`
Then the output should contain "Finished verifying <client-beans>"
And the exit status should be 0
When I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Verified\Z/
@spawn
Scenario: Verifying a single instance that fails
Given a file named ".kitchen.local.yml" with:
"""
---
verifier:
fail: true
"""
When I successfully run `kitchen setup client-beans`
And I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Set Up\Z/
When I run `kitchen verify client-beans`
Then the output should contain "Verify failed on instance <client-beans>"
And the exit status should not be 0
When I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Set Up\Z/
@spawn
Scenario: Destroying a single instance
When I successfully run `kitchen create client-beans`
And I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Created\Z/
When I run `kitchen destroy client-beans`
Then the output should contain "Finished destroying <client-beans>"
And the exit status should be 0
When I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+\<Not Created\>\Z/
@spawn
Scenario: Destroying a single instance that fails
Given a file named ".kitchen.local.yml" with:
"""
---
driver:
fail_destroy: true
"""
When I successfully run `kitchen create client-beans`
And I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Created\Z/
When I run `kitchen destroy client-beans`
Then the output should contain "Destroy failed on instance <client-beans>"
And the exit status should not be 0
When I successfully run `kitchen list client-beans`
Then the stdout should match /^client-beans\s+.+\s+Created\Z/