Sha256: 25005db99c817d6ee3ff22034343f6da8a3c503459c6849eadffde86b1e5babf

Contents?: true

Size: 1.67 KB

Versions: 5

Compression:

Stored size: 1.67 KB

Contents

require 'git_utils'
require 'r10k_utils'
require 'master_manipulator'
test_name 'CODEMGMT-22 - C59118 - Single Environment with Custom Module'

#Init
master_certname = on(master, puppet('config', 'print', 'certname')).stdout.rstrip
git_environments_path = '/root/environments'
last_commit = git_last_commit(master, git_environments_path)
local_files_root_path = ENV['FILES'] || 'files'
helloworld_module_path = File.join(local_files_root_path, 'modules', 'helloworld')

#Manifest
site_pp_path = File.join(git_environments_path, 'manifests', 'site.pp')
site_pp = create_site_pp(master_certname, '  include helloworld')

#Verification
notify_message_regex = /I am in the production environment/

#Teardown
teardown do
  clean_up_r10k(master, last_commit, git_environments_path)
end

#Setup
step 'Checkout "production" Branch'
git_on(master, 'checkout production', git_environments_path)

step 'Copy "helloworld" Module to "production" Environment Git Repo'
scp_to(master, helloworld_module_path, File.join(git_environments_path, "site", 'helloworld'))

step 'Inject New "site.pp" to the "production" Environment'
inject_site_pp(master, site_pp_path, site_pp)

step 'Push Changes'
git_add_commit_push(master, 'production', 'Update site.pp and add module.', git_environments_path)

#Tests
step 'Deploy "production" Environment via r10k'
on(master, 'r10k deploy environment -v')

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
r10k-2.0.3 integration/tests/user_scenario/basic_workflow/single_env_custom_module.rb
r10k-2.0.2 integration/tests/user_scenario/basic_workflow/single_env_custom_module.rb
r10k-2.0.1 integration/tests/user_scenario/basic_workflow/single_env_custom_module.rb
r10k-2.0.0 integration/tests/user_scenario/basic_workflow/single_env_custom_module.rb
r10k-1.5.1 integration/tests/user_scenario/basic_workflow/single_env_custom_module.rb