diff --git a/spec/acceptance/access_rights_directory/allow_rights_dir_spec.rb b/spec/acceptance/access_rights_directory/allow_rights_dir_spec.rb index 6d4045c7..a8ea9fff 100644 --- a/spec/acceptance/access_rights_directory/allow_rights_dir_spec.rb +++ b/spec/acceptance/access_rights_directory/allow_rights_dir_spec.rb @@ -4,7 +4,7 @@ def apply_manifest_with_rights(acl_regex, agent, rights, target) context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target, rights)) do |result| + execute_manifest_on(agent, acl_manifest(target, rights), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/access_rights_directory/deny_rights_dir_spec.rb b/spec/acceptance/access_rights_directory/deny_rights_dir_spec.rb index 4411b546..5326d34a 100644 --- a/spec/acceptance/access_rights_directory/deny_rights_dir_spec.rb +++ b/spec/acceptance/access_rights_directory/deny_rights_dir_spec.rb @@ -4,7 +4,7 @@ def apply_manifest_with_rights(acl_regex, agent, rights, target) context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target, rights)) do |result| + execute_manifest_on(agent, acl_manifest(target, rights), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/access_rights_directory/mask_specific/allow_rights_dir_mask_spec.rb b/spec/acceptance/access_rights_directory/mask_specific/allow_rights_dir_mask_spec.rb index e7d94e20..e9b6cd17 100644 --- a/spec/acceptance/access_rights_directory/mask_specific/allow_rights_dir_mask_spec.rb +++ b/spec/acceptance/access_rights_directory/mask_specific/allow_rights_dir_mask_spec.rb @@ -4,7 +4,7 @@ def execute_manifest_with_mask(acl_regex, agent, mask) context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(mask)) do |result| + execute_manifest_on(agent, acl_manifest(mask), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/access_rights_directory/mask_specific/deny_rights_dir_mask_spec.rb b/spec/acceptance/access_rights_directory/mask_specific/deny_rights_dir_mask_spec.rb index 9d693138..ef119b3c 100644 --- a/spec/acceptance/access_rights_directory/mask_specific/deny_rights_dir_mask_spec.rb +++ b/spec/acceptance/access_rights_directory/mask_specific/deny_rights_dir_mask_spec.rb @@ -4,7 +4,7 @@ def execute_manifest_with_mask(acl_regex, agent, mask) context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(mask)) do |result| + execute_manifest_on(agent, acl_manifest(mask), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/access_rights_file/allow_rights_file_spec.rb b/spec/acceptance/access_rights_file/allow_rights_file_spec.rb index ee6f5f50..23ed06c1 100644 --- a/spec/acceptance/access_rights_file/allow_rights_file_spec.rb +++ b/spec/acceptance/access_rights_file/allow_rights_file_spec.rb @@ -4,7 +4,7 @@ def apply_manifest_and_verify(acl_regex, agent, file_content, rights, target) context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target, rights, file_content)) do |result| + execute_manifest_on(agent, acl_manifest(target, rights, file_content), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/access_rights_file/deny_rights_file_spec.rb b/spec/acceptance/access_rights_file/deny_rights_file_spec.rb index 0e8ba77e..7c835337 100644 --- a/spec/acceptance/access_rights_file/deny_rights_file_spec.rb +++ b/spec/acceptance/access_rights_file/deny_rights_file_spec.rb @@ -4,7 +4,7 @@ def apply_manifest_and_verify(acl_regex, agent, file_content, rights, target) context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target, rights, file_content)) do |result| + execute_manifest_on(agent, acl_manifest(target, rights, file_content), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/access_rights_file/mask_specific/allow_rights_file_mask_spec.rb b/spec/acceptance/access_rights_file/mask_specific/allow_rights_file_mask_spec.rb index 0ca686a9..abf2ce90 100644 --- a/spec/acceptance/access_rights_file/mask_specific/allow_rights_file_mask_spec.rb +++ b/spec/acceptance/access_rights_file/mask_specific/allow_rights_file_mask_spec.rb @@ -4,7 +4,7 @@ def apply_manifest_and_verify(acl_regex, agent, file_content, mask) context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(mask, file_content)) do |result| + execute_manifest_on(agent, acl_manifest(mask, file_content), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/access_rights_file/mask_specific/deny_rights_file_mask_spec.rb b/spec/acceptance/access_rights_file/mask_specific/deny_rights_file_mask_spec.rb index 28b70274..74d9c671 100644 --- a/spec/acceptance/access_rights_file/mask_specific/deny_rights_file_mask_spec.rb +++ b/spec/acceptance/access_rights_file/mask_specific/deny_rights_file_mask_spec.rb @@ -4,7 +4,7 @@ def apply_manifest_and_verify(acl_regex, agent, file_content, mask) context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(mask, file_content)) do |result| + execute_manifest_on(agent, acl_manifest(mask, file_content), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/basic_functionality/negative/negative_acl_on_linux_spec.rb b/spec/acceptance/basic_functionality/negative/negative_acl_on_linux_spec.rb index eb05afb5..af4ee18f 100644 --- a/spec/acceptance/basic_functionality/negative/negative_acl_on_linux_spec.rb +++ b/spec/acceptance/basic_functionality/negative/negative_acl_on_linux_spec.rb @@ -16,7 +16,7 @@ context 'ACL Fails Gracefully on Linux' do linux_agents.each do |agent| it "Verify that the 'acl' Type Does not Work on Non-Windows Agents on #{agent}" do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest) do |result| + execute_manifest_on(agent, acl_manifest, { :debug => true }) do |result| assert_match(%r{Error: Could not find a suitable provider for acl}, result.stderr, 'Expected error was not detected!') end end diff --git a/spec/acceptance/group/group_local_spec.rb b/spec/acceptance/group/group_local_spec.rb index b9680508..0527d72d 100644 --- a/spec/acceptance/group/group_local_spec.rb +++ b/spec/acceptance/group/group_local_spec.rb @@ -4,7 +4,7 @@ def apply_manifest_and_verify(agent, file_content, group_id, group_regex, user_type) context "on #{agent}" do it 'Execute ACL Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(user_type, file_content, group_id)) do |result| + execute_manifest_on(agent, acl_manifest(user_type, file_content, group_id), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/group/group_local_user_sid_spec.rb b/spec/acceptance/group/group_local_user_sid_spec.rb index c3210eb9..f6f45a01 100644 --- a/spec/acceptance/group/group_local_user_sid_spec.rb +++ b/spec/acceptance/group/group_local_user_sid_spec.rb @@ -91,7 +91,7 @@ def acl_manifest(target, user_id, sid) end it 'Execute Setup Manifest' do - on(agent, puppet('apply', '--debug'), stdin: setup_manifest(target_parent, target, file_content, user_id, group_id)) do |result| + execute_manifest_on(agent, setup_manifest(target_parent, target, file_content, user_id, group_id), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end @@ -103,7 +103,7 @@ def acl_manifest(target, user_id, sid) end it 'Execute ACL Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target, user_id, sid)) do |result| + execute_manifest_on(agent, acl_manifest(target, user_id, sid), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/group/negative/group_257_char_name_spec.rb b/spec/acceptance/group/negative/group_257_char_name_spec.rb index 4240c229..82be48e8 100644 --- a/spec/acceptance/group/negative/group_257_char_name_spec.rb +++ b/spec/acceptance/group/negative/group_257_char_name_spec.rb @@ -56,7 +56,7 @@ windows_agents.each do |agent| context "On Windows Agent Change Group to Local Group with Long Name on #{agent}" do it 'Attempt to Execute ACL Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest) do |result| + execute_manifest_on(agent, acl_manifest, { :debug => true }) do |result| assert_match(expected_error, result.stderr, 'Expected error was not detected!') end diff --git a/spec/acceptance/identity/negative/specify_identity_spec.rb b/spec/acceptance/identity/negative/specify_identity_spec.rb index 210f02d8..d408ad14 100644 --- a/spec/acceptance/identity/negative/specify_identity_spec.rb +++ b/spec/acceptance/identity/negative/specify_identity_spec.rb @@ -33,7 +33,7 @@ def verify_content_command(target_file) windows_agents.each do |agent| context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target_file, file_content, group_id)) do |result| + execute_manifest_on(agent, acl_manifest(target_file, file_content, group_id), { :debug => true }) do |result| assert_match(%r{Error: Failed to set permissions for }, result.stderr, 'Expected error was not detected!') end end @@ -55,7 +55,7 @@ def verify_content_command(target_file) windows_agents.each do |agent| context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target_file, file_content, user_id)) do |result| + execute_manifest_on(agent, acl_manifest(target_file, file_content, user_id), { :debug => true }) do |result| assert_match(%r{Error: Failed to set permissions for 'user_not_here'}, result.stderr, 'Expected error was not detected!') end end diff --git a/spec/acceptance/identity/specify_app_package_authority_idents_spec.rb b/spec/acceptance/identity/specify_app_package_authority_idents_spec.rb index 7ca47fef..f16414de 100644 --- a/spec/acceptance/identity/specify_app_package_authority_idents_spec.rb +++ b/spec/acceptance/identity/specify_app_package_authority_idents_spec.rb @@ -45,7 +45,7 @@ it 'Execute ACL Manifest' do # exit code 2: The run succeeded, and some resources were changed. - on(agent, puppet('apply', '--detailed-exitcodes'), stdin: acl_manifest, acceptable_exit_codes: [2]) do |result| + execute_manifest_on(agent, acl_manifest, { :catch_changes = true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end @@ -59,7 +59,7 @@ end it 'Execute ACL Manifest again' do - on(agent, puppet('apply'), stdin: acl_manifest, acceptable_exit_codes: [0]) do |result| + execute_manifest_on(agent, acl_manifest) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/identity/specify_group_identity_spec.rb b/spec/acceptance/identity/specify_group_identity_spec.rb index e57ffe57..2e9ac19f 100644 --- a/spec/acceptance/identity/specify_group_identity_spec.rb +++ b/spec/acceptance/identity/specify_group_identity_spec.rb @@ -4,7 +4,7 @@ def apply_manifest_and_verify(agent, file_content, group_id, target_file) context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest_with_group(target_file, file_content, group_id)) do |result| + execute_manifest_on(agent, acl_manifest_with_group(target_file, file_content, group_id), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/identity/specify_sid_identity_spec.rb b/spec/acceptance/identity/specify_sid_identity_spec.rb index 1b282af2..a82e6dbc 100644 --- a/spec/acceptance/identity/specify_sid_identity_spec.rb +++ b/spec/acceptance/identity/specify_sid_identity_spec.rb @@ -59,7 +59,7 @@ def acl_manifest(target_file, sid) end it 'Execute Setup Manifest' do - on(agent, puppet('apply', '--debug'), stdin: setup_manifest(target_file, file_content)) do |result| + execute_manifest_on(agent, setup_manifest(target_file, file_content), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end @@ -71,7 +71,7 @@ def acl_manifest(target_file, sid) end it 'Execute ACL Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target_file, sid)) do |result| + execute_manifest_on(agent, acl_manifest(target_file, sid), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/identity/specify_user_identity_spec.rb b/spec/acceptance/identity/specify_user_identity_spec.rb index 07eb40f5..129ec710 100644 --- a/spec/acceptance/identity/specify_user_identity_spec.rb +++ b/spec/acceptance/identity/specify_user_identity_spec.rb @@ -4,7 +4,7 @@ def apply_manifest_and_verify(agent, file_content, user_id, target_file) context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(file_content, user_id, target_file)) do |result| + execute_manifest_on(agent, acl_manifest(file_content, user_id, target_file), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/inheritance/inheritance_on_dir_spec.rb b/spec/acceptance/inheritance/inheritance_on_dir_spec.rb index fbb93bac..06f89e40 100644 --- a/spec/acceptance/inheritance/inheritance_on_dir_spec.rb +++ b/spec/acceptance/inheritance/inheritance_on_dir_spec.rb @@ -10,7 +10,7 @@ def apply_manifest_and_verify(perm_type, asset_type, child_inherit_type, acl_chi context "on #{agent}" do it 'Execute Apply Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target_name, target_child, user_id_child, rights, perm_type, child_inherit_type)) do |result| + execute_manifest_on(agent, acl_manifest(target_name, target_child, user_id_child, rights, perm_type, child_inherit_type), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/inheritance/inheritance_on_file_spec.rb b/spec/acceptance/inheritance/inheritance_on_file_spec.rb index 588c27cb..ae822a55 100644 --- a/spec/acceptance/inheritance/inheritance_on_file_spec.rb +++ b/spec/acceptance/inheritance/inheritance_on_file_spec.rb @@ -10,7 +10,7 @@ def apply_manifest_and_verify(perm_type, asset_type, child_inherit_type, acl_chi context "on #{agent}" do it 'Execute Apply Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target_name, target_child, file_content, user_id_child, rights, perm_type, child_inherit_type)) do |result| + execute_manifest_on(agent, acl_manifest(target_name, target_child, file_content, user_id_child, rights, perm_type, child_inherit_type), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/owner/negative/owner_257_char_name_spec.rb b/spec/acceptance/owner/negative/owner_257_char_name_spec.rb index 788e3d17..f9dd1943 100644 --- a/spec/acceptance/owner/negative/owner_257_char_name_spec.rb +++ b/spec/acceptance/owner/negative/owner_257_char_name_spec.rb @@ -7,7 +7,7 @@ def apply_manifest_and_verify(agent, target_name, file_content, user_id, owner_i verify_content_command = "cat /cygdrive/c/temp/#{target_name}" it 'Attempt to Execute ACL Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target_name, file_content, user_id, owner_id)) do |result| + execute_manifest_on(agent, acl_manifest(target_name, file_content, user_id, owner_id), { :debug => true }) do |result| assert_match(expected_error, result.stderr, 'Expected error was not detected!') end end diff --git a/spec/acceptance/owner/owner_local_group_spec.rb b/spec/acceptance/owner/owner_local_group_spec.rb index f03e6de2..4f5bb52a 100644 --- a/spec/acceptance/owner/owner_local_group_spec.rb +++ b/spec/acceptance/owner/owner_local_group_spec.rb @@ -8,7 +8,7 @@ def apply_manifest_and_verify(agent, target_name, file_content, owner_id, owner_ verify_owner_command = "cmd /c \"dir /q #{dosify_target}\"" it 'Execute ACL Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target_name, file_content, owner_id)) do |result| + execute_manifest_on(agent, acl_manifest(target_name, file_content, owner_id), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/owner/owner_local_user_sid_spec.rb b/spec/acceptance/owner/owner_local_user_sid_spec.rb index e835bf44..c93f1c71 100644 --- a/spec/acceptance/owner/owner_local_user_sid_spec.rb +++ b/spec/acceptance/owner/owner_local_user_sid_spec.rb @@ -74,7 +74,7 @@ def acl_manifest(target_name, sid) end it 'Execute Setup Manifest' do - on(agent, puppet('apply', '--debug'), stdin: setup_manifest(target_name, file_content, owner_id)) do |result| + execute_manifest_on(agent, setup_manifest(target_name, file_content, owner_id), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end @@ -86,7 +86,7 @@ def acl_manifest(target_name, sid) end it 'Execute ACL Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target_name, sid)) do |result| + execute_manifest_on(agent, acl_manifest(target_name, sid), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/owner/owner_local_user_spec.rb b/spec/acceptance/owner/owner_local_user_spec.rb index 9695882b..40cb12ad 100644 --- a/spec/acceptance/owner/owner_local_user_spec.rb +++ b/spec/acceptance/owner/owner_local_user_spec.rb @@ -8,7 +8,7 @@ def apply_manifest_and_verify(agent, file_content, owner_id, target_name, owner_ verify_owner_command = "cmd /c \"dir /q #{dosify_target}\"" it 'Execute ACL Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target_name, file_content, owner_id)) do |result| + execute_manifest_on(agent, acl_manifest(target_name, file_content, owner_id), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/parameter_target/explicit_target_spec.rb b/spec/acceptance/parameter_target/explicit_target_spec.rb index ec8e92b1..05562651 100644 --- a/spec/acceptance/parameter_target/explicit_target_spec.rb +++ b/spec/acceptance/parameter_target/explicit_target_spec.rb @@ -33,7 +33,7 @@ windows_agents.each do |agent| context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest) do |result| + execute_manifest_on(agent, acl_manifest, { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/parameter_target/negative/negative_acl_spec.rb b/spec/acceptance/parameter_target/negative/negative_acl_spec.rb index e31b954f..8a31356a 100644 --- a/spec/acceptance/parameter_target/negative/negative_acl_spec.rb +++ b/spec/acceptance/parameter_target/negative/negative_acl_spec.rb @@ -26,7 +26,7 @@ def acl_manifest(target) context "Specify Blank Target on #{agent}" do target = '' it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target), acceptable_exit_codes: [1]) do |result| + execute_manifest_on(agent, acl_manifest(target), { :debug => true, :catch_changes = true }) do |result| assert_match(%r{Error:.*(A non-empty name must be specified|Empty string title at)}, result.stderr, 'Expected error was not detected!') end end @@ -37,7 +37,7 @@ def acl_manifest(target) context "Specify Target with Invalid Path Characters on #{agent}" do target = 'c:/temp/invalid_<:>|?*' it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target)) do |result| + execute_manifest_on(agent, acl_manifest(target), { :debug => true }) do |result| assert_match(%r{Error:.*The filename, directory name, or volume label syntax is incorrect}, result.stderr, 'Expected error was not detected!') end diff --git a/spec/acceptance/parameter_target/negative/negative_acl_to_symlink_spec.rb b/spec/acceptance/parameter_target/negative/negative_acl_to_symlink_spec.rb index 32f596ad..0af5856e 100644 --- a/spec/acceptance/parameter_target/negative/negative_acl_to_symlink_spec.rb +++ b/spec/acceptance/parameter_target/negative/negative_acl_to_symlink_spec.rb @@ -64,7 +64,7 @@ end it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest) do |result| + execute_manifest_on(agent, acl_manifest, { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/parameter_target/perms_on_dir_8dot3_spec.rb b/spec/acceptance/parameter_target/perms_on_dir_8dot3_spec.rb index c852e22a..2203b892 100644 --- a/spec/acceptance/parameter_target/perms_on_dir_8dot3_spec.rb +++ b/spec/acceptance/parameter_target/perms_on_dir_8dot3_spec.rb @@ -5,7 +5,7 @@ def apply_manifest_and_verify(agent, target, target8dot3, verify_acl_command, re context "on #{agent}" do acl_regex = %r{.*\\bob:\(OI\)\(CI\)\(F\)} it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target, target8dot3)) do |result| + execute_manifest_on(agent, acl_manifest(target, target8dot3), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end @@ -17,7 +17,7 @@ def apply_manifest_and_verify(agent, target, target8dot3, verify_acl_command, re end if remove it 'Execute Remove Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest_remove(target8dot3)) do |result| + execute_manifest_on(agent, acl_manifest_remove(target8dot3), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/parameter_target/perms_on_dir_spec.rb b/spec/acceptance/parameter_target/perms_on_dir_spec.rb index da80cfc9..f21fa374 100644 --- a/spec/acceptance/parameter_target/perms_on_dir_spec.rb +++ b/spec/acceptance/parameter_target/perms_on_dir_spec.rb @@ -6,7 +6,7 @@ def apply_manifest_and_verify(agent, target, remove = false) verify_acl_command = "icacls #{target}" acl_regex = %r{.*\\bob:\(OI\)\(CI\)\(F\)} it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target)) do |result| + execute_manifest_on(agent, acl_manifest(target), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end @@ -18,7 +18,7 @@ def apply_manifest_and_verify(agent, target, remove = false) end if remove it 'Execute Remove Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest_remove(target)) do |result| + execute_manifest_on(agent, acl_manifest_remove(target), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/parameter_target/perms_on_file_8dot3_spec.rb b/spec/acceptance/parameter_target/perms_on_file_8dot3_spec.rb index 27a861ea..cd57d164 100644 --- a/spec/acceptance/parameter_target/perms_on_file_8dot3_spec.rb +++ b/spec/acceptance/parameter_target/perms_on_file_8dot3_spec.rb @@ -7,7 +7,7 @@ def apply_manifest_and_verify(file_name, target8dot3, file_content, agent, remov verify_content_command = "cat /cygdrive/c/temp/#{file_name}" context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(file_name, target8dot3, file_content)) do |result| + execute_manifest_on(agent, acl_manifest(file_name, target8dot3, file_content), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end @@ -20,7 +20,7 @@ def apply_manifest_and_verify(file_name, target8dot3, file_content, agent, remov if remove it 'Execute Remove Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest_remove(target8dot3)) do |result| + execute_manifest_on(agent, acl_manifest_remove(target8dot3), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/parameter_target/perms_on_file_spec.rb b/spec/acceptance/parameter_target/perms_on_file_spec.rb index bd818654..238cbcf6 100644 --- a/spec/acceptance/parameter_target/perms_on_file_spec.rb +++ b/spec/acceptance/parameter_target/perms_on_file_spec.rb @@ -7,7 +7,7 @@ def apply_manifest_and_verify(file_name, file_content, agent, remove = nil) verify_content_command = "cat /cygdrive/c/temp/#{file_name}" context "on #{agent}" do it 'Execute Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(file_name, file_content)) do |result| + execute_manifest_on(agent, acl_manifest(file_name, file_content), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end @@ -20,7 +20,7 @@ def apply_manifest_and_verify(file_name, file_content, agent, remove = nil) if remove it 'Execute Remove Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest_remove(file_name)) do |result| + execute_manifest_on(agent, acl_manifest_remove(file_name), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/propagation/prop_file_spec.rb b/spec/acceptance/propagation/prop_file_spec.rb index 30bd6ee3..a567835d 100644 --- a/spec/acceptance/propagation/prop_file_spec.rb +++ b/spec/acceptance/propagation/prop_file_spec.rb @@ -61,7 +61,7 @@ def acl_manifest(target_name, file_content, rights, prop_type, affects_child_typ agent_version_response = on(agent, puppet('--version')).stdout.chomp agent_version = Gem::Version.new(agent_version_response) it 'Execute Apply Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target_name, file_content, rights, prop_type, affects_child_type)) do |result| + execute_manifest_on(agent, acl_manifest(target_name, file_content, rights, prop_type, affects_child_type), { :debug => true }) do |result| verify_manifest = (agent_version >= Gem::Version.new('5.0.0')) ? verify_manifest_pup5 : verify_manifest_pup4 assert_match(verify_manifest, result.stdout, 'Expected ACL change event not detected!') diff --git a/spec/acceptance/propagation/prop_self_all_child_spec.rb b/spec/acceptance/propagation/prop_self_all_child_spec.rb index d480d5ab..e97049be 100644 --- a/spec/acceptance/propagation/prop_self_all_child_spec.rb +++ b/spec/acceptance/propagation/prop_self_all_child_spec.rb @@ -11,7 +11,7 @@ def apply_manifest_and_verify(acl_regex, agent, prop_type, affects_child_type) verify_child_acl_command = "icacls #{target_child}" it 'Execute Apply Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target_name, rights, prop_type, target_child, affects_child_type)) do |result| + execute_manifest_on(agent, acl_manifest(target_name, rights, prop_type, target_child, affects_child_type), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/propagation/prop_self_no_child_spec.rb b/spec/acceptance/propagation/prop_self_no_child_spec.rb index e52c6c62..cf189cd4 100644 --- a/spec/acceptance/propagation/prop_self_no_child_spec.rb +++ b/spec/acceptance/propagation/prop_self_no_child_spec.rb @@ -11,7 +11,7 @@ def apply_manifest_and_verify(acl_regex, agent, prop_type) verify_child_acl_command = "icacls #{target_child}" it 'Execute Apply Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target_name, rights, prop_type, target_child)) do |result| + execute_manifest_on(agent, acl_manifest(target_name, rights, prop_type, target_child), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/propagation/prop_spec.rb b/spec/acceptance/propagation/prop_spec.rb index c36158e7..4ea2a096 100644 --- a/spec/acceptance/propagation/prop_spec.rb +++ b/spec/acceptance/propagation/prop_spec.rb @@ -6,7 +6,7 @@ def apply_manifest_and_verify(prop_type, affects_child_type, acl_regex, agent) target_name = "prop_#{prop_type}_to_#{affects_child_type}" verify_acl_command = "icacls #{target_parent}/#{target_name}" it 'Execute Apply Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target_name, rights, prop_type, affects_child_type)) do |result| + execute_manifest_on(agent, acl_manifest(target_name, rights, prop_type, affects_child_type), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end diff --git a/spec/acceptance/purge/negative/purge_all_perms_dir_spec.rb b/spec/acceptance/purge/negative/purge_all_perms_dir_spec.rb index 47363eb7..9a0d0275 100644 --- a/spec/acceptance/purge/negative/purge_all_perms_dir_spec.rb +++ b/spec/acceptance/purge/negative/purge_all_perms_dir_spec.rb @@ -48,7 +48,7 @@ def purge_acl_manifest(target) windows_agents.each do |agent| context "on #{agent}" do it 'Execute Apply Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target)) do |result| + execute_manifest_on(agent, acl_manifest(target), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end @@ -60,7 +60,7 @@ def purge_acl_manifest(target) end it 'Attempt to Execute Purge Manifest' do - on(agent, puppet('apply', '--debug'), stdin: purge_acl_manifest(target), acceptable_exit_codes: [1]) do |result| + execute_manifest_on(agent, purge_acl_manifest(target), { :debug => true, :catch_changes => true }) do |result| assert_match(verify_purge_error, result.stderr, 'Expected error was not detected!') end end diff --git a/spec/acceptance/purge/negative/purge_all_perms_file_spec.rb b/spec/acceptance/purge/negative/purge_all_perms_file_spec.rb index c75281c6..9021dc15 100644 --- a/spec/acceptance/purge/negative/purge_all_perms_file_spec.rb +++ b/spec/acceptance/purge/negative/purge_all_perms_file_spec.rb @@ -50,7 +50,7 @@ def purge_acl_manifest(target) windows_agents.each do |agent| context "on #{agent}" do it 'Execute Apply Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target, file_content)) do |result| + execute_manifest_on(agent, acl_manifest(target, file_content), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end @@ -62,7 +62,7 @@ def purge_acl_manifest(target) end it 'Attempt to Execute Purge Manifest' do - on(agent, puppet('apply', '--debug'), stdin: purge_acl_manifest(target), acceptable_exit_codes: [1]) do |result| + execute_manifest_on(agent, purge_acl_manifest(target), { :debug => true, :catch_changes => true }) do |result| assert_match(verify_purge_error, result.stderr, 'Expected error was not detected!') end end diff --git a/spec/acceptance/purge/purge_all_other_perms_dir_spec.rb b/spec/acceptance/purge/purge_all_other_perms_dir_spec.rb index 38ee7a45..9835a674 100644 --- a/spec/acceptance/purge/purge_all_other_perms_dir_spec.rb +++ b/spec/acceptance/purge/purge_all_other_perms_dir_spec.rb @@ -69,7 +69,7 @@ def purge_acl_manifest(target, user_id2) end it 'Execute Apply Manifest' do - on(agent, puppet('apply', '--debug'), stdin: acl_manifest(target, user_id1, user_id2)) do |result| + execute_manifest_on(agent, acl_manifest(target, user_id1, user_id2), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end @@ -81,7 +81,7 @@ def purge_acl_manifest(target, user_id2) end it 'Execute Purge Manifest' do - on(agent, puppet('apply', '--debug'), stdin: purge_acl_manifest(target, user_id2)) do |result| + execute_manifest_on(agent, purge_acl_manifest(target, user_id2), { :debug => true }) do |result| assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') end end