|
36 | 36 | let(:unknown_targets) { targets.reject { |target| target.protocol == 'pcp' } } |
37 | 37 | let(:fact) { { 'osfamily' => 'none' } } |
38 | 38 | let(:custom_facts_task) { Bolt::Task.new('custom_facts_task') } |
39 | | - let(:version_task) { Bolt::Task.new('puppet_agent::version') } |
40 | | - let(:install_task) { Bolt::Task.new('puppet_agent::install') } |
| 39 | + let(:version_task) { Bolt::Task.new('openvox_bootstrap::check') } |
| 40 | + let(:install_task) { Bolt::Task.new('openvox_bootstrap::install') } |
41 | 41 | let(:service_task) { Bolt::Task.new('service') } |
42 | 42 |
|
43 | 43 | before(:each) do |
44 | 44 | applicator.stubs(:build_plugin_tarball).returns(:tarball) |
45 | 45 | applicator.stubs(:custom_facts_task).returns(custom_facts_task) |
46 | 46 | inventory.get_targets(targets) |
47 | | - targets.each { |t| inventory.set_feature(t, 'puppet-agent', false) } |
| 47 | + targets.each { |t| inventory.set_feature(t, 'openvox-agent', false) } |
48 | 48 |
|
49 | 49 | task1 = mock('version_task') |
50 | | - task1.stubs(:task_hash).returns('name' => 'puppet_agent::version') |
| 50 | + task1.stubs(:task_hash).returns('name' => 'openvox_bootstrap::check') |
51 | 51 | task1.stubs(:runnable_with?).returns(true) |
52 | | - Puppet::Pal::ScriptCompiler.any_instance.stubs(:task_signature).with('puppet_agent::version').returns(task1) |
| 52 | + Puppet::Pal::ScriptCompiler.any_instance.stubs(:task_signature).with('openvox_bootstrap::check').returns(task1) |
53 | 53 | task2 = mock('install_task') |
54 | | - task2.stubs(:task_hash).returns('name' => 'puppet_agent::install') |
| 54 | + task2.stubs(:task_hash).returns('name' => 'openvox_bootstrap::install') |
55 | 55 | task2.stubs(:runnable_with?).returns(true) |
56 | | - Puppet::Pal::ScriptCompiler.any_instance.stubs(:task_signature).with('puppet_agent::install').returns(task2) |
| 56 | + Puppet::Pal::ScriptCompiler.any_instance.stubs(:task_signature).with('openvox_bootstrap::install').returns(task2) |
57 | 57 | task3 = mock('service_task') |
58 | 58 | task3.stubs(:task_hash).returns('name' => 'service') |
59 | 59 | task3.stubs(:runnable_with?).returns(true) |
60 | 60 | Puppet::Pal::ScriptCompiler.any_instance.stubs(:task_signature).with('service').returns(task3) |
61 | 61 | end |
62 | 62 |
|
63 | | - it 'sets puppet-agent feature and gathers facts' do |
| 63 | + it 'sets openvox-agent feature and gathers facts' do |
64 | 64 | facts = Bolt::ResultSet.new(targets.map { |t| Bolt::Result.new(t, value: fact) }) |
65 | 65 | executor.expects(:run_task) |
66 | 66 | .with(anything, custom_facts_task, includes('plugins'), {}) |
|
73 | 73 |
|
74 | 74 | is_expected.to run.with_params(hostnames.join(',')) |
75 | 75 | targets.each do |target| |
76 | | - expect(inventory.features(target)).to include('puppet-agent') unless target.transport == 'pcp' |
| 76 | + expect(inventory.features(target)).to include('openvox-agent') unless target.transport == 'pcp' |
77 | 77 | expect(inventory.facts(target)).to eq(fact) |
78 | 78 | end |
79 | 79 | end |
|
91 | 91 |
|
92 | 92 | is_expected.to run.with_params(hostnames, '_run_as' => 'root') |
93 | 93 | targets.each do |target| |
94 | | - expect(inventory.features(target)).to include('puppet-agent') unless target.transport == 'pcp' |
| 94 | + expect(inventory.features(target)).to include('openvox-agent') unless target.transport == 'pcp' |
95 | 95 | expect(inventory.facts(target)).to eq(fact) |
96 | 96 | end |
97 | 97 | end |
|
109 | 109 |
|
110 | 110 | is_expected.to run.with_params(hostnames, '_noop' => true) |
111 | 111 | targets.each do |target| |
112 | | - expect(inventory.features(target)).to include('puppet-agent') unless target.transport == 'pcp' |
| 112 | + expect(inventory.features(target)).to include('openvox-agent') unless target.transport == 'pcp' |
113 | 113 | expect(inventory.facts(target)).to eq(fact) |
114 | 114 | end |
115 | 115 | end |
|
141 | 141 | 'plugin_hooks' => { |
142 | 142 | 'puppet_library' => { |
143 | 143 | 'plugin' => 'task', |
144 | | - 'task' => 'puppet_agent::install' |
| 144 | + 'task' => 'openvox_bootstrap::install' |
145 | 145 | } |
146 | 146 | } |
147 | 147 | }] |
|
161 | 161 | .returns(task_hook) |
162 | 162 |
|
163 | 163 | is_expected.to run.with_params(hostname) |
164 | | - expect(inventory.features(target)).to include('puppet-agent') |
| 164 | + expect(inventory.features(target)).to include('openvox-agent') |
165 | 165 | expect(inventory.facts(target)).to eq(fact) |
166 | 166 | end |
167 | 167 | end |
|
192 | 192 | .returns(task_hook) |
193 | 193 |
|
194 | 194 | is_expected.to run.with_params(hostname) |
195 | | - expect(inventory.features(target)).to include('puppet-agent') |
| 195 | + expect(inventory.features(target)).to include('openvox-agent') |
196 | 196 | expect(inventory.facts(target)).to eq(fact) |
197 | 197 | end |
198 | 198 | end |
|
217 | 217 |
|
218 | 218 | is_expected.to run.with_params(hostnames.join(',')) |
219 | 219 | targets.each do |target| |
220 | | - expect(inventory.features(target)).to include('puppet-agent') unless target.transport == 'pcp' |
| 220 | + expect(inventory.features(target)).to include('openvox-agent') unless target.transport == 'pcp' |
221 | 221 | expect(inventory.facts(target)).to eq(fact) |
222 | 222 | end |
223 | 223 | end |
224 | 224 | end |
225 | 225 |
|
226 | | - context 'with targets assigned the puppet-agent feature' do |
| 226 | + context 'with targets assigned the openvox-agent feature' do |
227 | 227 | let(:hostnames) { %w[foo bar] } |
228 | 228 | let(:targets) { hostnames.map { |h| inventory.get_target(h) } } |
229 | 229 | let(:fact) { { 'osfamily' => 'none' } } |
|
232 | 232 | before(:each) do |
233 | 233 | applicator.stubs(:build_plugin_tarball).returns(:tarball) |
234 | 234 | applicator.stubs(:custom_facts_task).returns(custom_facts_task) |
235 | | - targets.each { |target| inventory.set_feature(target, 'puppet-agent') } |
| 235 | + targets.each { |target| inventory.set_feature(target, 'openvox-agent') } |
236 | 236 | end |
237 | 237 |
|
238 | 238 | it 'sets feature and gathers facts' do |
|
243 | 243 |
|
244 | 244 | is_expected.to run.with_params(hostnames.join(',')) |
245 | 245 | targets.each do |target| |
246 | | - expect(inventory.features(target)).to include('puppet-agent') |
| 246 | + expect(inventory.features(target)).to include('openvox-agent') |
247 | 247 | expect(inventory.facts(target)).to eq(fact) |
248 | 248 | end |
249 | 249 | end |
|
258 | 258 | before(:each) do |
259 | 259 | applicator.stubs(:build_plugin_tarball).returns(:tarball) |
260 | 260 | applicator.stubs(:custom_facts_task).returns(custom_facts_task) |
261 | | - targets.each { |target| inventory.set_feature(target, 'puppet-agent') } |
| 261 | + targets.each { |target| inventory.set_feature(target, 'openvox-agent') } |
262 | 262 | end |
263 | 263 |
|
264 | 264 | it 'only uses required plugins' do |
|
0 commit comments