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
@@ -0,0 +1,61 @@
1
+ require 'git_utils'
2
+ require 'r10k_utils'
3
+ require 'master_manipulator'
4
+ test_name 'RK-110 - C87651 - Specify a proxy in an environment variable'
5
+
6
+ confine(:to, :platform => ['el', 'sles'])
7
+
8
+ #Init
9
+ master_platform = fact_on(master, 'osfamily')
10
+ r10k_fqp = get_r10k_fqp(master)
11
+
12
+ case master_platform
13
+ when 'RedHat'
14
+ pkg_manager = 'yum'
15
+ when 'Suse'
16
+ pkg_manager = 'zypper'
17
+ end
18
+
19
+ install_squid = "#{pkg_manager} install -y squid"
20
+ remove_squid = "#{pkg_manager} remove -y squid"
21
+ squid_log = "/var/log/squid/access.log"
22
+
23
+ #Verification
24
+ squid_log_regex = /CONNECT forgeapi.puppetlabs.com:443/
25
+
26
+ #Teardown
27
+ teardown do
28
+ step 'Remove puppetfile'
29
+ on(master, 'rm -rf modules/')
30
+ on(master, 'rm Puppetfile')
31
+
32
+ step 'Remove Squid'
33
+ on(master, puppet("apply -e 'service {'squid' : ensure => stopped}'"))
34
+ on(master, remove_squid)
35
+
36
+ step 'Remove proxy environment variable'
37
+ master.delete_env_var('http_proxy', "http://#{master.hostname}:3128")
38
+ end
39
+
40
+ step 'Install and configure squid proxy'
41
+ on(master, install_squid)
42
+ master.add_env_var('http_proxy', "http://#{master.hostname}:3128")
43
+
44
+ step 'turn off the firewall'
45
+ on(master, puppet("apply -e 'service {'iptables' : ensure => stopped}'"))
46
+
47
+ step 'start squid proxy'
48
+ on(master, puppet("apply -e 'service {'squid' : ensure => running}'"))
49
+
50
+ #Tests
51
+ step 'make a puppetfile'
52
+ create_remote_file(master, "Puppetfile", 'mod "puppetlabs/motd"')
53
+
54
+ step 'Use a r10k puppetfile'
55
+ on(master, "#{r10k_fqp} puppetfile install")
56
+
57
+ step 'Read the squid logs'
58
+ on(master, "cat #{squid_log}") do |result|
59
+ assert_match(squid_log_regex, result.stdout, 'Proxy logs did not indicate use of the proxy.')
60
+ end
61
+
@@ -16,6 +16,7 @@ end
16
16
  master_platform = fact_on(master, 'osfamily')
17
17
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
18
18
  env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
19
+ r10k_fqp = get_r10k_fqp(master)
19
20
 
20
21
  git_repo_path = '/git_repos'
21
22
  git_control_remote = 'git@github.com:puppetlabs/codemgmt-92.git'
@@ -95,7 +96,7 @@ end
95
96
 
96
97
  #Tests
97
98
  step 'Deploy "production" Environment via r10k'
98
- on(master, 'r10k deploy environment -v')
99
+ on(master, "#{r10k_fqp} deploy environment -v")
99
100
 
100
101
  agents.each do |agent|
101
102
  step "Run Puppet Agent"
@@ -16,6 +16,7 @@ end
16
16
  master_platform = fact_on(master, 'osfamily')
17
17
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
18
18
  env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
19
+ r10k_fqp = get_r10k_fqp(master)
19
20
 
20
21
  git_repo_path = '/git_repos'
21
22
  git_repo_name = 'environments'
@@ -96,7 +97,7 @@ end
96
97
 
97
98
  #Tests
98
99
  step 'Deploy "production" Environment via r10k'
99
- on(master, 'r10k deploy environment -v')
100
+ on(master, "#{r10k_fqp} deploy environment -v")
100
101
 
101
102
  agents.each do |agent|
102
103
  step "Run Puppet Agent"
@@ -7,6 +7,7 @@ test_name 'CODEMGMT-90 - C62419 - Deploy Environment without Module Update'
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
9
  prod_env_path = File.join(environment_path, 'production')
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)
@@ -58,14 +59,14 @@ step 'Push Changes'
58
59
  git_add_commit_push(master, 'production', 'Update site.pp and add module.', git_environments_path)
59
60
 
60
61
  step 'Deploy "production" Environment via r10k with modules'
61
- on(master, 'r10k deploy environment -p -v')
62
+ on(master, "#{r10k_fqp} deploy environment -p -v")
62
63
 
63
64
  step 'Corrupt MOTD Manifest'
64
65
  create_remote_file(master, motd_module_init_pp_path, 'Broken')
65
66
 
66
67
  #Tests
67
68
  step 'Deploy "production" Environment via r10k without module update'
68
- on(master, 'r10k deploy environment -v')
69
+ on(master, "#{r10k_fqp} deploy environment -v")
69
70
 
70
71
  agents.each do |agent|
71
72
  step "Run Puppet Agent"
@@ -7,6 +7,7 @@ test_name 'CODEMGMT-90 - C62418 - Deploy Environment with Module Update'
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
9
  prod_env_path = File.join(environment_path, 'production')
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)
@@ -59,14 +60,14 @@ step 'Push Changes'
59
60
  git_add_commit_push(master, 'production', 'Update site.pp and add module.', git_environments_path)
60
61
 
61
62
  step 'Deploy "production" Environment via r10k with modules'
62
- on(master, 'r10k deploy environment -p -v')
63
+ on(master, "#{r10k_fqp} deploy environment -p -v")
63
64
 
64
65
  step 'Corrupt MOTD Manifest'
65
66
  create_remote_file(master, motd_module_init_pp_path, 'Broken')
66
67
 
67
68
  #Tests
68
69
  step 'Deploy "production" Environment via r10k with module update'
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"
@@ -6,6 +6,7 @@ test_name 'CODEMGMT-90 - C63461 - Specify Invalid Command-line Deployment Flag'
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
12
  error_message_regex = /deploy: illegal option/
@@ -17,6 +18,6 @@ end
17
18
 
18
19
  #Tests
19
20
  step 'Attempt to Deploy via r10k'
20
- on(master, 'r10k deploy -w environment -v', :acceptable_exit_codes => 1) do |result|
21
+ on(master, "#{r10k_fqp} deploy -w environment -v", :acceptable_exit_codes => 1) do |result|
21
22
  assert_match(error_message_regex, result.stderr, 'Expected message not found!')
22
23
  end
@@ -6,6 +6,7 @@ test_name 'CODEMGMT-90 - C63462 - Specify Invalid Command-line Environment Flag'
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
12
  error_message_regex = /environment: illegal option/
@@ -17,6 +18,6 @@ end
17
18
 
18
19
  #Tests
19
20
  step 'Attempt to Deploy via r10k'
20
- on(master, 'r10k deploy environment -x', :acceptable_exit_codes => 1) do |result|
21
+ on(master, "#{r10k_fqp} deploy environment -x", :acceptable_exit_codes => 1) do |result|
21
22
  assert_match(error_message_regex, result.stderr, 'Expected message not found!')
22
23
  end
@@ -6,6 +6,7 @@ test_name 'CODEMGMT-90 - C62420 - Invalid Command Line Argument'
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
12
  error_message_regex = /error/
@@ -17,8 +18,6 @@ end
17
18
 
18
19
  #Tests
19
20
  step 'Attempt to Deploy via r10k'
20
- on(master, 'r10k deploy environment NONEXISTENTENV -v', :acceptable_exit_codes => [0, 1, 2]) do |result|
21
- expect_failure('expected to fail due to RK-21') do
22
- assert_match(/error/, result.stderr.downcase, 'Expected message not found!')
23
- end
21
+ on(master, "#{r10k_fqp} deploy environment NONEXISTENTENV -v", :acceptable_exit_codes => 1) do |result|
22
+ assert_match(/error/, result.stderr.downcase, 'Expected message not found!')
24
23
  end
@@ -12,6 +12,7 @@ end
12
12
  #Init
13
13
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
14
14
  env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
15
+ r10k_fqp = get_r10k_fqp(master)
15
16
 
16
17
  git_control_remote = 'git://localhost/environments.git'
17
18
  git_environments_path = '/root/environments'
@@ -93,7 +94,11 @@ step 'Update the "r10k" Config'
93
94
  create_remote_file(master, r10k_config_path, r10k_conf)
94
95
 
95
96
  step 'Install "puppetlabs-xinetd" Module'
96
- on(master, puppet('module install puppetlabs-xinetd --modulepath /opt/puppet/share/puppet/modules'))
97
+ on(master, puppet('config print basemodulepath')) do |result|
98
+ (result.stdout.include? ':') ? separator = ':' : separator = ';'
99
+ @module_path = result.stdout.split(separator).first
100
+ end
101
+ on(master, puppet("module install puppetlabs-xinetd --modulepath #{@module_path}"))
97
102
 
98
103
  step 'Install and Configure "git-daemon" service'
99
104
  on(master, puppet('apply'), :stdin => git_daemon_xinetd_enable_manifest)
@@ -112,7 +117,7 @@ git_add_commit_push(master, 'production', 'Update site.pp and add module.', git_
112
117
 
113
118
  #Tests
114
119
  step 'Deploy "production" Environment via r10k'
115
- on(master, 'r10k deploy environment -v')
120
+ on(master, "#{r10k_fqp} deploy environment -v")
116
121
 
117
122
  agents.each do |agent|
118
123
  step "Run Puppet Agent"
@@ -7,6 +7,7 @@ test_name 'CODEMGMT-92 - C59234 - Single Git Source Using "SSH" Transport Protoc
7
7
  env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
8
8
  git_control_remote = 'git@github.com:puppetlabs/codemgmt-92.git'
9
9
  git_provider = ENV['GIT_PROVIDER'] || 'shellgit'
10
+ r10k_fqp = get_r10k_fqp(master)
10
11
 
11
12
  jenkins_key_path = File.file?("#{ENV['HOME']}/.ssh/id_rsa") ? "#{ENV['HOME']}/.ssh/id_rsa" : File.expand_path('~/.ssh/id_rsa-jenkins')
12
13
  ssh_private_key_path = '/root/.ssh/id_rsa-jenkins'
@@ -49,7 +50,7 @@ teardown do
49
50
  on(master, "rm -rf #{ssh_config_path}")
50
51
 
51
52
  step 'Restore Original "production" Environment via r10k'
52
- on(master, 'r10k deploy environment -v')
53
+ on(master, "#{r10k_fqp} deploy environment -v")
53
54
  end
54
55
 
55
56
  #Setup
@@ -73,7 +74,7 @@ on(master, "chmod 600 #{ssh_private_key_path}")
73
74
 
74
75
  #Tests
75
76
  step 'Deploy "production" Environment via r10k'
76
- on(master, 'r10k deploy environment -v')
77
+ on(master, "#{r10k_fqp} deploy environment -v")
77
78
 
78
79
  agents.each do |agent|
79
80
  step "Run Puppet Agent"
@@ -12,6 +12,7 @@ git_repo_module_path = File.join(git_repo_module_parent_path, "#{git_repo_module
12
12
  git_clone_module_path = '/root/helloworld_module'
13
13
  git_environments_path = '/root/environments'
14
14
  last_commit = git_last_commit(master, git_environments_path)
15
+ r10k_fqp = get_r10k_fqp(master)
15
16
 
16
17
  local_files_root_path = ENV['FILES'] || 'files'
17
18
  helloworld_module_path = File.join(local_files_root_path, 'modules', 'helloworld')
@@ -56,7 +57,7 @@ git_add_commit_push(master, 'production', 'Update site.pp.', git_environments_pa
56
57
 
57
58
  #Tests
58
59
  step 'Deploy "production" Environment via r10k'
59
- on(master, 'r10k deploy environment -v')
60
+ on(master, "#{r10k_fqp} deploy environment -v")
60
61
 
61
62
  agents.each do |agent|
62
63
  step "Run Puppet Agent"
@@ -8,6 +8,7 @@ test_name 'CODEMGMT-101 - C59261 - Attempt to Deploy Environment with Broken Git
8
8
  git_control_remote = '/git_repos/environments.git'
9
9
  prod_branch_head_ref_path = File.join(git_control_remote, 'refs', 'heads', 'production')
10
10
  prod_branch_head_ref_path_backup = '/tmp/production.bak'
11
+ r10k_fqp = get_r10k_fqp(master)
11
12
 
12
13
  invalid_sha_ref = Digest::SHA1.hexdigest('broken')
13
14
 
@@ -30,7 +31,7 @@ on(master, "chmod 644 #{prod_branch_head_ref_path}")
30
31
 
31
32
  #Tests
32
33
  step 'Attempt to Deploy via r10k'
33
- on(master, 'r10k deploy environment -v -t', :acceptable_exit_codes => [0,1]) do |result|
34
+ on(master, "#{r10k_fqp} deploy environment -v -t", :acceptable_exit_codes => [0,1]) do |result|
34
35
  expect_failure('Expected to fail due to RK-28') do
35
36
  assert_match(error_message_regex, result.stderr, 'Expected message not found!')
36
37
  end
@@ -7,6 +7,7 @@ test_name 'CODEMGMT-101 - C59236 - Attempt to Deploy Environment with Unauthoriz
7
7
  env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
8
8
  git_control_remote = 'https://bad:user@github.com/puppetlabs/codemgmt-92.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
@@ -8,6 +8,7 @@ test_name 'CODEMGMT-101 - C59237 - Attempt to Deploy Environment with Unauthoriz
8
8
  env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
9
9
  git_control_remote = 'git@github.com:puppetlabs/codemgmt-92.git'
10
10
  git_provider = ENV['GIT_PROVIDER'] || 'shellgit'
11
+ r10k_fqp = get_r10k_fqp(master)
11
12
 
12
13
  unauthorized_rsa_key = OpenSSL::PKey::RSA.new(2048)
13
14
  ssh_private_key_path = '/root/.ssh/unauthorized_key'
@@ -67,6 +68,6 @@ on(master, "chmod 600 #{ssh_private_key_path}")
67
68
 
68
69
  #Tests
69
70
  step 'Attempt to Deploy via r10k'
70
- on(master, 'r10k deploy environment -v', :acceptable_exit_codes => 1) do |result|
71
+ on(master, "#{r10k_fqp} deploy environment -v", :acceptable_exit_codes => 1) do |result|
71
72
  assert_match(error_message_regex, result.stderr, 'Expected message not found!')
72
73
  end
@@ -6,6 +6,7 @@ test_name 'CODEMGMT-101 - C59231 - Attempt to Deploy Environment from Git Source
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
  unicode_env = "\uAD62\uCC63\uC0C3\uBEE7\uBE23\uB7E9\uC715\uCEFE\uBF90\uAE69"
11
12
 
@@ -27,7 +28,7 @@ git_push(master, unicode_env, git_environments_path)
27
28
 
28
29
  #Tests
29
30
  step 'Attempt to Deploy via r10k'
30
- on(master, 'r10k deploy environment -v -t', :acceptable_exit_codes => 0) do |result|
31
+ on(master, "#{r10k_fqp} deploy environment -v -t", :acceptable_exit_codes => [0,1]) do |result|
31
32
  expect_failure('Expected to fail due to RK-29') do
32
33
  assert_match(error_message_regex, result.stderr, 'Expected message not found!')
33
34
  end
@@ -2,19 +2,19 @@ require 'securerandom'
2
2
  require 'git_utils'
3
3
  require 'r10k_utils'
4
4
  require 'master_manipulator'
5
- test_name 'CODEMGMT-62 - C59241 - Single Source with 1,000 Branches'
5
+ test_name 'CODEMGMT-62 - C59241 - Single Source with 100 Branches'
6
6
 
7
7
  #Init
8
8
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
9
9
  confdir_path = on(master, puppet('config', 'print', 'confdir')).stdout.rstrip
10
10
  modules_path = File.join(confdir_path, 'modules')
11
+ r10k_fqp = get_r10k_fqp(master)
11
12
 
12
13
  git_environments_path = '/root/environments'
13
14
  last_commit = git_last_commit(master, git_environments_path)
14
15
  local_files_root_path = ENV['FILES'] || 'files'
15
16
  helloworld_module_path = File.join(local_files_root_path, 'modules', 'helloworld')
16
17
 
17
- #Because of CODEMGMT-64 we can only support 100 branches currently.
18
18
  env_names = (0 ... 100).to_a.map!{ |x| x > 0 ? SecureRandom.uuid.gsub(/-/,"") * 3 : 'production'}
19
19
 
20
20
  #Manifest
@@ -52,7 +52,7 @@ end
52
52
 
53
53
  #Tests
54
54
  step 'Deploy Environments via r10k'
55
- on(master, 'r10k deploy environment -v')
55
+ on(master, "#{r10k_fqp} deploy environment -v")
56
56
 
57
57
  #Select three environments at random and verify results.
58
58
  env_names.sample(3).each do |env|
@@ -7,6 +7,7 @@ test_name 'CODEMGMT-73 - C59226 - Multiple Environments with Custom, Forge and G
7
7
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
8
8
  confdir_path = on(master, puppet('config', 'print', 'confdir')).stdout.rstrip
9
9
  modules_path = File.join(confdir_path, '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)
@@ -91,7 +92,7 @@ end
91
92
 
92
93
  #Tests
93
94
  step 'Deploy Environments via r10k'
94
- on(master, 'r10k deploy environment -v -p')
95
+ on(master, "#{r10k_fqp} deploy environment -v -p")
95
96
 
96
97
  env_names.each do |env|
97
98
  agents.each do |agent|
@@ -5,8 +5,12 @@ test_name 'CODEMGMT-40 - C59223 - Multiple Environments with Custom, Forge and G
5
5
 
6
6
  #Init
7
7
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
8
- confdir_path = on(master, puppet('config', 'print', 'confdir')).stdout.rstrip
9
- modules_path = File.join(confdir_path, 'modules')
8
+ r10k_fqp = get_r10k_fqp(master)
9
+ step 'Read module path'
10
+ on(master, puppet('config print basemodulepath')) do |result|
11
+ (result.stdout.include? ':') ? separator = ':' : separator = ';'
12
+ @module_path = result.stdout.split(separator).first
13
+ end
10
14
 
11
15
  git_environments_path = '/root/environments'
12
16
  last_commit = git_last_commit(master, git_environments_path)
@@ -24,7 +28,7 @@ stdlib_notify_message_regex = /The test message is:.*one.*=>.*1.*two.*=>.*bats.*
24
28
 
25
29
  #File
26
30
  puppet_file = <<-PUPPETFILE
27
- moduledir '#{modules_path}'
31
+ moduledir '#{@module_path}'
28
32
  mod "puppetlabs/motd"
29
33
  mod 'puppetlabs/stdlib',
30
34
  :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
@@ -57,7 +61,7 @@ teardown do
57
61
  on(agents, "rm -rf #{motd_path}")
58
62
 
59
63
  step 'Remove Static Modules'
60
- on(agents, "rm -rf #{modules_path}/*")
64
+ on(agents, "rm -rf #{@module_path}/*")
61
65
  end
62
66
 
63
67
  #Setup
@@ -94,7 +98,7 @@ git_add_commit_push(master, 'production', 'Add module.', git_environments_path)
94
98
 
95
99
  #Tests
96
100
  step 'Deploy Environments via r10k'
97
- on(master, 'r10k deploy environment -v -p')
101
+ on(master, "#{r10k_fqp} deploy environment -v -p")
98
102
 
99
103
  env_names.each do |env|
100
104
  agents.each do |agent|
@@ -3,18 +3,25 @@ require 'r10k_utils'
3
3
  require 'master_manipulator'
4
4
  test_name 'CODEMGMT-102 - C63192 - Multiple Environments with Hiera Data'
5
5
 
6
+ skip_test('This test is blocked by RK-136')
7
+
6
8
  #Init
7
9
  master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
8
10
 
9
11
  git_environments_path = '/root/environments'
10
12
  last_commit = git_last_commit(master, git_environments_path)
13
+ r10k_fqp = get_r10k_fqp(master)
11
14
 
12
15
  local_files_root_path = ENV['FILES'] || 'files'
13
16
  hieratest_module_path = File.join(local_files_root_path, 'modules', 'hieratest')
14
17
 
15
18
  hiera_local_config_path = File.join(local_files_root_path, 'hiera.yaml')
16
19
  hiera_master_config_path = on(master, puppet('config', 'print', 'hiera_config')).stdout.rstrip
17
- hiera_data_dir = File.join(git_environments_path, 'hiera')
20
+ if get_puppet_version(master) < 4.0
21
+ hiera_data_dir = File.join(git_environments_path, 'hiera')
22
+ else
23
+ hiera_data_dir = File.join(git_environments_path, 'hieradata')
24
+ end
18
25
 
19
26
  site_pp_path = File.join(git_environments_path, 'manifests', 'site.pp')
20
27
  site_pp = create_site_pp(master_certname, ' include hieratest')
@@ -80,7 +87,7 @@ restart_puppet_server(master)
80
87
 
81
88
  #Tests
82
89
  step 'Deploy Environments via r10k'
83
- on(master, 'r10k deploy environment -v')
90
+ on(master, "#{r10k_fqp} deploy environment -v")
84
91
 
85
92
  env_names.each do |env|
86
93
  agents.each do |agent|