-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathattribute_settings.feature
More file actions
146 lines (132 loc) · 7.08 KB
/
Copy pathattribute_settings.feature
File metadata and controls
146 lines (132 loc) · 7.08 KB
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
@client @attribute_settings
Feature: Set default, normal, and override attributes
In order to easily configure similar systems
As an Administrator
I want to use different kinds of attributes
Scenario: Set a default attribute in a cookbook attribute file
Given a validated node
And it includes the recipe 'attribute_settings'
When I run the chef-client
Then the run should exit '0'
Then a file named 'attribute_setting.txt' should contain '1'
When the node is retrieved from the API
Then the inflated responses key 'attribute_priority_was' should be the integer '1'
Scenario: Set the default attribute in a role
Given a 'role' named 'attribute_settings_default' exists
And a validated node
And it includes the role 'attribute_settings_default'
When I run the chef-client
Then the run should exit '0'
And a file named 'attribute_setting.txt' should contain '2'
When the node is retrieved from the API
Then the inflated responses key 'attribute_priority_was' should be the integer '2'
Scenario: Set the default attribute in a recipe
Given a 'role' named 'attribute_settings_default' exists
And a validated node
And it includes the role 'attribute_settings_default'
And it includes the recipe 'attribute_settings::default_in_recipe'
When I run the chef-client
Then the run should exit '0'
And a file named 'attribute_setting.txt' should contain '3'
When the node is retrieved from the API
Then the inflated responses key 'attribute_priority_was' should be the integer '3'
Scenario: Set a normal attribute in a cookbook attribute file
Given a validated node
And a 'role' named 'attribute_settings_default' exists
And it includes the role 'attribute_settings_default'
And it includes the recipe 'attribute_settings::default_in_recipe'
And it includes the recipe 'attribute_settings_normal'
When I run the chef-client
Then the run should exit '0'
Then a file named 'attribute_setting.txt' should contain '4'
When the node is retrieved from the API
Then the inflated responses key 'attribute_priority_was' should be the integer '4'
Scenario: Set a normal attribute in a cookbook recipe
Given a validated node
And a 'role' named 'attribute_settings_default' exists
And it includes the role 'attribute_settings_default'
And it includes the recipe 'attribute_settings::default_in_recipe'
And it includes the recipe 'attribute_settings_normal::normal_in_recipe'
When I run the chef-client
Then the run should exit '0'
Then a file named 'attribute_setting.txt' should contain '5'
When the node is retrieved from the API
Then the inflated responses key 'attribute_priority_was' should be the integer '5'
Scenario: Set a override attribute in a cookbook attribute file
Given a validated node
And a 'role' named 'attribute_settings_default' exists
And it includes the role 'attribute_settings_default'
And it includes the recipe 'attribute_settings::default_in_recipe'
And it includes the recipe 'attribute_settings_normal::normal_in_recipe'
And it includes the recipe 'attribute_settings_override'
When I run the chef-client
Then the run should exit '0'
Then a file named 'attribute_setting.txt' should contain '6'
When the node is retrieved from the API
Then the inflated responses key 'attribute_priority_was' should be the integer '6'
Scenario: Set the override attribute in a role
Given a 'role' named 'attribute_settings_default' exists
And a 'role' named 'attribute_settings_override' exists
And a validated node
And it includes the role 'attribute_settings_default'
And it includes the recipe 'attribute_settings::default_in_recipe'
And it includes the recipe 'attribute_settings_normal::normal_in_recipe'
And it includes the recipe 'attribute_settings_override'
And it includes the role 'attribute_settings_override'
When I run the chef-client
Then the run should exit '0'
And a file named 'attribute_setting.txt' should contain '7'
When the node is retrieved from the API
Then the inflated responses key 'attribute_priority_was' should be the integer '7'
Scenario: Set the override attribute in a recipe
Given a 'role' named 'attribute_settings_default' exists
And a 'role' named 'attribute_settings_override' exists
And a validated node
And it includes the role 'attribute_settings_default'
And it includes the recipe 'attribute_settings::default_in_recipe'
And it includes the recipe 'attribute_settings_normal::normal_in_recipe'
And it includes the recipe 'attribute_settings_override'
And it includes the role 'attribute_settings_override'
And it includes the recipe 'attribute_settings_override::override_in_recipe'
When I run the chef-client
Then the run should exit '0'
And a file named 'attribute_setting.txt' should contain '8'
When the node is retrieved from the API
Then the inflated responses key 'attribute_priority_was' should be the integer '8'
Scenario: Data is removed from override attribute in a recipe
Given a 'role' named 'attribute_settings_override' exists
And a validated node
And it includes the role 'attribute_settings_override'
When I run the chef-client
Then the run should exit '0'
And a file named 'attribute_setting.txt' should contain '7'
When the node is retrieved from the API
Then the inflated responses key 'attribute_priority_was' should be the integer '7'
Given it includes no recipes
And it includes the recipe 'integration_setup'
And it includes the recipe 'no_attributes'
When I run the chef-client
Then the run should exit '0'
And a file named 'attribute_setting.txt' should contain 'snakes'
# Test that attributes from JSON are applied before attribute files are applied.
@chef1286
Scenario: Attributes from JSON files are normal attributes applied before attribute files
Given a validated node
And it includes the recipe 'attribute_settings_normal'
When I run the chef-client with json attributes
Then the run should exit '0'
Then a file named 'attribute_setting.txt' should contain '4'
When the node is retrieved from the API
Then the inflated responses key 'attribute_priority_was' should be the integer '4'
@chef1286
Scenario: Attributes from JSON files have higher precedence than defaults
Given a 'role' named 'attribute_settings_default' exists
And a 'role' named 'attribute_settings_override' exists
And a validated node
And it includes the role 'attribute_settings_default'
And it includes the recipe 'attribute_settings::default_in_recipe'
When I run the chef-client with json attributes
Then the run should exit '0'
Then a file named 'attribute_setting.txt' should contain 'from_json_file'
When the node is retrieved from the API
Then the inflated responses key 'attribute_priority_was' should match 'from_json_file'