Sha256: d97ff7eda03fd98c704e259fda90aa406e8266ba01c194a2fbebe473a401adab

Contents?: true

Size: 1.55 KB

Versions: 28

Compression:

Stored size: 1.55 KB

Contents

require 'git_utils'
require 'r10k_utils'
require 'master_manipulator'
test_name 'CODEMGMT-63 - C59258 - Attempt to Deploy Environment with Duplicate Module Names'

#Init
git_environments_path = '/root/environments'
last_commit = git_last_commit(master, git_environments_path)
r10k_fqp = get_r10k_fqp(master)

#Verification
deploy_str = %r[Deploying module /etc/puppetlabs/code/environments/production/modules/motd]

#File
puppet_file = <<-PUPPETFILE
mod "puppetlabs/motd"
mod "jeffmccune/motd"
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)

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 modules.', git_environments_path)

#Tests
step 'Attempt to Deploy via r10k'
on(master, "#{r10k_fqp} deploy environment -v -p", :acceptable_exit_codes => [0, 1]) do |result|
  expect_failure('Expected exit code to be wrong due to RK-101') do
    assert_equal(1, result.exit_code, "Expected command to indicate error with exit code")
  end

  expect_failure('Expected module to be deployed twice due to RK-101') do
    matches = result.stderr.scan(deploy_str)
    assert_equal(1, matches.size, "Expected motd module to be deployed once, but deployed #{matches.size}) times")
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
r10k-2.6.9 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.6.8 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.6.7 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.6.6 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.6.5 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.6.4 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.6.3 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.6.2 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.6.1 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.6.0 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.5.5 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.5.4 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.5.3 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.5.2 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.5.1 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.4.5 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.3.1 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.4.4 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.5.0 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb
r10k-2.4.3 integration/tests/user_scenario/basic_workflow/negative/neg_duplicate_module_names.rb