From 0e2528ce479cd3e21325b0634f2c27b818783e2e Mon Sep 17 00:00:00 2001 From: Justin Stoller Date: Tue, 25 Jul 2023 08:55:24 -0700 Subject: [PATCH 1/2] (maint) Finish move to using puppet.com This also updates the tests to work with either puppet.com or puppetlabs.com forgeapi addresses. --- .../tests/Puppetfile/HTTP_PROXY_affects_git_source.rb | 6 +----- .../basic_functionality/proxy_specified_in_configuration.rb | 2 +- .../tests/basic_functionality/proxy_with_puppetfile.rb | 2 +- integration/tests/git_source/HTTP_proxy_and_git_source.rb | 6 +----- .../basic_workflow/negative/neg_inaccessible_forge.rb | 3 ++- lib/r10k/puppetfile.rb | 2 +- 6 files changed, 7 insertions(+), 14 deletions(-) diff --git a/integration/tests/Puppetfile/HTTP_PROXY_affects_git_source.rb b/integration/tests/Puppetfile/HTTP_PROXY_affects_git_source.rb index 9ae2d82ea..f58725202 100644 --- a/integration/tests/Puppetfile/HTTP_PROXY_affects_git_source.rb +++ b/integration/tests/Puppetfile/HTTP_PROXY_affects_git_source.rb @@ -65,11 +65,7 @@ #test on(master, "#{r10k_fqp} deploy environment -p", :accept_all_exit_codes => true) do |r| # Rugged as of 0.28 has a different error message than shellgit - regex = if git_provider == 'rugged' - /failed to resolve address for ferritsarebest\.net/ - else - /Could not resolve proxy: ferritsarebest\.net/ - end + regex = /((failed to resolve address for)|(Could not resolve proxy:)) ferritsarebest\.net/ assert(r.exit_code == 1, 'expected error code was not observed') assert_match(regex, r.stderr, 'The expected error message was not observed' ) end diff --git a/integration/tests/basic_functionality/proxy_specified_in_configuration.rb b/integration/tests/basic_functionality/proxy_specified_in_configuration.rb index abfc4e9a5..25ec5b9b4 100644 --- a/integration/tests/basic_functionality/proxy_specified_in_configuration.rb +++ b/integration/tests/basic_functionality/proxy_specified_in_configuration.rb @@ -50,7 +50,7 @@ CONF #Verification -squid_log_regex = /CONNECT forgeapi.puppet.com:443/ +squid_log_regex = /CONNECT forgeapi.puppet(labs)?.com:443/ #Teardown teardown do diff --git a/integration/tests/basic_functionality/proxy_with_puppetfile.rb b/integration/tests/basic_functionality/proxy_with_puppetfile.rb index 17c413be0..01386afe8 100644 --- a/integration/tests/basic_functionality/proxy_with_puppetfile.rb +++ b/integration/tests/basic_functionality/proxy_with_puppetfile.rb @@ -21,7 +21,7 @@ squid_log = "/var/log/squid/access.log" #Verification -squid_log_regex = /CONNECT forgeapi.puppet.com:443/ +squid_log_regex = /CONNECT forgeapi.puppet(labs)?.com:443/ #Teardown teardown do diff --git a/integration/tests/git_source/HTTP_proxy_and_git_source.rb b/integration/tests/git_source/HTTP_proxy_and_git_source.rb index e101ab55d..28287a55b 100644 --- a/integration/tests/git_source/HTTP_proxy_and_git_source.rb +++ b/integration/tests/git_source/HTTP_proxy_and_git_source.rb @@ -59,11 +59,7 @@ #test on(master, "#{r10k_fqp} deploy environment -p", :accept_all_exit_codes => true) do |r| # Rugged as of 0.28 has a different error message than shellgit - regex = if git_provider == 'rugged' - /failed to resolve address for foooooooo\.unresolvable/ - else - /Could not resolve proxy: foooooooo\.unresolvable/ - end + regex = /((failed to resolve address for)|(Could not resolve proxy:)) foooooooo\.unresolvable/ assert(r.exit_code == 1, 'expected error code was not observed') assert_match(regex, r.stderr, 'The expected error message was not observed' ) end diff --git a/integration/tests/user_scenario/basic_workflow/negative/neg_inaccessible_forge.rb b/integration/tests/user_scenario/basic_workflow/negative/neg_inaccessible_forge.rb index 12630a5a2..9ae8c07e5 100755 --- a/integration/tests/user_scenario/basic_workflow/negative/neg_inaccessible_forge.rb +++ b/integration/tests/user_scenario/basic_workflow/negative/neg_inaccessible_forge.rb @@ -19,7 +19,7 @@ puppet_file_path = File.join(git_environments_path, 'Puppetfile') #Verification -error_message_regex = /Error: Could not connect via HTTPS to https:\/\/forgeapi.puppetlabs.com/ +error_message_regex = /Error: Could not connect via HTTPS to https:\/\/forgeapi.puppet(labs)?.com/ #Teardown teardown do @@ -35,6 +35,7 @@ step 'Point Forge Hostname to Localhost' on(master, "echo '127.0.0.1 forgeapi.puppet.com' > #{hosts_file_path}") +on(master, "echo '127.0.0.1 forgeapi.puppetlabs.com' > #{hosts_file_path}") step 'Checkout "production" Branch' git_on(master, 'checkout production', git_environments_path) diff --git a/lib/r10k/puppetfile.rb b/lib/r10k/puppetfile.rb index d4cfd895b..5a26c4e09 100644 --- a/lib/r10k/puppetfile.rb +++ b/lib/r10k/puppetfile.rb @@ -72,7 +72,7 @@ def initialize(basedir, options_or_moduledir = nil, deprecated_path_arg = nil, d @overrides = options.delete(:overrides) || {} @default_branch_override = @overrides.dig(:environments, :default_branch_override) - @forge = 'forgeapi.puppetlabs.com' + @forge = 'forgeapi.puppet.com' @loader = ::R10K::ModuleLoader::Puppetfile.new( basedir: @basedir, From cbcd985b711d73d89a0d9c601c02a5bf893dcfa4 Mon Sep 17 00:00:00 2001 From: Justin Stoller Date: Tue, 25 Jul 2023 08:58:31 -0700 Subject: [PATCH 2/2] (PE-36512) Use production forge for testing And delete tests not worth porting. These are in two categories, one that needs a premium license (we could in theory add these back once we acquire one for testing) and the other is forge modules that have releases pulled/deleted. --- integration/pre-suite/10_git_config.rb | 3 - .../install_pe_only_module_with_puppetfile.rb | 83 ------------ .../proxy_with_pe_only_module.rb | 128 ------------------ .../deploy_env_without_mod_update.rb | 3 - .../neg_deploy_env_with_module_update.rb | 3 - .../git_source/git_source_repeated_remote.rb | 3 - .../purging/content_not_purged_at_root.rb | 3 - integration/tests/purging/default_purging.rb | 3 - .../does_not_purge_files_on_white_list.rb | 3 - .../tests/purging/invalid_whitelist_types.rb | 63 --------- .../multi_env_custom_forge_git_module.rb | 3 - ...ulti_env_custom_forge_git_module_static.rb | 3 - .../multi_source_custom_forge_git_module.rb | 3 - .../negative/neg_bad_forge_module.rb | 3 - .../negative/neg_duplicate_module_names.rb | 3 - ...neg_module_specified_at_deleted_release.rb | 49 ------- .../neg_specify_deleted_forge_module.rb | 6 +- .../single_env_custom_forge_git_module.rb | 3 - .../single_env_custom_forge_module.rb | 3 - .../single_env_module_already_installed.rb | 3 - .../single_env_module_last_release_deleted.rb | 68 ---------- .../single_env_purge_unmanaged_modules.rb | 3 - .../single_env_switch_forge_git_module.rb | 3 - ...gle_env_upgrade_forge_mod_revert_change.rb | 3 - .../multi_env_add_change_remove.rb | 3 - 25 files changed, 1 insertion(+), 453 deletions(-) delete mode 100644 integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb delete mode 100644 integration/tests/basic_functionality/proxy_with_pe_only_module.rb delete mode 100644 integration/tests/purging/invalid_whitelist_types.rb delete mode 100644 integration/tests/user_scenario/basic_workflow/negative/neg_module_specified_at_deleted_release.rb delete mode 100644 integration/tests/user_scenario/basic_workflow/single_env_module_last_release_deleted.rb diff --git a/integration/pre-suite/10_git_config.rb b/integration/pre-suite/10_git_config.rb index 1c4e65b0c..609dc926b 100755 --- a/integration/pre-suite/10_git_config.rb +++ b/integration/pre-suite/10_git_config.rb @@ -23,9 +23,6 @@ fail_test('This pre-suite requires PE 3.7 or above!') if pe_version < 3.7 #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - step 'Read module path' on(master, puppet('config print basemodulepath')) do |result| (result.stdout.include? ':') ? separator = ':' : separator = ';' diff --git a/integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb b/integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb deleted file mode 100644 index 933b2ae1e..000000000 --- a/integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb +++ /dev/null @@ -1,83 +0,0 @@ -require 'git_utils' -require 'r10k_utils' -require 'master_manipulator' -test_name 'RK-158 - C92362 - Install a PE-only module from forge' - -#Init -env_path = on(master, puppet('config print environmentpath')).stdout.rstrip -r10k_fqp = get_r10k_fqp(master) -master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip - -git_repo_path = '/git_repos' -git_repo_name = 'environments' -git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git") -git_environments_path = '/root/environments' -last_commit = git_last_commit(master, git_environments_path) -git_provider = ENV['GIT_PROVIDER'] || 'shellgit' - -r10k_config_path = get_r10k_config_file_path(master) -r10k_config_bak_path = "#{r10k_config_path}.bak" - -#In-line files -r10k_conf = <<-CONF -cachedir: '/var/cache/r10k' -git: - provider: '#{git_provider}' -sources: - control: - basedir: "#{env_path}" - remote: "#{git_control_remote}" -CONF - -#Manifest -site_pp_path = File.join(git_environments_path, 'manifests', 'site.pp') -site_pp = create_site_pp(master_certname, ' include peonly') - -# Verification -notify_message_regex = /I am in the production environment, this is a PE only module/ - -#Teardown -teardown do - step 'remove license file' - on(master, 'rm -f /etc/puppetlabs/license.key') - - step 'Restore Original "r10k" Config' - on(master, "mv #{r10k_config_bak_path} #{r10k_config_path}") - - step 'cleanup r10k' - clean_up_r10k(master, last_commit, git_environments_path) -end - -#Setup -step 'Stub the forge' -stub_forge_on(master) - -step 'Backup a Valid "r10k" Config' -on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}") - -step 'Update the "r10k" Config' -create_remote_file(master, r10k_config_path, r10k_conf) - -step 'Download license file from artifactory' -curl_on(master, 'https://artifactory.delivery.puppetlabs.net/artifactory/generic/r10k_test_license.key -o /etc/puppetlabs/license.key') - -step 'Inject New "site.pp" to the "production" Environment' -inject_site_pp(master, site_pp_path, site_pp) - -step 'Copy Puppetfile to "production" Environment Git Repo' -create_remote_file(master, "#{git_environments_path}/Puppetfile", 'mod "ztr-peonly"') - -step 'Push Changes' -git_add_commit_push(master, 'production', 'add Puppetfile', git_environments_path) - -#Tests -step 'Deploy "production" Environment via r10k' -on(master, "#{r10k_fqp} deploy environment -p") - -agents.each do |agent| - step "Run Puppet Agent" - on(agent, puppet('agent', '--test', '--environment production'), :acceptable_exit_codes => 2) do |result| - assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!') - assert_match(notify_message_regex, result.stdout, 'Expected message not found!') - end -end diff --git a/integration/tests/basic_functionality/proxy_with_pe_only_module.rb b/integration/tests/basic_functionality/proxy_with_pe_only_module.rb deleted file mode 100644 index 225b24b2e..000000000 --- a/integration/tests/basic_functionality/proxy_with_pe_only_module.rb +++ /dev/null @@ -1,128 +0,0 @@ -require 'git_utils' -require 'r10k_utils' -require 'master_manipulator' -test_name 'RK-242 '#'- C87652 - Specify the proxy in the r10k.yaml' - -confine(:to, :platform => ['el', 'sles']) - -#Init -master_platform = fact_on(master, 'osfamily') -master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip -env_path = on(master, puppet('config print environmentpath')).stdout.rstrip -r10k_fqp = get_r10k_fqp(master) - -git_repo_path = '/git_repos' -git_repo_name = 'environments' -git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git") -git_environments_path = '/root/environments' -last_commit = git_last_commit(master, git_environments_path) -git_provider = ENV['GIT_PROVIDER'] - -local_files_root_path = ENV['FILES'] || 'files' - -git_manifest_template_path = File.join(local_files_root_path, 'pre-suite', 'git_config.pp.erb') -git_manifest = ERB.new(File.read(git_manifest_template_path)).result(binding) - -r10k_config_path = get_r10k_config_file_path(master) -r10k_config_bak_path = "#{r10k_config_path}.bak" - -case master_platform - when 'RedHat' - pkg_manager = 'yum' - when 'Suse' - pkg_manager = 'zypper' -end - -install_squid = "#{pkg_manager} install -y squid" -remove_squid = "#{pkg_manager} remove -y squid" -squid_log = "/var/log/squid/access.log" - -#In-line files -r10k_conf = <<-CONF -cachedir: '/var/cache/r10k' -git: - provider: '#{git_provider}' -sources: - control: - basedir: "#{env_path}" - remote: "#{git_control_remote}" -forge: - proxy: "http://#{master.hostname}:3128" -CONF - -#Manifest -site_pp_path = File.join(git_environments_path, 'manifests', 'site.pp') -site_pp = create_site_pp(master_certname, ' include peonly') - -#Verification -squid_log_regex = /CONNECT forgeapi.puppet.com:443/ -notify_message_regex = /I am in the production environment, this is a PE only module/ - -#Teardown -teardown do - step 'remove license file' - on(master, 'rm -f /etc/puppetlabs/license.key') - - step 'Restore "git" Package' - on(master, puppet('apply'), :stdin => git_manifest, :acceptable_exit_codes => [0,2]) - - step 'Restore Original "r10k" Config' - on(master, "mv #{r10k_config_bak_path} #{r10k_config_path}") - - clean_up_r10k(master, last_commit, git_environments_path) - - step 'Remove Squid' - on(master, puppet("apply -e 'service {'squid' : ensure => stopped}'")) - on(master, remove_squid) -end - -#Setup -step 'Stub the forge' -stub_forge_on(master) - -step 'Backup Current "r10k" Config' -on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}") - -step 'Update the "r10k" Config' -create_remote_file(master, r10k_config_path, r10k_conf) - -step 'Download license file from artifactory' -curl_on(master, 'https://artifactory.delivery.puppetlabs.net/artifactory/generic/r10k_test_license.key -o /etc/puppetlabs/license.key') - -step 'Checkout "production" Branch' -git_on(master, 'checkout production', git_environments_path) - -step 'Inject New "site.pp" to the "production" Environment' -inject_site_pp(master, site_pp_path, site_pp) - -step 'Copy Puppetfile to "production" Environment with PE only module' -create_remote_file(master, "#{git_environments_path}/Puppetfile", 'mod "ztr-peonly"') - -step 'Push Changes' -git_add_commit_push(master, 'production', 'add Puppetfile', git_environments_path) - -step 'Install and configure squid proxy' -on(master, install_squid) - -step 'turn off the firewall' -on(master, puppet("apply -e 'service {'iptables' : ensure => stopped}'")) - -step 'start squid proxy' -on(master, puppet("apply -e 'service {'squid' : ensure => running}'")) - -#Tests -step 'Deploy "production" Environment via r10k' -on(master, "#{r10k_fqp} deploy environment -p") - -step 'Read the squid logs' -on(master, "cat #{squid_log}") do |result| - assert_match(squid_log_regex, result.stdout, 'Proxy logs did not indicate use of the proxy.') -end - -agents.each do |agent| - step "Run Puppet Agent" - on(agent, puppet('agent', '--test', '--environment production'), :acceptable_exit_codes => [0,2]) do |result| - assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!') - assert_match(notify_message_regex, result.stdout, 'Expected message not found!') - end -end diff --git a/integration/tests/command_line/deploy_env_without_mod_update.rb b/integration/tests/command_line/deploy_env_without_mod_update.rb index 3c5648703..81336fb23 100755 --- a/integration/tests/command_line/deploy_env_without_mod_update.rb +++ b/integration/tests/command_line/deploy_env_without_mod_update.rb @@ -46,9 +46,6 @@ class { 'motd': end #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - step 'Inject New "site.pp" to the "production" Environment' inject_site_pp(master, site_pp_path, site_pp) diff --git a/integration/tests/command_line/negative/neg_deploy_env_with_module_update.rb b/integration/tests/command_line/negative/neg_deploy_env_with_module_update.rb index 76c894894..1260e3192 100755 --- a/integration/tests/command_line/negative/neg_deploy_env_with_module_update.rb +++ b/integration/tests/command_line/negative/neg_deploy_env_with_module_update.rb @@ -47,9 +47,6 @@ class { 'motd': end #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - step 'Inject New "site.pp" to the "production" Environment' inject_site_pp(master, site_pp_path, site_pp) diff --git a/integration/tests/git_source/git_source_repeated_remote.rb b/integration/tests/git_source/git_source_repeated_remote.rb index fb68d988f..bdc3047b0 100644 --- a/integration/tests/git_source/git_source_repeated_remote.rb +++ b/integration/tests/git_source/git_source_repeated_remote.rb @@ -44,9 +44,6 @@ clean_up_r10k(master, last_commit, git_environments_path) end -step 'Stub the forge' -stub_forge_on(master) - step 'Backup Current "r10k" Config' on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}") diff --git a/integration/tests/purging/content_not_purged_at_root.rb b/integration/tests/purging/content_not_purged_at_root.rb index a3b719165..092fc7181 100644 --- a/integration/tests/purging/content_not_purged_at_root.rb +++ b/integration/tests/purging/content_not_purged_at_root.rb @@ -50,9 +50,6 @@ clean_up_r10k(master, last_commit, git_environments_path) end -step 'Stub the forge' -stub_forge_on(master) - step 'Backup Current "r10k" Config' on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}") diff --git a/integration/tests/purging/default_purging.rb b/integration/tests/purging/default_purging.rb index 37addb6a8..73e114734 100644 --- a/integration/tests/purging/default_purging.rb +++ b/integration/tests/purging/default_purging.rb @@ -51,9 +51,6 @@ fake_file_c_to_be_purged = "#{fake_environment_path_c}/fakefile3.txt" # initalize file content -step 'Stub the forge' -stub_forge_on(master) - step 'Backup Current "r10k" Config' on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}") diff --git a/integration/tests/purging/does_not_purge_files_on_white_list.rb b/integration/tests/purging/does_not_purge_files_on_white_list.rb index 99fb3eaac..7d7793835 100644 --- a/integration/tests/purging/does_not_purge_files_on_white_list.rb +++ b/integration/tests/purging/does_not_purge_files_on_white_list.rb @@ -26,9 +26,6 @@ end # initalize file content -step 'Stub the forge' -stub_forge_on(master) - step 'Backup Current "r10k" Config' on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}") diff --git a/integration/tests/purging/invalid_whitelist_types.rb b/integration/tests/purging/invalid_whitelist_types.rb deleted file mode 100644 index b08ceebbd..000000000 --- a/integration/tests/purging/invalid_whitelist_types.rb +++ /dev/null @@ -1,63 +0,0 @@ -require 'git_utils' -require 'r10k_utils' -require 'master_manipulator' -test_name 'RK-257 - C98043 - verify default whitelist only accepts strings or array of strings' - -#Init -env_path = on(master, puppet('config print environmentpath')).stdout.rstrip -r10k_fqp = get_r10k_fqp(master) -git_environments_path = '/root/environments' - -git_repo_path = '/git_repos' -git_repo_name = 'environments' -git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git") - -last_commit = git_last_commit(master, git_environments_path) -git_provider = ENV['GIT_PROVIDER'] - -r10k_config_path = get_r10k_config_file_path(master) -r10k_config_bak_path = "#{r10k_config_path}.bak" - -#invalid content to test -hash_whitelist = '{:cats => \'cats.txt\'}' -invalid_array_content_whitelist = '[\'cats.txt\', [:broken]]' - -teardown do - step 'Restore Original "r10k" Config' - on(master, "mv #{r10k_config_bak_path} #{r10k_config_path}") - - clean_up_r10k(master, last_commit, git_environments_path) -end - -# initalize file content -step 'Stub the forge' -stub_forge_on(master) - -step 'Backup Current "r10k" Config' -on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}") - -[hash_whitelist, invalid_array_content_whitelist].each do |whitelist_content| - r10k_conf = <<-CONF -cachedir: '/var/cache/r10k' -git: - provider: '#{git_provider}' -sources: - control: - basedir: "#{env_path}" - remote: "#{git_control_remote}" -deploy: - purge_whitelist: #{whitelist_content} - CONF - - step 'Update the "r10k" Config' - create_remote_file(master, r10k_config_path, r10k_conf) - - step 'Deploy r10k, and verify that invalid whitelist content causes error' - on(master, "#{r10k_fqp} deploy environment -p", :accept_all_exit_codes => true) do |result| - error = /did not find expected node content while parsing a flow node/ - error_message = 'whitelist content did not generate expected error' - expect_failure('RK-263') do - assert_no_match(result.stdout, error, error_message) - end - end -end diff --git a/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb b/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb index aba257080..52a41e0c3 100755 --- a/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb +++ b/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb @@ -62,9 +62,6 @@ class { 'motd': end #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - env_names.each do |env| if env == 'production' step "Checkout \"#{env}\" Branch" diff --git a/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb b/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb index 965421fb0..2e8275feb 100755 --- a/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb +++ b/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb @@ -66,9 +66,6 @@ class { 'motd': end #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - env_names.each do |env| if env == 'production' step "Checkout \"#{env}\" Branch" diff --git a/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb b/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb index 71da6e0db..5c3a23f43 100755 --- a/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb +++ b/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb @@ -102,9 +102,6 @@ class { 'helloworld': } end #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - step 'Backup Current "r10k" Config' on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}") diff --git a/integration/tests/user_scenario/basic_workflow/negative/neg_bad_forge_module.rb b/integration/tests/user_scenario/basic_workflow/negative/neg_bad_forge_module.rb index cf48c7553..6a240f3a6 100755 --- a/integration/tests/user_scenario/basic_workflow/negative/neg_bad_forge_module.rb +++ b/integration/tests/user_scenario/basic_workflow/negative/neg_bad_forge_module.rb @@ -29,9 +29,6 @@ end #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - step 'Checkout "production" Branch' git_on(master, 'checkout production', git_environments_path) diff --git a/integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb b/integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb index 112853238..e7bc8c839 100755 --- a/integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb +++ b/integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb @@ -25,9 +25,6 @@ end #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - step 'Checkout "production" Branch' git_on(master, 'checkout production', git_environments_path) diff --git a/integration/tests/user_scenario/basic_workflow/negative/neg_module_specified_at_deleted_release.rb b/integration/tests/user_scenario/basic_workflow/negative/neg_module_specified_at_deleted_release.rb deleted file mode 100644 index da0c8b196..000000000 --- a/integration/tests/user_scenario/basic_workflow/negative/neg_module_specified_at_deleted_release.rb +++ /dev/null @@ -1,49 +0,0 @@ -require 'git_utils' -require 'r10k_utils' -test_name 'CODEMGMT-127 - C64121 - Attempt to Deploy Environment with Forge Module Specified at Deleted Release' - -#This test uses the spotty module at https://forge-aio01-petest.puppetlabs.com//puppetlabs/spotty, with valid released 0.1.0 and 0.3.0 versions, and deleted 0.2.0 and 0.4.0 versions. - -#Init -git_environments_path = '/root/environments' -last_commit = git_last_commit(master, git_environments_path) -r10k_fqp = get_r10k_fqp(master) - -#Verification -if get_puppet_version(master) < 4.0 - error_notification_regex = /No releases matching '0.2.0'/ -else - error_notification_regex = /error.* -> The module release puppetlabs-spotty-0.2.0 does not exist on/i -end - -#File -puppet_file = <<-PUPPETFILE -mod "puppetlabs/spotty", '0.2.0' -PUPPETFILE - -puppet_file_path = File.join(git_environments_path, 'Puppetfile') - -#Teardown -teardown do - clean_up_r10k(master, last_commit, git_environments_path) -end - -#Setup -step 'Stub Forge on Master' -stub_forge_on(master) - -#Tests -step 'Checkout "production" Branch' -git_on(master, 'checkout production', git_environments_path) - -step 'Create "Puppetfile" for the "production" Environment' -create_remote_file(master, puppet_file_path, puppet_file) - -step 'Push Changes' -git_add_commit_push(master, 'production', 'Add module.', git_environments_path) - -#Tests -step "Deploy production environment via r10k with module specified at deleted version" -on(master, "#{r10k_fqp} deploy environment -p -v", :acceptable_exit_codes => 1) do |result| - assert_match(error_notification_regex, result.stderr, 'Unexpected error was detected!') -end diff --git a/integration/tests/user_scenario/basic_workflow/negative/neg_specify_deleted_forge_module.rb b/integration/tests/user_scenario/basic_workflow/negative/neg_specify_deleted_forge_module.rb index 0211c86ef..5c9bbdfd9 100644 --- a/integration/tests/user_scenario/basic_workflow/negative/neg_specify_deleted_forge_module.rb +++ b/integration/tests/user_scenario/basic_workflow/negative/neg_specify_deleted_forge_module.rb @@ -10,7 +10,7 @@ r10k_fqp = get_r10k_fqp(master) #Verification -error_notification_regex = /The module puppetlabs-regret does not appear to have any published releases/ +error_notification_regex = /(The module puppetlabs-regret does not appear to have any published releases)|(module puppetlabs-regret does not exist on)/ #File puppet_file = <<-PUPPETFILE @@ -24,10 +24,6 @@ clean_up_r10k(master, last_commit, git_environments_path) end -#Setup -step 'Stub Forge on Master' -stub_forge_on(master) - #Tests step 'Checkout "production" Branch' git_on(master, 'checkout production', git_environments_path) diff --git a/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb b/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb index 85a2faaa3..08507baa1 100755 --- a/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb +++ b/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb @@ -64,9 +64,6 @@ class { 'motd': end #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - step 'Checkout "production" Branch' git_on(master, 'checkout production', git_environments_path) diff --git a/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_module.rb b/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_module.rb index 87157a37b..26310bf45 100755 --- a/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_module.rb +++ b/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_module.rb @@ -45,9 +45,6 @@ class { 'motd': end #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - step 'Checkout "production" Branch' git_on(master, 'checkout production', git_environments_path) diff --git a/integration/tests/user_scenario/basic_workflow/single_env_module_already_installed.rb b/integration/tests/user_scenario/basic_workflow/single_env_module_already_installed.rb index e7989e38d..6d69add0b 100755 --- a/integration/tests/user_scenario/basic_workflow/single_env_module_already_installed.rb +++ b/integration/tests/user_scenario/basic_workflow/single_env_module_already_installed.rb @@ -44,9 +44,6 @@ class { 'motd': end #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - step 'Add motd module from the forge using the PMT' on(master, puppet('module', 'install', 'puppetlabs-motd', '--modulepath', forge_module_path)) diff --git a/integration/tests/user_scenario/basic_workflow/single_env_module_last_release_deleted.rb b/integration/tests/user_scenario/basic_workflow/single_env_module_last_release_deleted.rb deleted file mode 100644 index a8dc6d42e..000000000 --- a/integration/tests/user_scenario/basic_workflow/single_env_module_last_release_deleted.rb +++ /dev/null @@ -1,68 +0,0 @@ -require 'git_utils' -require 'r10k_utils' -test_name 'CODEMGMT-127 - C64120 - Single Environment with Forge Module where Latest Release has been Deleted' - -#This test uses the spotty module at https://forge-aio01-petest.puppetlabs.com//puppetlabs/spotty, which has valid 0.1.0 and 0.3.0 versions, and deleted 0.2.0 and 0.4.0 versions. - -#Init -env_path = on(master, puppet('config print environmentpath')).stdout.rstrip -prod_env_modules_path = File.join(env_path, 'production', 'modules') -r10k_fqp = get_r10k_fqp(master) - -git_environments_path = '/root/environments' -last_commit = git_last_commit(master, git_environments_path) - -#Verification -module_contents = 'Version 3' -module_contents_regex = /\A#{module_contents}\n\z/ - -module_contents_path = File.join(prod_env_modules_path, 'spotty', 'manifests', 'init.pp') -module_version_filepath = File.join(prod_env_modules_path, 'spotty', 'metadata.json') -module_version_3_regex = /"0.3.0"/ - -#File -puppet_file = <<-PUPPETFILE -mod "puppetlabs/spotty" -PUPPETFILE - -puppet_file_path = File.join(git_environments_path, 'Puppetfile') - -#Teardown -teardown do - clean_up_r10k(master, last_commit, git_environments_path) -end - -#Setup -step 'Stub Forge on Master' -stub_forge_on(master) - -#Tests -step 'Checkout "production" Branch' -git_on(master, 'checkout production', git_environments_path) - -step 'Create "Puppetfile" for the "production" Environment' -create_remote_file(master, puppet_file_path, puppet_file) - -step 'Push Changes' -git_add_commit_push(master, 'production', 'Add module.', git_environments_path) - -#Tests -step 'Deploy "production" Environment via r10k with modules' -on(master, "#{r10k_fqp} deploy environment -p -v") - -agents.each do |agent| - step "Run Puppet Agent" - on(agent, puppet('agent', '--test', '--environment production'), :acceptable_exit_codes => [0,2]) do |result| - assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!') - end - - step 'Verify Contents' - on(master, "cat #{module_contents_path}") do |result| - assert_match(module_contents, result.stdout, 'File Content is Invalid') - end - - step 'Verify Version' - on(master, "grep version #{module_version_filepath}") do |result| - assert_match(module_version_3_regex, result.stdout, 'File Content is Invalid') - end -end diff --git a/integration/tests/user_scenario/basic_workflow/single_env_purge_unmanaged_modules.rb b/integration/tests/user_scenario/basic_workflow/single_env_purge_unmanaged_modules.rb index a1412dab2..94b0ed235 100755 --- a/integration/tests/user_scenario/basic_workflow/single_env_purge_unmanaged_modules.rb +++ b/integration/tests/user_scenario/basic_workflow/single_env_purge_unmanaged_modules.rb @@ -43,9 +43,6 @@ class { 'motd': end #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - step 'Checkout "production" Branch' git_on(master, 'checkout production', git_remote_environments_path) diff --git a/integration/tests/user_scenario/basic_workflow/single_env_switch_forge_git_module.rb b/integration/tests/user_scenario/basic_workflow/single_env_switch_forge_git_module.rb index f3e47fcf5..d4540bab2 100755 --- a/integration/tests/user_scenario/basic_workflow/single_env_switch_forge_git_module.rb +++ b/integration/tests/user_scenario/basic_workflow/single_env_switch_forge_git_module.rb @@ -57,9 +57,6 @@ class { 'motd': end #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - step 'Checkout "production" Branch' git_on(master, 'checkout production', git_environments_path) diff --git a/integration/tests/user_scenario/basic_workflow/single_env_upgrade_forge_mod_revert_change.rb b/integration/tests/user_scenario/basic_workflow/single_env_upgrade_forge_mod_revert_change.rb index 6b6a37db8..e413657b4 100644 --- a/integration/tests/user_scenario/basic_workflow/single_env_upgrade_forge_mod_revert_change.rb +++ b/integration/tests/user_scenario/basic_workflow/single_env_upgrade_forge_mod_revert_change.rb @@ -60,9 +60,6 @@ class { 'motd': end #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - step 'Checkout "production" Branch' git_on(master, 'checkout production', git_environments_path) diff --git a/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb b/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb index 4657b0356..098527301 100755 --- a/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb +++ b/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb @@ -65,9 +65,6 @@ class helloworld { end #Setup -step 'Stub Forge on Master' -stub_forge_on(master) - initial_env_names.each do |env| if env == 'production' step "Checkout \"#{env}\" Branch"