r10k 2.0.3 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG.mkd +150 -0
  3. data/README.mkd +10 -1
  4. data/doc/dynamic-environments/configuration.mkd +31 -0
  5. data/doc/dynamic-environments/quickstart.mkd +33 -79
  6. data/doc/faq.mkd +67 -0
  7. data/doc/git/providers.mkd +37 -0
  8. data/doc/puppetfile.mkd +73 -0
  9. data/integration/lib/r10k_utils.rb +47 -2
  10. data/integration/pre-suite/01_git_config.rb +9 -8
  11. data/integration/pre-suite/02_pe_r10k.rb +5 -8
  12. data/integration/scripts/setup_r10k_env_centos5.sh +1 -1
  13. data/integration/scripts/setup_r10k_env_centos6.sh +1 -1
  14. data/integration/scripts/setup_r10k_env_rhel7.sh +1 -1
  15. data/integration/scripts/setup_r10k_env_sles11.sh +1 -1
  16. data/integration/scripts/setup_r10k_env_sles12.sh +1 -1
  17. data/integration/scripts/setup_r10k_env_ubuntu1004.sh +1 -1
  18. data/integration/scripts/setup_r10k_env_ubuntu1204.sh +1 -1
  19. data/integration/scripts/setup_r10k_env_ubuntu1404.sh +1 -1
  20. data/integration/test_run_scripts/all_tests-rugged-pe-centos6.sh +1 -1
  21. data/integration/test_run_scripts/all_tests-rugged-pe-rhel7.sh +1 -1
  22. data/integration/test_run_scripts/all_tests-rugged-pe-sles11.sh +1 -1
  23. data/integration/test_run_scripts/all_tests-rugged-pe-ubuntu1204.sh +1 -1
  24. data/integration/test_run_scripts/all_tests-rugged-pe-ubuntu1404.sh +1 -1
  25. data/integration/test_run_scripts/all_tests-shellgit-pe-centos6.sh +1 -1
  26. data/integration/test_run_scripts/all_tests-shellgit-pe-rhel7.sh +1 -1
  27. data/integration/test_run_scripts/all_tests-shellgit-pe-sles11.sh +1 -1
  28. data/integration/test_run_scripts/all_tests-shellgit-pe-ubuntu1204.sh +1 -1
  29. data/integration/test_run_scripts/all_tests-shellgit-pe-ubuntu1404.sh +1 -1
  30. data/integration/test_run_scripts/basic_functionality/all_tests-pe-centos6.sh +1 -1
  31. data/integration/test_run_scripts/command_line/all_tests-pe-centos6.sh +1 -1
  32. data/integration/test_run_scripts/git_source/all_tests-pe-centos6.sh +1 -1
  33. data/integration/test_run_scripts/user_scenario/basic_workflow/all_tests-pe-centos6.sh +1 -1
  34. data/integration/test_run_scripts/user_scenario/complex_workflow/all_tests-pe-centos6.sh +1 -1
  35. data/integration/tests/basic_functionality/install_pe_only_module_with_puppetfile.rb +83 -0
  36. data/integration/tests/basic_functionality/negative/attempt_to_install_peonly_module_without_license.rb +71 -0
  37. data/integration/tests/basic_functionality/negative/neg_deploy_with_invalid_r10k_yaml.rb +7 -2
  38. data/integration/tests/basic_functionality/negative/neg_deploy_with_missing_r10k_yaml.rb +3 -2
  39. data/integration/tests/basic_functionality/negative/neg_invalid_git_provider.rb +3 -2
  40. data/integration/tests/basic_functionality/negative/negative_bad_proxy.rb +56 -0
  41. data/integration/tests/basic_functionality/proxy_specified_in_configuration.rb +103 -0
  42. data/integration/tests/basic_functionality/proxy_with_puppetfile.rb +61 -0
  43. data/integration/tests/basic_functionality/rugged_git_provider_with_ssh.rb +2 -1
  44. data/integration/tests/basic_functionality/rugged_git_provider_without_ssh.rb +2 -1
  45. data/integration/tests/command_line/deploy_env_without_mod_update.rb +3 -2
  46. data/integration/tests/command_line/negative/neg_deploy_env_with_module_update.rb +3 -2
  47. data/integration/tests/command_line/negative/neg_invalid_cli_dep_flag.rb +2 -1
  48. data/integration/tests/command_line/negative/neg_invalid_cli_env_flag.rb +2 -1
  49. data/integration/tests/command_line/negative/neg_invalid_cmd_line_arg.rb +3 -4
  50. data/integration/tests/git_source/git_source_git.rb +7 -2
  51. data/integration/tests/git_source/git_source_ssh.rb +3 -2
  52. data/integration/tests/git_source/git_source_submodule.rb +2 -1
  53. data/integration/tests/git_source/negative/neg_git_broken_remote.rb +2 -1
  54. data/integration/tests/git_source/negative/neg_git_unauthorized_https.rb +2 -1
  55. data/integration/tests/git_source/negative/neg_git_unauthorized_ssh.rb +2 -1
  56. data/integration/tests/git_source/negative/neg_git_unicode_branch.rb +2 -1
  57. data/integration/tests/user_scenario/basic_workflow/multi_env_1000_branches.rb +3 -3
  58. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module.rb +2 -1
  59. data/integration/tests/user_scenario/basic_workflow/multi_env_custom_forge_git_module_static.rb +9 -5
  60. data/integration/tests/user_scenario/basic_workflow/multi_env_hiera.rb +9 -2
  61. data/integration/tests/user_scenario/basic_workflow/multi_env_multi_source.rb +2 -1
  62. data/integration/tests/user_scenario/basic_workflow/multi_source_custom_forge_git_module.rb +2 -1
  63. data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_basedir.rb +2 -1
  64. data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_forge_module.rb +7 -2
  65. data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_module.rb +3 -4
  66. data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_module_ref.rb +2 -1
  67. data/integration/tests/user_scenario/basic_workflow/negative/neg_bad_git_remote.rb +2 -1
  68. data/integration/tests/user_scenario/basic_workflow/negative/neg_branch_name_collision.rb +2 -1
  69. data/integration/tests/user_scenario/basic_workflow/negative/neg_disk_full.rb +2 -1
  70. data/integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb +10 -4
  71. data/integration/tests/user_scenario/basic_workflow/negative/neg_inaccessible_forge.rb +9 -2
  72. data/integration/tests/user_scenario/basic_workflow/negative/neg_invalid_env_name.rb +2 -1
  73. data/integration/tests/user_scenario/basic_workflow/negative/neg_invalid_puppet_file.rb +2 -1
  74. data/integration/tests/user_scenario/basic_workflow/negative/neg_module_specified_at_deleted_release.rb +7 -2
  75. data/integration/tests/user_scenario/basic_workflow/negative/neg_read_only.rb +2 -1
  76. data/integration/tests/user_scenario/basic_workflow/negative/neg_specify_deleted_forge_module.rb +9 -2
  77. data/integration/tests/user_scenario/basic_workflow/single_env_10000_files.rb +2 -1
  78. data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_git_module.rb +2 -1
  79. data/integration/tests/user_scenario/basic_workflow/single_env_custom_forge_module.rb +2 -1
  80. data/integration/tests/user_scenario/basic_workflow/single_env_custom_module.rb +2 -1
  81. data/integration/tests/user_scenario/basic_workflow/single_env_large_files.rb +2 -1
  82. data/integration/tests/user_scenario/basic_workflow/single_env_module_already_installed.rb +2 -1
  83. data/integration/tests/user_scenario/basic_workflow/single_env_module_last_release_deleted.rb +2 -1
  84. data/integration/tests/user_scenario/basic_workflow/single_env_non-existent_base_dir.rb +2 -1
  85. data/integration/tests/user_scenario/basic_workflow/single_env_purge_unmanaged_modules.rb +3 -2
  86. data/integration/tests/user_scenario/basic_workflow/single_env_switch_forge_git_module.rb +3 -2
  87. data/integration/tests/user_scenario/basic_workflow/single_env_unicode_paths.rb +2 -1
  88. data/integration/tests/user_scenario/basic_workflow/single_env_upgrade_forge_mod_revert_change.rb +4 -3
  89. data/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb +3 -2
  90. data/integration/tests/user_scenario/complex_workflow/multi_env_remove_re-add.rb +4 -3
  91. data/integration/tests/user_scenario/complex_workflow/multi_env_unamanaged.rb +3 -2
  92. data/integration/tests/user_scenario/complex_workflow/single_env_git_module_update.rb +3 -2
  93. data/lib/r10k/action/base.rb +31 -0
  94. data/lib/r10k/action/deploy/deploy_helpers.rb +34 -0
  95. data/lib/r10k/action/deploy/display.rb +57 -75
  96. data/lib/r10k/action/deploy/environment.rb +52 -15
  97. data/lib/r10k/action/deploy/module.rb +13 -18
  98. data/lib/r10k/action/puppetfile/check.rb +8 -18
  99. data/lib/r10k/action/puppetfile/install.rb +13 -27
  100. data/lib/r10k/action/puppetfile/purge.rb +8 -17
  101. data/lib/r10k/action/runner.rb +39 -3
  102. data/lib/r10k/cli.rb +1 -3
  103. data/lib/r10k/cli/deploy.rb +3 -1
  104. data/lib/r10k/cli/puppetfile.rb +2 -2
  105. data/lib/r10k/deployment.rb +8 -6
  106. data/lib/r10k/deployment/config.rb +18 -65
  107. data/lib/r10k/environment/base.rb +19 -0
  108. data/lib/r10k/environment/git.rb +9 -0
  109. data/lib/r10k/environment/svn.rb +9 -0
  110. data/lib/r10k/forge/module_release.rb +21 -14
  111. data/lib/r10k/git.rb +6 -0
  112. data/lib/r10k/git/alternates.rb +20 -6
  113. data/lib/r10k/git/cache.rb +1 -1
  114. data/lib/r10k/git/rugged/bare_repository.rb +5 -0
  115. data/lib/r10k/git/rugged/base_repository.rb +6 -20
  116. data/lib/r10k/git/rugged/credentials.rb +66 -0
  117. data/lib/r10k/git/rugged/thin_repository.rb +16 -11
  118. data/lib/r10k/git/rugged/working_repository.rb +15 -7
  119. data/lib/r10k/git/shellgit/bare_repository.rb +9 -4
  120. data/lib/r10k/git/shellgit/thin_repository.rb +8 -10
  121. data/lib/r10k/git/stateful_repository.rb +1 -1
  122. data/lib/r10k/initializers.rb +55 -0
  123. data/lib/r10k/module.rb +1 -0
  124. data/lib/r10k/module/base.rb +3 -2
  125. data/lib/r10k/module/forge.rb +14 -6
  126. data/lib/r10k/module/local.rb +36 -0
  127. data/lib/r10k/module/metadata_file.rb +2 -2
  128. data/lib/r10k/puppetfile.rb +1 -1
  129. data/lib/r10k/settings.rb +86 -0
  130. data/lib/r10k/settings/collection.rb +118 -0
  131. data/lib/r10k/settings/definition.rb +112 -0
  132. data/lib/r10k/settings/enum_definition.rb +22 -0
  133. data/lib/r10k/settings/loader.rb +96 -0
  134. data/lib/r10k/settings/uri_definition.rb +19 -0
  135. data/lib/r10k/util/subprocess/runner/windows.rb +4 -4
  136. data/lib/r10k/version.rb +1 -1
  137. data/r10k.gemspec +2 -3
  138. data/spec/fixtures/unit/puppetfile/argument-error/Puppetfile +1 -0
  139. data/spec/fixtures/unit/util/subprocess/{posix/runner → runner}/no-execute.sh +0 -0
  140. data/spec/integration/git/rugged/thin_repository_spec.rb +2 -2
  141. data/spec/integration/git/rugged/working_repository_spec.rb +9 -0
  142. data/spec/integration/git/shellgit/thin_repository_spec.rb +2 -2
  143. data/spec/integration/git/stateful_repository_spec.rb +1 -1
  144. data/spec/r10k-mocks/mock_config.rb +10 -13
  145. data/spec/r10k-mocks/mock_env.rb +8 -0
  146. data/spec/shared-examples/deploy-actions.rb +69 -0
  147. data/spec/shared-examples/puppetfile-action.rb +17 -0
  148. data/spec/unit/action/cri_runner_spec.rb +3 -1
  149. data/spec/unit/action/deploy/deploy_helpers_spec.rb +38 -0
  150. data/spec/unit/action/deploy/display_spec.rb +31 -0
  151. data/spec/unit/action/deploy/environment_spec.rb +56 -0
  152. data/spec/unit/action/deploy/module_spec.rb +17 -0
  153. data/spec/unit/action/puppetfile/check_spec.rb +26 -0
  154. data/spec/unit/action/puppetfile/install_spec.rb +68 -0
  155. data/spec/unit/action/puppetfile/purge_spec.rb +19 -0
  156. data/spec/unit/action/runner_spec.rb +10 -9
  157. data/spec/unit/deployment/config_spec.rb +20 -44
  158. data/spec/unit/deployment_spec.rb +1 -1
  159. data/spec/unit/environment/git_spec.rb +20 -0
  160. data/spec/unit/environment/svn_spec.rb +20 -0
  161. data/spec/unit/forge/module_release_spec.rb +6 -3
  162. data/spec/unit/git/alternates_spec.rb +38 -12
  163. data/spec/unit/git/cache_spec.rb +4 -0
  164. data/spec/unit/git/rugged/credentials_spec.rb +74 -0
  165. data/spec/unit/initializers_spec.rb +68 -0
  166. data/spec/unit/module/base_spec.rb +2 -2
  167. data/spec/unit/module/forge_spec.rb +11 -3
  168. data/spec/unit/module/metadata_file_spec.rb +0 -1
  169. data/spec/unit/puppetfile_spec.rb +11 -0
  170. data/spec/unit/settings/collection_spec.rb +122 -0
  171. data/spec/unit/settings/definition_spec.rb +78 -0
  172. data/spec/unit/settings/enum_definition_spec.rb +20 -0
  173. data/spec/unit/{deployment/config → settings}/loader_spec.rb +50 -2
  174. data/spec/unit/settings/uri_definition_spec.rb +23 -0
  175. data/spec/unit/settings_spec.rb +151 -0
  176. data/spec/unit/util/subprocess/runner/posix_spec.rb +1 -1
  177. data/spec/unit/util/subprocess/runner/windows_spec.rb +7 -0
  178. metadata +53 -90
  179. data/lib/r10k/deployment/config/loader.rb +0 -59
  180. data/lib/shared/puppet/module_tool/metadata.rb +0 -197
  181. data/lib/shared/puppet_forge/connection.rb +0 -64
  182. data/lib/shared/puppet_forge/connection/connection_failure.rb +0 -26
  183. data/lib/shared/puppet_forge/error.rb +0 -41
  184. data/lib/shared/puppet_forge/tar.rb +0 -10
  185. data/lib/shared/puppet_forge/tar/mini.rb +0 -81
  186. data/lib/shared/puppet_forge/unpacker.rb +0 -68
  187. data/lib/shared/puppet_forge/v3.rb +0 -13
  188. data/lib/shared/puppet_forge/v3/module.rb +0 -69
  189. data/lib/shared/puppet_forge/v3/module_release.rb +0 -85
  190. data/lib/shared/puppet_forge/version.rb +0 -3
  191. data/spec/unit/puppet/module_tool/metadata_spec.rb +0 -301
  192. data/spec/unit/puppet_forge/connection/connection_failure_spec.rb +0 -28
  193. data/spec/unit/puppet_forge/connection_spec.rb +0 -41
  194. data/spec/unit/puppet_forge/tar/mini_spec.rb +0 -87
  195. data/spec/unit/puppet_forge/tar_spec.rb +0 -9
  196. data/spec/unit/puppet_forge/unpacker_spec.rb +0 -59
  197. data/spec/unit/puppet_forge/v3/module_release_spec.rb +0 -83
  198. data/spec/unit/puppet_forge/v3/module_spec.rb +0 -75
@@ -8,6 +8,7 @@ test_name 'CODEMGMT-85 - C59240 - Multiple Sources with Multiple Branches'
8
8
  #Init
9
9
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
10
10
  env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
11
+ r10k_fqp = get_r10k_fqp(master)
11
12
 
12
13
  git_provider = ENV['GIT_PROVIDER'] || 'shellgit'
13
14
 
@@ -116,7 +117,7 @@ end
116
117
 
117
118
  #Tests
118
119
  step 'Deploy Environments via r10k'
119
- on(master, 'r10k deploy environment -v')
120
+ on(master, "#{r10k_fqp} deploy environment -v")
120
121
 
121
122
  #Select three environments at random and verify results.
122
123
  sources.sample(3).each do |source|
@@ -6,6 +6,7 @@ test_name 'CODEMGMT-85 - C59227 - Multiple Environments with Multiple Sources an
6
6
  #Init
7
7
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
8
8
  env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
9
+ r10k_fqp = get_r10k_fqp(master)
9
10
 
10
11
  git_provider = ENV['GIT_PROVIDER'] || 'shellgit'
11
12
 
@@ -137,7 +138,7 @@ end
137
138
 
138
139
  #Tests
139
140
  step 'Deploy Environments via r10k'
140
- on(master, 'r10k deploy environment -v -p')
141
+ on(master, "#{r10k_fqp} deploy environment -v -p")
141
142
 
142
143
  agents.each do |agent|
143
144
  step 'Run Puppet Agent Against "production" Environment'
@@ -7,6 +7,7 @@ env_path = '/asuyiyuyabvusayd2784782gh8hexistasdfaiasdhfa78v87va8vajkb3vwkasv7as
7
7
  git_repo_path = '/git_repos'
8
8
  git_control_remote = File.join(git_repo_path, 'environments.git')
9
9
  git_provider = ENV['GIT_PROVIDER'] || 'shellgit'
10
+ r10k_fqp = get_r10k_fqp(master)
10
11
 
11
12
  r10k_config_path = get_r10k_config_file_path(master)
12
13
  r10k_config_bak_path = "#{r10k_config_path}.bak"
@@ -40,6 +41,6 @@ create_remote_file(master, r10k_config_path, r10k_conf)
40
41
 
41
42
  #Tests
42
43
  step 'Attempt to Deploy via r10k'
43
- on(master, 'r10k deploy environment -v', :acceptable_exit_codes => 1) do |result|
44
+ on(master, "#{r10k_fqp} deploy environment -v", :acceptable_exit_codes => 1) do |result|
44
45
  assert_match(error_message_regex, result.stderr, 'Expected message not found!')
45
46
  end
@@ -7,6 +7,7 @@ test_name 'CODEMGMT-42 - C59228 - Attempt to Deploy Environment with Non-existen
7
7
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
8
8
  git_environments_path = '/root/environments'
9
9
  last_commit = git_last_commit(master, git_environments_path)
10
+ r10k_fqp = get_r10k_fqp(master)
10
11
 
11
12
  #File
12
13
  puppet_file = <<-PUPPETFILE
@@ -16,7 +17,11 @@ PUPPETFILE
16
17
  puppet_file_path = File.join(git_environments_path, 'Puppetfile')
17
18
 
18
19
  #Verification
19
- error_message_regex = /Could not install 'puppetlabs-nothere'/
20
+ if get_puppet_version(master) < 4.0
21
+ error_message_regex = /Could not install 'puppetlabs-nothere'/
22
+ else
23
+ error_message_regex = /error.*The module puppetlabs-nothere does not exist on/i
24
+ end
20
25
 
21
26
  #Teardown
22
27
  teardown do
@@ -38,6 +43,6 @@ git_add_commit_push(master, 'production', 'Update Puppetfile.', git_environments
38
43
 
39
44
  #Tests
40
45
  step 'Attempt to Deploy via r10k'
41
- on(master, 'r10k deploy environment -v -p', :acceptable_exit_codes => 1) do |result|
46
+ on(master, "#{r10k_fqp} deploy environment -v -p", :acceptable_exit_codes => 1) do |result|
42
47
  assert_match(error_message_regex, result.stderr, 'Expected message not found!')
43
48
  end
@@ -11,6 +11,7 @@ end
11
11
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
12
12
  git_environments_path = '/root/environments'
13
13
  last_commit = git_last_commit(master, git_environments_path)
14
+ r10k_fqp = get_r10k_fqp(master)
14
15
 
15
16
  #File
16
17
  puppet_file = <<-PUPPETFILE
@@ -39,8 +40,6 @@ git_add_commit_push(master, 'production', 'Update Puppetfile.', git_environments
39
40
 
40
41
  #Tests
41
42
  step 'Attempt to Deploy via r10k'
42
- on(master, 'r10k deploy environment -v -p', :acceptable_exit_codes => 1) do |result|
43
- expect_failure('Expected to fail due to RK-80') do
44
- assert_no_match(error_message_regex, result.stderr, 'Expected message not found!')
45
- end
43
+ on(master, "#{r10k_fqp} deploy environment -v -p", :acceptable_exit_codes => 1) do |result|
44
+ assert_no_match(error_message_regex, result.stderr, 'Expected message not found!')
46
45
  end
@@ -7,6 +7,7 @@ test_name 'CODEMGMT-42 - C59230 - Attempt to Deploy Environment with Invalid Git
7
7
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
8
8
  git_environments_path = '/root/environments'
9
9
  last_commit = git_last_commit(master, git_environments_path)
10
+ r10k_fqp = get_r10k_fqp(master)
10
11
 
11
12
  #File
12
13
  puppet_file = <<-PUPPETFILE
@@ -37,6 +38,6 @@ git_add_commit_push(master, 'production', 'Update Puppetfile.', git_environments
37
38
 
38
39
  #Tests
39
40
  step 'Attempt to Deploy via r10k'
40
- on(master, 'r10k deploy environment -v -p', :acceptable_exit_codes => 1) do |result|
41
+ on(master, "#{r10k_fqp} deploy environment -v -p", :acceptable_exit_codes => 1) do |result|
41
42
  assert_match(error_message_regex, result.stderr, 'Expected message not found!')
42
43
  end
@@ -6,6 +6,7 @@ test_name 'CODEMGMT-42 - C59224 - Attempt to Deploy from Non-existent Git Remote
6
6
  env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
7
7
  git_control_remote = '/does/not/exist'
8
8
  git_provider = ENV['GIT_PROVIDER'] || 'shellgit'
9
+ r10k_fqp = get_r10k_fqp(master)
9
10
 
10
11
  r10k_config_path = get_r10k_config_file_path(master)
11
12
  r10k_config_bak_path = "#{r10k_config_path}.bak"
@@ -39,6 +40,6 @@ create_remote_file(master, r10k_config_path, r10k_conf)
39
40
 
40
41
  #Tests
41
42
  step 'Attempt to Deploy via r10k'
42
- on(master, 'r10k deploy environment', :acceptable_exit_codes => 1) do |result|
43
+ on(master, "#{r10k_fqp} deploy environment", :acceptable_exit_codes => 1) do |result|
43
44
  assert_match(error_message_regex, result.stderr, 'Expected message not found!')
44
45
  end
@@ -11,6 +11,7 @@ git_repo_name = 'environments'
11
11
  git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git")
12
12
  git_environments_path = File.join('/root', git_repo_name)
13
13
  git_provider = ENV['GIT_PROVIDER'] || 'shellgit'
14
+ r10k_fqp = get_r10k_fqp(master)
14
15
 
15
16
  git_alt_repo_path = '/git_repos_alt'
16
17
  git_alt_repo_name = 'environments_alt'
@@ -58,6 +59,6 @@ init_r10k_source_from_prod(master, git_alt_repo_path, git_alt_repo_name, git_alt
58
59
 
59
60
  #Tests
60
61
  step 'Attempt to Deploy via r10k'
61
- on(master, 'r10k deploy environment -v', :acceptable_exit_codes => 1) do |result|
62
+ on(master, "#{r10k_fqp} deploy environment -v", :acceptable_exit_codes => 1) do |result|
62
63
  assert_match(error_message_regex, result.stderr, 'Expected message not found!')
63
64
  end
@@ -13,6 +13,7 @@ git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git")
13
13
  git_environments_path = '/root/environments'
14
14
  last_commit = git_last_commit(master, git_environments_path)
15
15
  git_provider = ENV['GIT_PROVIDER'] || 'shellgit'
16
+ r10k_fqp = get_r10k_fqp(master)
16
17
 
17
18
  r10k_config_path = get_r10k_config_file_path(master)
18
19
  r10k_config_bak_path = "#{r10k_config_path}.bak"
@@ -72,6 +73,6 @@ git_add_commit_push(master, 'production', 'Add large file.', git_environments_pa
72
73
 
73
74
  #Tests
74
75
  step 'Attempt to Deploy via r10k'
75
- on(master, 'r10k deploy environment', :acceptable_exit_codes => 1) do |result|
76
+ on(master, "#{r10k_fqp} deploy environment", :acceptable_exit_codes => 1) do |result|
76
77
  assert_match(error_message_regex, result.stderr, 'Expected message not found!')
77
78
  end
@@ -6,9 +6,10 @@ test_name 'CODEMGMT-63 - C59258 - Attempt to Deploy Environment with Duplicate M
6
6
  #Init
7
7
  git_environments_path = '/root/environments'
8
8
  last_commit = git_last_commit(master, git_environments_path)
9
+ r10k_fqp = get_r10k_fqp(master)
9
10
 
10
11
  #Verification
11
- error_message_regex = /ERROR.*undefined method `full_module_name' for nil:NilClass/
12
+ deploy_str = %r[Deploying module /etc/puppetlabs/code/environments/production/modules/motd]
12
13
 
13
14
  #File
14
15
  puppet_file = <<-PUPPETFILE
@@ -38,8 +39,13 @@ git_add_commit_push(master, 'production', 'Add modules.', git_environments_path)
38
39
 
39
40
  #Tests
40
41
  step 'Attempt to Deploy via r10k'
41
- on(master, 'r10k deploy environment -v -p', :acceptable_exit_codes => 1) do |result|
42
- expect_failure('Expected to fail due to CODEMGMT-71') do
43
- assert_no_match(error_message_regex, result.stderr, 'Expected message not found!')
42
+ on(master, "#{r10k_fqp} deploy environment -v -p", :acceptable_exit_codes => [0, 1]) do |result|
43
+ expect_failure('Expected exit code to be wrong due to RK-101') do
44
+ assert_equal(1, result.exit_code, "Expected command to indicate error with exit code")
45
+ end
46
+
47
+ expect_failure('Expected module to be deployed twice due to RK-101') do
48
+ matches = result.stderr.scan(deploy_str)
49
+ assert_equal(1, matches.size, "Expected motd module to be deployed once, but deployed #{matches.size}) times")
44
50
  end
45
51
  end
@@ -7,6 +7,7 @@ test_name 'CODEMGMT-42 - C59256 - Attempt to Deploy Environment with Inaccessibl
7
7
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
8
8
  git_environments_path = '/root/environments'
9
9
  last_commit = git_last_commit(master, git_environments_path)
10
+ r10k_fqp = get_r10k_fqp(master)
10
11
 
11
12
  hosts_file_path = '/etc/hosts'
12
13
 
@@ -46,6 +47,12 @@ git_add_commit_push(master, 'production', 'Update Puppetfile.', git_environments
46
47
 
47
48
  #Tests
48
49
  step 'Attempt to Deploy via r10k'
49
- on(master, 'r10k deploy environment -v -p', :acceptable_exit_codes => 1) do |result|
50
- assert_match(error_message_regex, result.stderr, 'Expected message not found!')
50
+ on(master, "#{r10k_fqp} deploy environment -v -p", :acceptable_exit_codes => 1) do |result|
51
+ if get_puppet_version(master) > 4.0
52
+ expect_failure('expected to fail due to RK-134') do
53
+ assert_match(error_message_regex, result.stderr, 'Expected message not found!')
54
+ end
55
+ else
56
+ assert_match(error_message_regex, result.stderr, 'Expected message not found!')
57
+ end
51
58
  end
@@ -7,6 +7,7 @@ test_name 'CODEMGMT-63 - C62511 - Attempt to Deploy Environment Containing Inval
7
7
  git_environments_path = '/root/environments'
8
8
  last_commit = git_last_commit(master, git_environments_path)
9
9
  invalid_env_name = 'should-not-contain-dashes'
10
+ r10k_fqp = get_r10k_fqp(master)
10
11
 
11
12
  #Verification
12
13
  error_message_regex = /ERROR\]/
@@ -26,7 +27,7 @@ git_push(master, invalid_env_name, git_environments_path)
26
27
 
27
28
  #Tests
28
29
  step 'Attempt to Deploy via r10k'
29
- on(master, 'r10k deploy environment -v') do |result|
30
+ on(master, "#{r10k_fqp} deploy environment -v") do |result|
30
31
  expect_failure('Expected to fail due to CODEMGMT-65') do
31
32
  assert_match(error_message_regex, result.stderr, 'Expected message not found!')
32
33
  end
@@ -5,6 +5,7 @@ test_name 'CODEMGMT-86 - C63185 - Attempt to Deploy Environment with Invalid Pup
5
5
  #Init
6
6
  git_environments_path = '/root/environments'
7
7
  last_commit = git_last_commit(master, git_environments_path)
8
+ r10k_fqp = get_r10k_fqp(master)
8
9
 
9
10
  puppet_file_path = File.join(git_environments_path, 'Puppetfile')
10
11
 
@@ -30,6 +31,6 @@ git_add_commit_push(master, 'production', 'Update Puppetfile.', git_environments
30
31
 
31
32
  #Tests
32
33
  step 'Attempt to Deploy via r10k'
33
- on(master, 'r10k deploy environment -v -p', :acceptable_exit_codes => 1) do |result|
34
+ on(master, "#{r10k_fqp} deploy environment -v -p", :acceptable_exit_codes => 1) do |result|
34
35
  assert_match(error_message_regex, result.stderr, 'Expected message not found!')
35
36
  end
@@ -7,9 +7,14 @@ test_name 'CODEMGMT-127 - C64121 - Attempt to Deploy Environment with Forge Modu
7
7
  #Init
8
8
  git_environments_path = '/root/environments'
9
9
  last_commit = git_last_commit(master, git_environments_path)
10
+ r10k_fqp = get_r10k_fqp(master)
10
11
 
11
12
  #Verification
12
- error_notification_regex = /No releases matching '0.2.0'/
13
+ if get_puppet_version(master) < 4.0
14
+ error_notification_regex = /No releases matching '0.2.0'/
15
+ else
16
+ error_notification_regex = /error.* -> The module release puppetlabs-spotty-0.2.0 does not exist on/i
17
+ end
13
18
 
14
19
  #File
15
20
  puppet_file = <<-PUPPETFILE
@@ -39,6 +44,6 @@ git_add_commit_push(master, 'production', 'Add module.', git_environments_path)
39
44
 
40
45
  #Tests
41
46
  step "Deploy production environment via r10k with module specified at deleted version"
42
- on(master, 'r10k deploy environment -p -v', :acceptable_exit_codes => 1) do |result|
47
+ on(master, "#{r10k_fqp} deploy environment -p -v", :acceptable_exit_codes => 1) do |result|
43
48
  assert_match(error_notification_regex, result.stderr, 'Unexpected error was detected!')
44
49
  end
@@ -9,6 +9,7 @@ git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git")
9
9
  git_environments_path = '/root/environments'
10
10
  last_commit = git_last_commit(master, git_environments_path)
11
11
  git_provider = ENV['GIT_PROVIDER'] || 'shellgit'
12
+ r10k_fqp = get_r10k_fqp(master)
12
13
 
13
14
  r10k_config_path = get_r10k_config_file_path(master)
14
15
  r10k_config_bak_path = "#{r10k_config_path}.bak"
@@ -52,6 +53,6 @@ on(master, "mount -osize=10m,ro tmpfs #{tmpfs_path} -t tmpfs")
52
53
 
53
54
  #Tests
54
55
  step 'Attempt to Deploy via r10k'
55
- on(master, 'r10k deploy environment', :acceptable_exit_codes => 1) do |result|
56
+ on(master, "#{r10k_fqp} deploy environment", :acceptable_exit_codes => 1) do |result|
56
57
  assert_match(error_message_regex, result.stderr, 'Expected message not found!')
57
58
  end
@@ -7,6 +7,7 @@ test_name 'CODEMGMT-127 - C64288 - Attempt to Deploy Environment Specify Deleted
7
7
  #Init
8
8
  git_environments_path = '/root/environments'
9
9
  last_commit = git_last_commit(master, git_environments_path)
10
+ r10k_fqp = get_r10k_fqp(master)
10
11
 
11
12
  #Verification
12
13
  error_notification_regex = /Does 'puppetlabs-regret' have at least one published release?/
@@ -39,6 +40,12 @@ git_add_commit_push(master, 'production', 'Add module.', git_environments_path)
39
40
 
40
41
  #Tests
41
42
  step "Deploy production environment via r10k with specified module deleted"
42
- on(master, 'r10k deploy environment -p -v', :acceptable_exit_codes => 1) do |result|
43
- assert_match(error_notification_regex, result.stderr, 'Unexpected error was detected!')
43
+ on(master, "#{r10k_fqp} deploy environment -p -v", :acceptable_exit_codes => 1) do |result|
44
+ if get_puppet_version(master) < 4.0
45
+ assert_match(error_notification_regex, result.stderr, 'Unexpected error was detected!')
46
+ else
47
+ expect_failure('expected to fail due to RK-135') do
48
+ assert_match(error_notification_regex, result.stderr, 'Unexpected error was detected!')
49
+ end
50
+ end
44
51
  end
@@ -11,6 +11,7 @@ end
11
11
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
12
12
  environment_path = on(master, puppet('config', 'print', 'environmentpath')).stdout.rstrip
13
13
  prod_env_path = File.join(environment_path, 'production')
14
+ r10k_fqp = get_r10k_fqp(master)
14
15
 
15
16
  git_environments_path = '/root/environments'
16
17
  last_commit = git_last_commit(master, git_environments_path)
@@ -63,7 +64,7 @@ git_add_commit_push(master, 'production', 'Update site.pp and add module.', git_
63
64
 
64
65
  #Tests
65
66
  step 'Deploy "production" Environment via r10k'
66
- on(master, 'r10k deploy environment -v')
67
+ on(master, "#{r10k_fqp} deploy environment -v")
67
68
 
68
69
  step 'Verify Files in "production" Environment'
69
70
  on(master, "cd #{prod_env_test_files_path};md5sum -c #{prod_env_checksum_file_path}")
@@ -9,6 +9,7 @@ git_environments_path = '/root/environments'
9
9
  last_commit = git_last_commit(master, git_environments_path)
10
10
  local_files_root_path = ENV['FILES'] || 'files'
11
11
  helloworld_module_path = File.join(local_files_root_path, 'modules', 'helloworld')
12
+ r10k_fqp = get_r10k_fqp(master)
12
13
 
13
14
  #Verification
14
15
  motd_path = '/etc/motd'
@@ -82,7 +83,7 @@ git_add_commit_push(master, 'production', 'Update site.pp and add modules.', git
82
83
 
83
84
  #Tests
84
85
  step 'Deploy "production" Environment via r10k'
85
- on(master, 'r10k deploy environment -v -p')
86
+ on(master, "#{r10k_fqp} deploy environment -v -p")
86
87
 
87
88
  agents.each do |agent|
88
89
  step "Run Puppet Agent"
@@ -9,6 +9,7 @@ git_environments_path = '/root/environments'
9
9
  last_commit = git_last_commit(master, git_environments_path)
10
10
  local_files_root_path = ENV['FILES'] || 'files'
11
11
  helloworld_module_path = File.join(local_files_root_path, 'modules', 'helloworld')
12
+ r10k_fqp = get_r10k_fqp(master)
12
13
 
13
14
  #Verification
14
15
  motd_path = '/etc/motd'
@@ -64,7 +65,7 @@ git_add_commit_push(master, 'production', 'Update site.pp and add modules.', git
64
65
 
65
66
  #Tests
66
67
  step 'Deploy "production" Environment via r10k'
67
- on(master, 'r10k deploy environment -v -p')
68
+ on(master, "#{r10k_fqp} deploy environment -v -p")
68
69
 
69
70
  agents.each do |agent|
70
71
  step "Run Puppet Agent"
@@ -9,6 +9,7 @@ git_environments_path = '/root/environments'
9
9
  last_commit = git_last_commit(master, git_environments_path)
10
10
  local_files_root_path = ENV['FILES'] || 'files'
11
11
  helloworld_module_path = File.join(local_files_root_path, 'modules', 'helloworld')
12
+ r10k_fqp = get_r10k_fqp(master)
12
13
 
13
14
  #Manifest
14
15
  site_pp_path = File.join(git_environments_path, 'manifests', 'site.pp')
@@ -37,7 +38,7 @@ git_add_commit_push(master, 'production', 'Update site.pp and add module.', git_
37
38
 
38
39
  #Tests
39
40
  step 'Deploy "production" Environment via r10k'
40
- on(master, 'r10k deploy environment -v')
41
+ on(master, "#{r10k_fqp} deploy environment -v")
41
42
 
42
43
  agents.each do |agent|
43
44
  step "Run Puppet Agent"
@@ -11,6 +11,7 @@ end
11
11
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
12
12
  environment_path = on(master, puppet('config', 'print', 'environmentpath')).stdout.rstrip
13
13
  prod_env_path = File.join(environment_path, 'production')
14
+ r10k_fqp = get_r10k_fqp(master)
14
15
 
15
16
  git_environments_path = '/root/environments'
16
17
  last_commit = git_last_commit(master, git_environments_path)
@@ -63,7 +64,7 @@ git_add_commit_push(master, 'production', 'Update site.pp and add module.', git_
63
64
 
64
65
  #Tests
65
66
  step 'Deploy "production" Environment via r10k'
66
- on(master, 'r10k deploy environment -v')
67
+ on(master, "#{r10k_fqp} deploy environment -v")
67
68
 
68
69
  step 'Verify Files in "production" Environment'
69
70
  on(master, "cd #{prod_env_test_files_path};md5sum -c #{prod_env_checksum_file_path}")
@@ -6,6 +6,7 @@ test_name 'CODEMGMT-117 - C63601 - Single Environment Specify Module that is Alr
6
6
  #Init
7
7
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
8
8
  environment_path = on(master, puppet('config', 'print', 'environmentpath')).stdout.rstrip
9
+ r10k_fqp = get_r10k_fqp(master)
9
10
 
10
11
  git_environments_path = '/root/environments'
11
12
  last_commit = git_last_commit(master, git_environments_path)
@@ -66,7 +67,7 @@ git_add_commit_push(master, 'production', 'Update site.pp and add module.', git_
66
67
 
67
68
  #Tests
68
69
  step 'Deploy "production" Environment via r10k with modules'
69
- on(master, 'r10k deploy environment -p -v')
70
+ on(master, "#{r10k_fqp} deploy environment -p -v")
70
71
 
71
72
  agents.each do |agent|
72
73
  step "Run Puppet Agent"
@@ -7,6 +7,7 @@ test_name 'CODEMGMT-127 - C64120 - Single Environment with Forge Module where La
7
7
  #Init
8
8
  env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
9
9
  prod_env_modules_path = File.join(env_path, 'production', 'modules')
10
+ r10k_fqp = get_r10k_fqp(master)
10
11
 
11
12
  git_environments_path = '/root/environments'
12
13
  last_commit = git_last_commit(master, git_environments_path)
@@ -47,7 +48,7 @@ git_add_commit_push(master, 'production', 'Add module.', git_environments_path)
47
48
 
48
49
  #Tests
49
50
  step 'Deploy "production" Environment via r10k with modules'
50
- on(master, 'r10k deploy environment -p -v')
51
+ on(master, "#{r10k_fqp} deploy environment -p -v")
51
52
 
52
53
  agents.each do |agent|
53
54
  step "Run Puppet Agent"
@@ -7,6 +7,7 @@ test_name 'CODEMGMT-62 - C62387 - Single Environment Deployed to Non-existent Ba
7
7
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
8
8
  original_env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
9
9
  env_path = '/tmp/puppet/temp/environments'
10
+ r10k_fqp = get_r10k_fqp(master)
10
11
 
11
12
  git_environments_path = '/root/environments'
12
13
  git_repo_path = '/git_repos'
@@ -82,7 +83,7 @@ git_add_commit_push(master, 'production', 'Update site.pp and add module.', git_
82
83
 
83
84
  #Tests
84
85
  step 'Deploy "production" Environment via r10k'
85
- on(master, 'r10k deploy environment -v')
86
+ on(master, "#{r10k_fqp} deploy environment -v")
86
87
 
87
88
  agents.each do |agent|
88
89
  step "Run Puppet Agent"