rspec-puppet 2.12.0 → 3.0.0.rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +139 -483
- data/README.md +18 -5
- data/bin/rspec-puppet-init +4 -3
- data/lib/rspec-puppet/adapters.rb +67 -61
- data/lib/rspec-puppet/cache.rb +3 -2
- data/lib/rspec-puppet/consts.rb +16 -14
- data/lib/rspec-puppet/coverage.rb +37 -42
- data/lib/rspec-puppet/errors.rb +6 -6
- data/lib/rspec-puppet/example/application_example_group.rb +3 -1
- data/lib/rspec-puppet/example/class_example_group.rb +3 -1
- data/lib/rspec-puppet/example/define_example_group.rb +3 -1
- data/lib/rspec-puppet/example/function_example_group.rb +28 -23
- data/lib/rspec-puppet/example/host_example_group.rb +3 -1
- data/lib/rspec-puppet/example/provider_example_group.rb +2 -0
- data/lib/rspec-puppet/example/type_alias_example_group.rb +4 -2
- data/lib/rspec-puppet/example/type_example_group.rb +3 -1
- data/lib/rspec-puppet/example.rb +6 -7
- data/lib/rspec-puppet/facter_impl.rb +11 -10
- data/lib/rspec-puppet/matchers/allow_value.rb +10 -10
- data/lib/rspec-puppet/matchers/compile.rb +54 -61
- data/lib/rspec-puppet/matchers/count_generic.rb +18 -18
- data/lib/rspec-puppet/matchers/create_generic.rb +66 -78
- data/lib/rspec-puppet/matchers/dynamic_matchers.rb +13 -2
- data/lib/rspec-puppet/matchers/include_class.rb +5 -4
- data/lib/rspec-puppet/matchers/parameter_matcher.rb +11 -12
- data/lib/rspec-puppet/matchers/raise_error.rb +5 -1
- data/lib/rspec-puppet/matchers/run.rb +41 -44
- data/lib/rspec-puppet/matchers/type_matchers.rb +37 -48
- data/lib/rspec-puppet/matchers.rb +2 -0
- data/lib/rspec-puppet/monkey_patches/win32/registry.rb +7 -5
- data/lib/rspec-puppet/monkey_patches/win32/taskscheduler.rb +3 -1
- data/lib/rspec-puppet/monkey_patches/windows/taskschedulerconstants.rb +208 -205
- data/lib/rspec-puppet/monkey_patches.rb +56 -56
- data/lib/rspec-puppet/rake_task.rb +6 -4
- data/lib/rspec-puppet/raw_string.rb +2 -0
- data/lib/rspec-puppet/sensitive.rb +9 -7
- data/lib/rspec-puppet/setup.rb +43 -48
- data/lib/rspec-puppet/spec_helper.rb +2 -0
- data/lib/rspec-puppet/support.rb +133 -134
- data/lib/rspec-puppet/tasks/release_test.rb +8 -5
- data/lib/rspec-puppet/version.rb +5 -0
- data/lib/rspec-puppet.rb +43 -51
- metadata +11 -9
@@ -1,262 +1,265 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RSpec
|
2
4
|
module Puppet
|
3
5
|
module Windows
|
4
6
|
module TaskSchedulerConstants
|
5
|
-
|
6
|
-
|
7
|
-
# Triggers
|
7
|
+
SYSTEM_USERS = ['NT AUTHORITY\SYSTEM', 'SYSTEM', 'NT AUTHORITY\LOCALSERVICE', 'NT AUTHORITY\NETWORKSERVICE',
|
8
|
+
'BUILTIN\USERS', 'USERS'].freeze
|
8
9
|
|
9
|
-
|
10
|
-
TASK_TIME_TRIGGER_ONCE = 1
|
10
|
+
# Triggers
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
# Trigger is set to run the task a single time
|
13
|
+
TASK_TIME_TRIGGER_ONCE = 1
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
# Trigger is set to run the task on a daily interval
|
16
|
+
TASK_TIME_TRIGGER_DAILY = 2
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
# Trigger is set to run the task on specific days of a specific week & month
|
19
|
+
TASK_TIME_TRIGGER_WEEKLY = 3
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
# Trigger is set to run the task on specific day(s) of the month
|
22
|
+
TASK_TIME_TRIGGER_MONTHLYDATE = 4
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
TASK_EVENT_TRIGGER_ON_IDLE = 6
|
24
|
+
# Trigger is set to run the task on specific day(s) of the month
|
25
|
+
TASK_TIME_TRIGGER_MONTHLYDOW = 5
|
27
26
|
|
28
|
-
|
27
|
+
# Trigger is set to run the task if the system remains idle for the amount
|
28
|
+
# of time specified by the idle wait time of the task
|
29
|
+
TASK_EVENT_TRIGGER_ON_IDLE = 6
|
29
30
|
|
30
|
-
|
31
|
-
TASK_EVENT_TRIGGER_AT_SYSTEMSTART = 8
|
31
|
+
TASK_TRIGGER_REGISTRATION = 7
|
32
32
|
|
33
|
-
|
34
|
-
|
33
|
+
# Trigger is set to run the task at system startup
|
34
|
+
TASK_EVENT_TRIGGER_AT_SYSTEMSTART = 8
|
35
35
|
|
36
|
-
|
36
|
+
# Trigger is set to run the task when a user logs on
|
37
|
+
TASK_EVENT_TRIGGER_AT_LOGON = 9
|
37
38
|
|
38
|
-
|
39
|
+
TASK_TRIGGER_SESSION_STATE_CHANGE = 11
|
39
40
|
|
40
|
-
|
41
|
-
TASK_SUNDAY = 0x1
|
41
|
+
# Daily Tasks
|
42
42
|
|
43
|
-
|
44
|
-
|
43
|
+
# The task will run on Sunday
|
44
|
+
TASK_SUNDAY = 0x1
|
45
45
|
|
46
|
-
|
47
|
-
|
46
|
+
# The task will run on Monday
|
47
|
+
TASK_MONDAY = 0x2
|
48
48
|
|
49
|
-
|
50
|
-
|
49
|
+
# The task will run on Tuesday
|
50
|
+
TASK_TUESDAY = 0x4
|
51
51
|
|
52
|
-
|
53
|
-
|
52
|
+
# The task will run on Wednesday
|
53
|
+
TASK_WEDNESDAY = 0x8
|
54
54
|
|
55
|
-
|
56
|
-
|
55
|
+
# The task will run on Thursday
|
56
|
+
TASK_THURSDAY = 0x10
|
57
57
|
|
58
|
-
|
59
|
-
|
58
|
+
# The task will run on Friday
|
59
|
+
TASK_FRIDAY = 0x20
|
60
60
|
|
61
|
-
|
61
|
+
# The task will run on Saturday
|
62
|
+
TASK_SATURDAY = 0x40
|
62
63
|
|
63
|
-
|
64
|
-
TASK_FIRST_WEEK = 0x01
|
64
|
+
# Weekly tasks
|
65
65
|
|
66
|
-
|
67
|
-
|
66
|
+
# The task will run between the 1st and 7th day of the month
|
67
|
+
TASK_FIRST_WEEK = 0x01
|
68
68
|
|
69
|
-
|
70
|
-
|
69
|
+
# The task will run between the 8th and 14th day of the month
|
70
|
+
TASK_SECOND_WEEK = 0x02
|
71
71
|
|
72
|
-
|
73
|
-
|
72
|
+
# The task will run between the 15th and 21st day of the month
|
73
|
+
TASK_THIRD_WEEK = 0x04
|
74
74
|
|
75
|
-
|
76
|
-
|
75
|
+
# The task will run between the 22nd and 28th day of the month
|
76
|
+
TASK_FOURTH_WEEK = 0x08
|
77
77
|
|
78
|
-
|
78
|
+
# The task will run the last seven days of the month
|
79
|
+
TASK_LAST_WEEK = 0x10
|
79
80
|
|
80
|
-
|
81
|
-
TASK_JANUARY = 0x1
|
81
|
+
# Monthly tasks
|
82
82
|
|
83
|
-
|
84
|
-
|
83
|
+
# The task will run in January
|
84
|
+
TASK_JANUARY = 0x1
|
85
85
|
|
86
|
-
|
87
|
-
|
86
|
+
# The task will run in February
|
87
|
+
TASK_FEBRUARY = 0x2
|
88
88
|
|
89
|
-
|
90
|
-
|
89
|
+
# The task will run in March
|
90
|
+
TASK_MARCH = 0x4
|
91
91
|
|
92
|
-
|
93
|
-
|
92
|
+
# The task will run in April
|
93
|
+
TASK_APRIL = 0x8
|
94
94
|
|
95
|
-
|
96
|
-
|
95
|
+
# The task will run in May
|
96
|
+
TASK_MAY = 0x10
|
97
97
|
|
98
|
-
|
99
|
-
|
98
|
+
# The task will run in June
|
99
|
+
TASK_JUNE = 0x20
|
100
100
|
|
101
|
-
|
102
|
-
|
101
|
+
# The task will run in July
|
102
|
+
TASK_JULY = 0x40
|
103
103
|
|
104
|
-
|
105
|
-
|
104
|
+
# The task will run in August
|
105
|
+
TASK_AUGUST = 0x80
|
106
106
|
|
107
|
-
|
108
|
-
|
107
|
+
# The task will run in September
|
108
|
+
TASK_SEPTEMBER = 0x100
|
109
109
|
|
110
|
-
|
111
|
-
|
110
|
+
# The task will run in October
|
111
|
+
TASK_OCTOBER = 0x200
|
112
112
|
|
113
|
-
|
114
|
-
|
113
|
+
# The task will run in November
|
114
|
+
TASK_NOVEMBER = 0x400
|
115
115
|
|
116
|
-
|
116
|
+
# The task will run in December
|
117
|
+
TASK_DECEMBER = 0x800
|
117
118
|
|
118
|
-
|
119
|
-
TASK_FLAG_INTERACTIVE = 0x1
|
119
|
+
# Flags
|
120
120
|
|
121
|
-
|
122
|
-
|
121
|
+
# Used when converting AT service jobs into work items
|
122
|
+
TASK_FLAG_INTERACTIVE = 0x1
|
123
123
|
|
124
|
-
|
125
|
-
|
124
|
+
# The work item will be deleted when there are no more scheduled run times
|
125
|
+
TASK_FLAG_DELETE_WHEN_DONE = 0x2
|
126
126
|
|
127
|
-
|
128
|
-
|
129
|
-
TASK_FLAG_START_ONLY_IF_IDLE = 0x10
|
127
|
+
# The work item is disabled. Useful for temporarily disabling a task
|
128
|
+
TASK_FLAG_DISABLED = 0x4
|
130
129
|
|
131
|
-
|
132
|
-
|
133
|
-
|
130
|
+
# The work item begins only if the computer is not in use at the scheduled
|
131
|
+
# start time
|
132
|
+
TASK_FLAG_START_ONLY_IF_IDLE = 0x10
|
134
133
|
|
135
|
-
|
136
|
-
|
134
|
+
# The work item terminates if the computer makes an idle to non-idle
|
135
|
+
# transition while the work item is running
|
136
|
+
TASK_FLAG_KILL_ON_IDLE_END = 0x20
|
137
137
|
|
138
|
-
|
139
|
-
|
140
|
-
TASK_FLAG_KILL_IF_GOING_ON_BATTERIES = 0x80
|
138
|
+
# The work item does not start if the computer is running on battery power
|
139
|
+
TASK_FLAG_DONT_START_IF_ON_BATTERIES = 0x40
|
141
140
|
|
142
|
-
|
143
|
-
|
141
|
+
# The work item ends, and the associated application quits, if the computer
|
142
|
+
# switches to battery power
|
143
|
+
TASK_FLAG_KILL_IF_GOING_ON_BATTERIES = 0x80
|
144
144
|
|
145
|
-
|
146
|
-
|
145
|
+
# The work item starts only if the computer is in a docking station
|
146
|
+
TASK_FLAG_RUN_ONLY_IF_DOCKED = 0x100
|
147
147
|
|
148
|
-
|
149
|
-
|
148
|
+
# The work item created will be hidden
|
149
|
+
TASK_FLAG_HIDDEN = 0x200
|
150
150
|
|
151
|
-
|
152
|
-
|
153
|
-
TASK_FLAG_RESTART_ON_IDLE_RESUME = 0x800
|
151
|
+
# The work item runs only if there is a valid internet connection
|
152
|
+
TASK_FLAG_RUN_IF_CONNECTED_TO_INTERNET = 0x400
|
154
153
|
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
154
|
+
# The work item starts again if the computer makes a non-idle to idle
|
155
|
+
# transition
|
156
|
+
TASK_FLAG_RESTART_ON_IDLE_RESUME = 0x800
|
157
|
+
|
158
|
+
# The work item causes the system to be resumed, or awakened, if the
|
159
|
+
# system is running on batter power
|
160
|
+
TASK_FLAG_SYSTEM_REQUIRED = 0x1000
|
161
|
+
|
162
|
+
# The work item runs only if a specified account is logged on interactively
|
163
|
+
TASK_FLAG_RUN_ONLY_IF_LOGGED_ON = 0x2000
|
164
|
+
|
165
|
+
# Triggers
|
166
|
+
|
167
|
+
# The task will stop at some point in time
|
168
|
+
TASK_TRIGGER_FLAG_HAS_END_DATE = 0x1
|
169
|
+
|
170
|
+
# The task can be stopped at the end of the repetition period
|
171
|
+
TASK_TRIGGER_FLAG_KILL_AT_DURATION_END = 0x2
|
172
|
+
|
173
|
+
# The task trigger is disabled
|
174
|
+
TASK_TRIGGER_FLAG_DISABLED = 0x4
|
175
|
+
|
176
|
+
# Run Level Types
|
177
|
+
# Tasks will be run with the least privileges
|
178
|
+
TASK_RUNLEVEL_LUA = 0
|
179
|
+
# Tasks will be run with the highest privileges
|
180
|
+
TASK_RUNLEVEL_HIGHEST = 1
|
181
|
+
|
182
|
+
# Logon Types
|
183
|
+
# Used for non-NT credentials
|
184
|
+
TASK_LOGON_NONE = 0
|
185
|
+
# Use a password for logging on the user
|
186
|
+
TASK_LOGON_PASSWORD = 1
|
187
|
+
# The service will log the user on using Service For User
|
188
|
+
TASK_LOGON_S4U = 2
|
189
|
+
# Task will be run only in an existing interactive session
|
190
|
+
TASK_LOGON_INTERACTIVE_TOKEN = 3
|
191
|
+
# Group activation. The groupId field specifies the group
|
192
|
+
TASK_LOGON_GROUP = 4
|
193
|
+
# When Local System, Local Service, or Network Service account is
|
194
|
+
# being used as a security context to run the task
|
195
|
+
TASK_LOGON_SERVICE_ACCOUNT = 5
|
196
|
+
# Not in use; currently identical to TASK_LOGON_PASSWORD
|
197
|
+
TASK_LOGON_INTERACTIVE_TOKEN_OR_PASSWORD = 6
|
198
|
+
|
199
|
+
TASK_MAX_RUN_TIMES = 1440
|
200
|
+
TASKS_TO_RETRIEVE = 5
|
201
|
+
|
202
|
+
# Task creation
|
203
|
+
|
204
|
+
TASK_VALIDATE_ONLY = 0x1
|
205
|
+
TASK_CREATE = 0x2
|
206
|
+
TASK_UPDATE = 0x4
|
207
|
+
TASK_CREATE_OR_UPDATE = 0x6
|
208
|
+
TASK_DISABLE = 0x8
|
209
|
+
TASK_DONT_ADD_PRINCIPAL_ACE = 0x10
|
210
|
+
TASK_IGNORE_REGISTRATION_TRIGGERS = 0x20
|
211
|
+
|
212
|
+
# Priority classes
|
213
|
+
|
214
|
+
REALTIME_PRIORITY_CLASS = 0
|
215
|
+
HIGH_PRIORITY_CLASS = 1
|
216
|
+
ABOVE_NORMAL_PRIORITY_CLASS = 2 # Or 3
|
217
|
+
NORMAL_PRIORITY_CLASS = 4 # Or 5, 6
|
218
|
+
BELOW_NORMAL_PRIORITY_CLASS = 7 # Or 8
|
219
|
+
IDLE_PRIORITY_CLASS = 9 # Or 10
|
220
|
+
|
221
|
+
CLSCTX_INPROC_SERVER = 0x1
|
222
|
+
CLSID_CTask = [0x148BD520, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03].pack('LSSC8')
|
223
|
+
CLSID_CTaskScheduler = [0x148BD52A, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05,
|
224
|
+
0x03].pack('LSSC8')
|
225
|
+
IID_ITaskScheduler = [0x148BD527, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03].pack('LSSC8')
|
226
|
+
IID_ITask = [0x148BD524, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03].pack('LSSC8')
|
227
|
+
IID_IPersistFile = [0x0000010b, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46].pack('LSSC8')
|
228
|
+
|
229
|
+
# Days of month
|
230
|
+
|
231
|
+
TASK_FIRST = 0x01
|
232
|
+
TASK_SECOND = 0x02
|
233
|
+
TASK_THIRD = 0x04
|
234
|
+
TASK_FOURTH = 0x08
|
235
|
+
TASK_FIFTH = 0x10
|
236
|
+
TASK_SIXTH = 0x20
|
237
|
+
TASK_SEVENTH = 0x40
|
238
|
+
TASK_EIGHTH = 0x80
|
239
|
+
TASK_NINETH = 0x100
|
240
|
+
TASK_TENTH = 0x200
|
241
|
+
TASK_ELEVENTH = 0x400
|
242
|
+
TASK_TWELFTH = 0x800
|
243
|
+
TASK_THIRTEENTH = 0x1000
|
244
|
+
TASK_FOURTEENTH = 0x2000
|
245
|
+
TASK_FIFTEENTH = 0x4000
|
246
|
+
TASK_SIXTEENTH = 0x8000
|
247
|
+
TASK_SEVENTEENTH = 0x10000
|
248
|
+
TASK_EIGHTEENTH = 0x20000
|
249
|
+
TASK_NINETEENTH = 0x40000
|
250
|
+
TASK_TWENTIETH = 0x80000
|
251
|
+
TASK_TWENTY_FIRST = 0x100000
|
252
|
+
TASK_TWENTY_SECOND = 0x200000
|
253
|
+
TASK_TWENTY_THIRD = 0x400000
|
254
|
+
TASK_TWENTY_FOURTH = 0x800000
|
255
|
+
TASK_TWENTY_FIFTH = 0x1000000
|
256
|
+
TASK_TWENTY_SIXTH = 0x2000000
|
257
|
+
TASK_TWENTY_SEVENTH = 0x4000000
|
258
|
+
TASK_TWENTY_EIGHTH = 0x8000000
|
259
|
+
TASK_TWENTY_NINTH = 0x10000000
|
260
|
+
TASK_THIRTYETH = 0x20000000
|
261
|
+
TASK_THIRTY_FIRST = 0x40000000
|
262
|
+
TASK_LAST = 0x80000000
|
260
263
|
end
|
261
264
|
end
|
262
265
|
end
|