PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
| Dir : /opt/puppetlabs/puppet/vendor_modules/scheduled_task/spec/acceptance/ |
| Server: Linux server1.ngambekcore.com 4.18.0-553.51.1.el8_10.x86_64 #1 SMP Wed Apr 30 04:00:07 EDT 2025 x86_64 IP: 159.198.77.92 |
| Dir : //opt/puppetlabs/puppet/vendor_modules/scheduled_task/spec/acceptance/should_destroy_spec.rb |
# frozen_string_literal: true
require 'spec_helper_acceptance'
describe 'Should destroy a scheduled task', node: host do
before :each do
pp = <<-MANIFEST
scheduled_task {'#{taskname}':
ensure => present,
command => 'c:\\\\windows\\\\system32\\\\notepad.exe',
arguments => "foo bar baz",
working_dir => 'c:\\\\windows',
trigger => {
schedule => daily,
start_time => '12:00',
},
provider => 'taskscheduler_api2'
}
MANIFEST
apply_manifest(pp, catch_failures: true)
end
context 'with taskname' do
let(:taskname) { "pl#{rand(999_999).to_i}" }
it 'destroys the task' do
# Verify the task exists
query_cmd = "schtasks.exe /query /v /fo list /tn #{taskname}"
run_shell(query_cmd)
pp = <<-MANIFEST
scheduled_task {'#{taskname}':
ensure => absent,
provider => 'taskscheduler_api2'
}
MANIFEST
apply_manifest(pp, catch_failures: true)
query_cmd = "schtasks.exe /query /v /fo list /tn #{taskname}"
query_out = run_shell(query_cmd, expect_failures: true)
expect(query_out.to_s).to match(%r{ERROR: The system cannot find the (file|path) specified})
end
end
end