simp-rake-helpers 5.11.2 → 5.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +43 -0
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +5 -1
- data/README.md +1 -1
- data/lib/simp/command_utils.rb +21 -0
- data/lib/simp/componentinfo.rb +17 -0
- data/lib/simp/local_gpg_signing_key.rb +184 -81
- data/lib/simp/rake.rb +3 -10
- data/lib/simp/rake/build/build.rb +43 -27
- data/lib/simp/rake/build/constants.rb +5 -1
- data/lib/simp/rake/build/pkg.rb +167 -51
- data/lib/simp/rake/build/tar.rb +1 -1
- data/lib/simp/rake/helpers/version.rb +1 -1
- data/lib/simp/rake/pkg.rb +5 -1
- data/lib/simp/rake/pupmod/helpers.rb +2 -0
- data/lib/simp/rake/rubygem.rb +5 -1
- data/lib/simp/relchecks.rb +1 -1
- data/lib/simp/rpm.rb +13 -125
- data/lib/simp/rpm_signer.rb +321 -0
- data/spec/acceptance/00_pkg_rpm_custom_scriptlets_spec.rb +18 -19
- data/spec/acceptance/10_pkg_rpm_spec.rb +46 -48
- data/spec/acceptance/50_local_gpg_signing_key_spec.rb +7 -3
- data/spec/acceptance/55_build_pkg_signing_spec.rb +293 -42
- data/spec/acceptance/files/testpackage/README +8 -0
- data/spec/acceptance/files/testpackage/spec/classes/init_spec.rb +1 -0
- data/spec/acceptance/files/testpackage/spec/files/mock_something.rb +3 -0
- data/spec/acceptance/files/testpackage/utils/convert_v1_to_v2.rb +3 -0
- data/spec/acceptance/nodesets/default.yml +34 -109
- data/spec/acceptance/support/build_project_helpers.rb +32 -8
- data/spec/lib/simp/ci/gitlab_spec.rb +12 -13
- data/spec/lib/simp/command_utils_spec.rb +29 -0
- data/spec/lib/simp/componentinfo_spec.rb +10 -4
- data/spec/lib/simp/local_gpg_signing_key_spec.rb.beaker-only +115 -18
- data/spec/lib/simp/rake/build/helpers_spec.rb +3 -0
- data/spec/lib/simp/rake/build/rpmdeps_spec.rb +1 -2
- data/spec/lib/simp/rake/pupmod/fixtures/othermod/Gemfile +1 -10
- data/spec/lib/simp/rake/pupmod/fixtures/simpmod/README.md +2 -2
- data/spec/lib/simp/rake_spec.rb +2 -1
- data/spec/lib/simp/relchecks_check_rpm_changelog_spec.rb +20 -10
- data/spec/lib/simp/relchecks_compare_latest_tag_spec.rb +18 -18
- data/spec/lib/simp/rpm_signer_spec.rb +98 -0
- data/spec/lib/simp/rpm_spec.rb +1 -7
- data/spec/spec_helper.rb +1 -1
- data/spec/spec_helper_acceptance.rb +16 -3
- metadata +13 -69
- data/.travis.yml +0 -60
- data/spec/acceptance/20_pkg_rpm_upgrade_spec.rb +0 -236
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-2.1/CHANGELOG +0 -2
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-2.1/Rakefile +0 -3
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-2.1/build/rpm_metadata/custom/overrides +0 -14
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-2.1/build/rpm_metadata/requires +0 -1
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-2.1/metadata.json +0 -33
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-3.0/CHANGELOG +0 -2
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-3.0/Rakefile +0 -3
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-3.0/build/rpm_metadata/custom/overrides +0 -14
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-3.0/build/rpm_metadata/requires +0 -1
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-new-package-3.0/metadata.json +0 -33
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-1.0/CHANGELOG +0 -2
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-1.0/Rakefile +0 -3
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-1.0/build/rpm_metadata/requires +0 -1
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-1.0/metadata.json +0 -33
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-2.0/CHANGELOG +0 -2
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-2.0/Rakefile +0 -3
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-2.0/build/rpm_metadata/requires +0 -1
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-2.0/metadata.json +0 -33
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-2.2/CHANGELOG +0 -2
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-2.2/Rakefile +0 -3
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-2.2/build/rpm_metadata/custom/overrides +0 -14
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-2.2/build/rpm_metadata/requires +0 -1
- data/spec/acceptance/files/custom_scriptlet_triggers/pupmod-old-package-2.2/metadata.json +0 -33
- data/spec/acceptance/files/mock_packages/pupmod-puppetlabs-stdlib.spec +0 -32
- data/spec/acceptance/files/mock_packages/pupmod-simp-foo.spec +0 -32
- data/spec/acceptance/files/mock_packages/pupmod-simp-simplib.spec +0 -32
- data/spec/acceptance/files/mock_packages/rpmbuild.sh +0 -25
- data/spec/acceptance/files/mock_packages/simp-adapter.spec +0 -43
- data/spec/acceptance/files/mock_packages/simp-adapter/etc/simp/adapter_config.yaml +0 -3
- data/spec/acceptance/files/mock_packages/simp-adapter/usr/local/sbin/simp_rpm_helper +0 -495
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-1.0/CHANGELOG +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-1.0/Rakefile +0 -3
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-1.0/build/rpm_metadata/requires +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-1.0/data/os/CentOS.yaml +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-1.0/data/os/RedHat.yaml +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-1.0/hiera.yaml +0 -14
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-1.0/manifests/init.pp +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-1.0/metadata.json +0 -37
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/CHANGELOG +0 -5
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/Rakefile +0 -3
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/build/rpm_metadata/requires +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/data/os/CentOS.yaml +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/data/os/RedHat.yaml +0 -2
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/hiera.yaml +0 -14
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/manifests/init.pp +0 -3
- data/spec/acceptance/files/package_upgrades/pupmod-simp-testpackage-2.0/metadata.json +0 -37
- data/spec/lib/simp/ci/files/job_broken_link_nodeset/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/job_invalid_nodeset/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/job_invalid_suite/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/job_missing_nodeset/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/job_missing_suite_and_nodeset/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/multiple_invalid_jobs/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/multiple_valid_jobs/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/no_gitlab_config_with_tests/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/no_gitlab_config_without_tests/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/suite_skeleton_only/spec/acceptance/nodesets/default.yml +0 -1
- data/spec/lib/simp/ci/files/suite_skeleton_only/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/valid_job_nodeset_dir_link/spec/acceptance/suites/default/nodesets +0 -1
- data/spec/lib/simp/ci/files/valid_job_nodeset_link/spec/acceptance/suites/default/nodesets/default.yml +0 -1
- data/spec/lib/simp/files/build/testpackage.spec +0 -1
- data/spec/lib/simp/rake/pupmod/fixtures/simpmod/spec/acceptance/nodesets/default.yml +0 -1
- data/spec/lib/simp/rake/pupmod/fixtures/simpmod/spec/acceptance/suites/default/nodesets +0 -1
data/.travis.yml
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
---
|
2
|
-
language: ruby
|
3
|
-
cache: bundler
|
4
|
-
sudo: false
|
5
|
-
|
6
|
-
bundler_args: --without development system_tests
|
7
|
-
|
8
|
-
notifications:
|
9
|
-
email: false
|
10
|
-
|
11
|
-
addons:
|
12
|
-
apt:
|
13
|
-
packages:
|
14
|
-
- rpm
|
15
|
-
# provides unbuffer
|
16
|
-
- expect-dev
|
17
|
-
|
18
|
-
before_install:
|
19
|
-
- rm -f Gemfile.lock
|
20
|
-
|
21
|
-
jobs:
|
22
|
-
include:
|
23
|
-
- stage: spec
|
24
|
-
rvm: 2.5.1
|
25
|
-
script:
|
26
|
-
- bundle exec rake spec
|
27
|
-
|
28
|
-
- stage: acceptance
|
29
|
-
sudo: required
|
30
|
-
rvm: 2.5.1
|
31
|
-
services:
|
32
|
-
- docker
|
33
|
-
script:
|
34
|
-
- travis_wait 90 unbuffer bundle exec rake acceptance
|
35
|
-
|
36
|
-
- stage: deploy
|
37
|
-
rvm: 2.5.1
|
38
|
-
if: 'fork = false AND tag IS present'
|
39
|
-
script:
|
40
|
-
- true
|
41
|
-
before_deploy:
|
42
|
-
- "export GEM_VERSION=`ruby -r ./lib/simp/rake/helpers/version.rb -e 'puts Simp::Rake::Helpers::VERSION'`"
|
43
|
-
- '[[ $TRAVIS_TAG =~ ^${GEM_VERSION}$ ]]'
|
44
|
-
deploy:
|
45
|
-
- provider: rubygems
|
46
|
-
gemspec: simp-rake-helpers.gemspec
|
47
|
-
gem: simp-rake-helpers
|
48
|
-
api_key:
|
49
|
-
secure: "aoPmOZ3WgjNJ56UXmamKxaRv37iUaxKekAeS8n2fPk78X/nU2qGjdDHFH+SBrfl33PyzsGnS3WAANMKaIkAgssvKoaII/sAC+Sl6q1eyVUprZqloXrG+cHlnHY4GnziWEH3JrkHDChW0xoJq7hhpj7qTRKrEIp6nA25MjozjveoL+HH4kKy/ACJhiEdsYTFaDLYYFY50gGUL9KjIkwN6g9d+dIzG9JqcYoDbneQlO6/23yr4GiAHQ8HM1j5tUoBqJad+CWjWhSY7pbfYBy2ziwVhFy1qoOS4/bhlasRCsLTtz0AjjR0YWOhJap1vJqYhrSxtvhmVuzScmDkueAem/PfWS3XCQvbmjdmFMzPOxo0aRRJMlaeVWRsZ/aVFC7ngpRzokq1duZEKI47xZC27vJSOp3RZMmYl/7GsykoYkqHHsTvzSALEQiVtQq8sIOtN0JOTFI8H4LSMirXuqGq+SgCJiAQ3mQzSgh50TXiZaA2UPPcQaw4AzY36BRKs1cgw3cEWuL38O2cWUTAzEE4SUh499wrU5x+N0PsYL0AvMFONsRaq5epOYrlIL9UPSL/qZRLmzpcEWZRfOX4Ni5N6Aa9ZR8juenR6UmE79S2dupBxQeinkdfXuWznUZH7BcnUDoz8rErABpJGHNVY60dUO/s055WCr7Y95Gi+H75X9/I="
|
50
|
-
on:
|
51
|
-
tags: true
|
52
|
-
rvm: 2.5.1
|
53
|
-
condition: '($SKIP_PUBLISH != true)'
|
54
|
-
- provider: releases
|
55
|
-
api_key:
|
56
|
-
secure: "QKvAL4yAk8u9prJT6dFzKvszJfoo5/R9jIJ/WEUwdH17jij9Q/XhNrUzJZnrdVtqq4yCK6UqGqkRMMn2YLOKthoJycLEXzH+ZeCxBwzyN6uQkLmK5Mx43H+NNCsRkYTmcOdi4wJraWaWVq7XBxz6XdNRUkV99WyIh93wVnTwZuJxvF9koDFq+lRR4qRPh5Xn8HjKEZNPY7QHaecqsyWjgdEILWaQk/32IU20dLCT7U3jDdSuk92p24gWlkvTJ/gP+IYKWEPhgMMpx+WAtGGC+djMyZUrkaKEa/ennkOcFgqJ6UtDEInEtTBFWScGL70dwHORbEVExp9AKcLP3TmMyQ/36ybu7yrgcp6L995tM4Huez3GBM6NJ8xl/hYG3D1QwwoXGnWfUjQW2we7h8gcvl2yUSx59pb2V5QW3nCbD8rAiF/kpAcgwWyBT3iLpMer2j0Ux05NCBGqsltl9J944M+pLtO+YKldUw7uGDWMQQzq8/2m5+MoE4fvTgnaJ0rv0eRLWfNH2RQ565mE95nyJC/wXz/XB2v/KKHrf8FQZRIavH4Nuo4E2+tU8u2APU/n+gP8iQrtd86Nlo5RrBTu+NoDPDrM5OBnVYTT/AUAEUggXTPgZsqwZrSDSBEt0VbExnwQ5QMGIB9ZX+ZunrEZ6NeH8hV5hm67WYZ+qRFOPvI="
|
57
|
-
on:
|
58
|
-
tags: true
|
59
|
-
rvm: 2.5.1
|
60
|
-
condition: '($SKIP_PUBLISH != true)'
|
@@ -1,236 +0,0 @@
|
|
1
|
-
require 'spec_helper_acceptance'
|
2
|
-
require_relative 'support/pkg_rpm_helpers'
|
3
|
-
|
4
|
-
require 'beaker/puppet_install_helper'
|
5
|
-
require 'json'
|
6
|
-
|
7
|
-
RSpec.configure do |c|
|
8
|
-
c.include Simp::BeakerHelpers::SimpRakeHelpers::PkgRpmHelpers
|
9
|
-
c.extend Simp::BeakerHelpers::SimpRakeHelpers::PkgRpmHelpers
|
10
|
-
end
|
11
|
-
|
12
|
-
# This tests RPM upgrade scenarios for components that use
|
13
|
-
# simp-adapter's simp_rpm_helper to copy files from the RPM install
|
14
|
-
# directory to a second destination directory
|
15
|
-
|
16
|
-
|
17
|
-
shared_examples_for 'RPM generator' do
|
18
|
-
it 'should create RPMs' do
|
19
|
-
testpackages.each do |package|
|
20
|
-
on host, %Q(#{run_cmd} "cd #{pkg_root_dir}/#{package}; ) +
|
21
|
-
%Q(rvm use default; bundle update --local || bundle update")
|
22
|
-
rpm_name = package.sub(/-[^-]+$/,'')
|
23
|
-
# In case previous tests haven't been clean
|
24
|
-
on host, "rpm -q #{rpm_name} && rpm -e #{rpm_name}; :"
|
25
|
-
|
26
|
-
on host, %(#{run_cmd} "cd #{pkg_root_dir}/#{package}; #{rake_cmd} pkg:rpm")
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
shared_examples_for 'an upgrade path that works safely with simp_rpm_helper' do |first_package_file, second_package_file|
|
32
|
-
let( :rpm_regex ) do
|
33
|
-
/^(?<name>pupmod-[a-z0-9_]+-[a-z0-9_]+)-(?<version>\d+\.\d+\.\d+)-(?<release>\d+)\..*\.rpm$/
|
34
|
-
end
|
35
|
-
|
36
|
-
let( :first_package_version ){ first_package_file.match(rpm_regex)['version'] }
|
37
|
-
let( :first_package_name ){ first_package_file.match(rpm_regex)['name'] }
|
38
|
-
let( :first_package_forge_name ){ first_package_name.sub(/^[^-]+-/,'') }
|
39
|
-
let( :first_package_module_name ){ first_package_forge_name.sub(/^[^-]+-/,'') }
|
40
|
-
let( :first_package_dir_name ){ first_package_name + '-' + first_package_version.sub(/\.\d+-\d+$/,'') }
|
41
|
-
|
42
|
-
let( :second_package_name ){ second_package_file.match(rpm_regex)['name'] }
|
43
|
-
let( :second_package_forge_name ){ second_package_name.sub(/^[^-]+-/,'') }
|
44
|
-
let( :second_package_module_name ){ second_package_forge_name.sub(/^[^-]+-/,'') }
|
45
|
-
let( :second_package_version ){ second_package_file.match(rpm_regex)['version'] }
|
46
|
-
let( :second_package_dir_name ){ second_package_name + '-' + second_package_version.sub(/\.\d+-\d+$/,'') }
|
47
|
-
|
48
|
-
context "When upgrading from #{first_package_file} to #{second_package_file}" do
|
49
|
-
it "should clean out any old installs" do
|
50
|
-
on host, "rpm -e #{first_package_name} &> /dev/null; " +
|
51
|
-
"rpm -e #{second_package_name} &> /dev/null ",
|
52
|
-
accept_all_exit_codes: true
|
53
|
-
end
|
54
|
-
|
55
|
-
it "should install #{first_package_file}" do
|
56
|
-
on host, "cd #{pkg_root_dir}/#{first_package_dir_name.gsub(/\.\d+$/,'')}; "+
|
57
|
-
"rpm -Uvh dist/#{first_package_file}"
|
58
|
-
end
|
59
|
-
|
60
|
-
it "should transfer contents of #{first_package_file} into the code directory" do
|
61
|
-
result = on host, "cat /opt/test/puppet/code/#{first_package_module_name}/metadata.json"
|
62
|
-
metadata = JSON.parse(result.stdout)
|
63
|
-
expect(metadata['name']).to eq first_package_forge_name
|
64
|
-
expect(metadata['version']).to eq first_package_version
|
65
|
-
|
66
|
-
# This verifies all files/dirs from the first package are copied
|
67
|
-
on host, "diff -r /usr/share/simp/modules/#{first_package_module_name} /opt/test/puppet/code/#{first_package_module_name}"
|
68
|
-
end
|
69
|
-
|
70
|
-
it "should upgrade to #{second_package_file}" do
|
71
|
-
on host, "cd #{pkg_root_dir}/#{second_package_dir_name.gsub(/\.\d+$/,'')}; rpm -Uvh dist/#{second_package_file}"
|
72
|
-
end
|
73
|
-
|
74
|
-
it "should transfer contents of #{second_package_file} into the code directory" do
|
75
|
-
result = on host, "cat /opt/test/puppet/code/#{second_package_module_name}/metadata.json"
|
76
|
-
metadata = JSON.parse(result.stdout)
|
77
|
-
expect(metadata['name']).to eq second_package_forge_name
|
78
|
-
expect(metadata['version']).to eq second_package_version
|
79
|
-
|
80
|
-
# This verifies all files/dirs from the second package are copied and
|
81
|
-
# no files/dirs onyn in the old package remain
|
82
|
-
on host, "diff -r /usr/share/simp/modules/#{second_package_module_name} /opt/test/puppet/code/#{second_package_module_name}"
|
83
|
-
end
|
84
|
-
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
describe 'rake pkg:rpm + component upgrade scenarios' do
|
89
|
-
|
90
|
-
before :all do
|
91
|
-
copy_host_files_into_build_user_homedir(hosts)
|
92
|
-
|
93
|
-
comment 'ensure the Puppet AIO is installed'
|
94
|
-
run_puppet_install_helper_on(hosts)
|
95
|
-
|
96
|
-
comment 'configure puppet agent to look like a Puppet server for simp_rpm_helper'
|
97
|
-
on hosts, '/opt/puppetlabs/bin/puppet config --section master set user root; ' +
|
98
|
-
'/opt/puppetlabs/bin/puppet config --section master set group root; ' +
|
99
|
-
'/opt/puppetlabs/bin/puppet config --section master set codedir /opt/test/puppet/code; ' +
|
100
|
-
'/opt/puppetlabs/bin/puppet config --section master set confdir /opt/test/puppet/code'
|
101
|
-
|
102
|
-
|
103
|
-
# TODO This mock simp-adapter has old functionality that corresponds to
|
104
|
-
# SIMP < 6.4.0 (i.e, a version that rsync's modules to a directory).
|
105
|
-
# Once SIMP 6.4.0 is released, we may want to update it to match that
|
106
|
-
# of the newer simp-adapter (i.e., the version that creates and updates
|
107
|
-
# local Git repositories). The tests that assume the copy behavior will
|
108
|
-
# have to be updated as well.
|
109
|
-
comment 'build and install mock RPMs'
|
110
|
-
mock_pkg_dir = '/home/build_user/host_files/spec/acceptance/files/mock_packages'
|
111
|
-
on hosts, %Q[#{run_cmd} "cd #{mock_pkg_dir}; rm -rf pkg"]
|
112
|
-
on hosts, %Q[#{run_cmd} "cd #{mock_pkg_dir}; bash rpmbuild.sh simp-adapter.spec"]
|
113
|
-
on hosts, %Q[#{run_cmd} "cd #{mock_pkg_dir}; bash rpmbuild.sh pupmod-puppetlabs-stdlib.spec"]
|
114
|
-
on hosts, %Q[#{run_cmd} "cd #{mock_pkg_dir}; bash rpmbuild.sh pupmod-simp-simplib.spec"]
|
115
|
-
on hosts, %Q[#{run_cmd} "cd #{mock_pkg_dir}; bash rpmbuild.sh pupmod-simp-foo.spec"]
|
116
|
-
|
117
|
-
on hosts, %Q[rpm -Uvh "#{mock_pkg_dir}/pkg/dist/*.noarch.rpm"], acceptable_exit_codes: [0,1]
|
118
|
-
end
|
119
|
-
|
120
|
-
hosts.each do |_host|
|
121
|
-
context "on #{_host}" do
|
122
|
-
let!(:host){ _host }
|
123
|
-
|
124
|
-
# This tests standard upgrades, which should
|
125
|
-
context 'with normal module RPM upgrades' do
|
126
|
-
let(:pkg_root_dir) do
|
127
|
-
'/home/build_user/host_files/spec/acceptance/files/package_upgrades'
|
128
|
-
end
|
129
|
-
|
130
|
-
let(:testpackages) do
|
131
|
-
[
|
132
|
-
'pupmod-simp-testpackage-1.0',
|
133
|
-
'pupmod-simp-testpackage-2.0',
|
134
|
-
]
|
135
|
-
end
|
136
|
-
|
137
|
-
context 'RPM build' do
|
138
|
-
it_should_behave_like('RPM generator')
|
139
|
-
end
|
140
|
-
|
141
|
-
context 'RPM upgrades' do
|
142
|
-
it_should_behave_like('an upgrade path that works safely with simp_rpm_helper',
|
143
|
-
'pupmod-simp-testpackage-1.0.0-0.noarch.rpm',
|
144
|
-
'pupmod-simp-testpackage-2.0.0-0.noarch.rpm')
|
145
|
-
end
|
146
|
-
|
147
|
-
context 'RPM erase' do
|
148
|
-
it 'should remove copied files on an erase' do
|
149
|
-
on host, 'rpm -e pupmod-simp-testpackage'
|
150
|
-
on host, 'ls /opt/test/puppet/code/testpackage', acceptable_exit_codes: [2]
|
151
|
-
end
|
152
|
-
end
|
153
|
-
|
154
|
-
context 'RPM transaction state directory' do
|
155
|
-
it 'should use /var/lib/rpm-state/simp-adapter for RPM state' do
|
156
|
-
on host, 'test -d /var/lib/rpm-state/simp-adapter'
|
157
|
-
end
|
158
|
-
|
159
|
-
it 'should not use /%{_localstatedir}/lib/rpm-state/simp-adapter for RPM state' do
|
160
|
-
on host, "test ! -d '/%{_localstatedir}/lib/rpm-state/simp-adapter'"
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
|
-
# These tests demonstrate custom RPM triggers that work around the obsolete
|
166
|
-
# module RPM upgrate + simp_rpm_helper problem described in SIMP-3895:
|
167
|
-
#
|
168
|
-
# https://simp-project.atlassian.net/browse/SIMP-3988
|
169
|
-
#
|
170
|
-
# The expected outcome is that simp_rpm_helper always ensures the correct
|
171
|
-
# content is installed after an upgrade, even during after a package has been
|
172
|
-
# obsoleted. This is accomplished via %triggerpostun -- <name of old package>
|
173
|
-
#
|
174
|
-
# old 1.0 -> old 2.0 = no need for a trigger
|
175
|
-
# old 1.0 -> new 2.0 = must re-run simp_rpm_helper
|
176
|
-
# old 1.0 -> new 3.0 = must re-run simp_rpm_helper
|
177
|
-
# old 2.0 -> new 2.0 = must re-run simp_rpm_helper
|
178
|
-
# old 2.0 -> new 3.0 = must re-run simp_rpm_helper
|
179
|
-
# new 2.0 -> new 3.0 = no need for a trigger
|
180
|
-
#
|
181
|
-
context 'with module RPMs that are susceptible to SIMP-3895' do
|
182
|
-
let(:pkg_root_dir) do
|
183
|
-
'/home/build_user/host_files/spec/acceptance/files/custom_scriptlet_triggers'
|
184
|
-
end
|
185
|
-
|
186
|
-
let(:testpackages) do
|
187
|
-
[
|
188
|
-
'pupmod-old-package-1.0',
|
189
|
-
'pupmod-old-package-2.0',
|
190
|
-
'pupmod-old-package-2.2',
|
191
|
-
'pupmod-new-package-2.1',
|
192
|
-
'pupmod-new-package-3.0',
|
193
|
-
]
|
194
|
-
end
|
195
|
-
|
196
|
-
context 'RPM build' do
|
197
|
-
it_should_behave_like('RPM generator')
|
198
|
-
end
|
199
|
-
|
200
|
-
context 'RPM upgrades' do
|
201
|
-
it_should_behave_like('an upgrade path that works safely with simp_rpm_helper',
|
202
|
-
'pupmod-old-package-1.0.0-0.noarch.rpm',
|
203
|
-
'pupmod-old-package-2.0.0-0.noarch.rpm')
|
204
|
-
|
205
|
-
it_should_behave_like('an upgrade path that works safely with simp_rpm_helper',
|
206
|
-
'pupmod-old-package-1.0.0-0.noarch.rpm',
|
207
|
-
'pupmod-new-package-2.1.0-0.noarch.rpm')
|
208
|
-
|
209
|
-
it_should_behave_like('an upgrade path that works safely with simp_rpm_helper',
|
210
|
-
'pupmod-new-package-2.1.0-0.noarch.rpm',
|
211
|
-
'pupmod-old-package-2.2.0-0.noarch.rpm')
|
212
|
-
|
213
|
-
it_should_behave_like('an upgrade path that works safely with simp_rpm_helper',
|
214
|
-
'pupmod-old-package-1.0.0-0.noarch.rpm',
|
215
|
-
'pupmod-new-package-3.0.0-0.noarch.rpm')
|
216
|
-
|
217
|
-
it_should_behave_like('an upgrade path that works safely with simp_rpm_helper',
|
218
|
-
'pupmod-old-package-2.0.0-0.noarch.rpm',
|
219
|
-
'pupmod-new-package-2.1.0-0.noarch.rpm')
|
220
|
-
|
221
|
-
it_should_behave_like('an upgrade path that works safely with simp_rpm_helper',
|
222
|
-
'pupmod-old-package-2.0.0-0.noarch.rpm',
|
223
|
-
'pupmod-new-package-3.0.0-0.noarch.rpm')
|
224
|
-
|
225
|
-
it_should_behave_like('an upgrade path that works safely with simp_rpm_helper',
|
226
|
-
'pupmod-old-package-2.2.0-0.noarch.rpm',
|
227
|
-
'pupmod-new-package-3.0.0-0.noarch.rpm')
|
228
|
-
|
229
|
-
it_should_behave_like('an upgrade path that works safely with simp_rpm_helper',
|
230
|
-
'pupmod-new-package-2.1.0-0.noarch.rpm',
|
231
|
-
'pupmod-new-package-3.0.0-0.noarch.rpm')
|
232
|
-
end
|
233
|
-
end
|
234
|
-
end
|
235
|
-
end
|
236
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
%triggerpostun -- pupmod-old-package
|
2
|
-
|
3
|
-
echo
|
4
|
-
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
|
5
|
-
echo "@@@@@@ Executing SIMP-3895 workaround @@@@@@"
|
6
|
-
echo "@@@@@@ @@@@@@"
|
7
|
-
echo "@@@@@@ upgrading from obsoleted pkg @@@@@@"
|
8
|
-
echo "@@@@@@ 'pupmod-old-package' @@@@@@"
|
9
|
-
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
|
10
|
-
echo
|
11
|
-
echo "pupmod-new-package: post 1=2 (triggered by: %triggerpostun -- pupmod-old-package)"
|
12
|
-
|
13
|
-
# re-send the 'post' message
|
14
|
-
/usr/local/sbin/simp_rpm_helper --rpm_dir=/usr/share/simp/modules/package --rpm_section='post' --rpm_status=2
|
@@ -1 +0,0 @@
|
|
1
|
-
Obsoletes: pupmod-old-package < 2.1.0
|
@@ -1,33 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "new-package",
|
3
|
-
"version": "2.1.0",
|
4
|
-
"author": "simp",
|
5
|
-
"summary": "A SIMP test module for upgrading obsoleted packages",
|
6
|
-
"license": "Apache-2.0",
|
7
|
-
"source": "https://github.com/simp/rubygem-simp-rake-helpers",
|
8
|
-
"project_page": "https://github.com/simp/rubygem-simp-rake-helpers",
|
9
|
-
"issues_url": "https://simp/project.atlassian.net",
|
10
|
-
"tags": [ "simp", "test", "package"],
|
11
|
-
"dependencies": [
|
12
|
-
{
|
13
|
-
"name": "simp/simplib",
|
14
|
-
"version_requirement": ">= 1.1.0"
|
15
|
-
}
|
16
|
-
],
|
17
|
-
"operatingsystem_support": [
|
18
|
-
{
|
19
|
-
"operatingsystem": "CentOS",
|
20
|
-
"operatingsystemrelease": [
|
21
|
-
"6",
|
22
|
-
"7"
|
23
|
-
]
|
24
|
-
},
|
25
|
-
{
|
26
|
-
"operatingsystem": "RedHat",
|
27
|
-
"operatingsystemrelease": [
|
28
|
-
"6",
|
29
|
-
"7"
|
30
|
-
]
|
31
|
-
}
|
32
|
-
]
|
33
|
-
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
%triggerpostun -- pupmod-old-package
|
2
|
-
|
3
|
-
echo
|
4
|
-
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
|
5
|
-
echo "@@@@@@ Executing SIMP-3895 workaround @@@@@@"
|
6
|
-
echo "@@@@@@ @@@@@@"
|
7
|
-
echo "@@@@@@ upgrading from obsoleted pkg @@@@@@"
|
8
|
-
echo "@@@@@@ 'pupmod-old-package' @@@@@@"
|
9
|
-
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
|
10
|
-
echo
|
11
|
-
echo "pupmod-new-package: post 1=2 (triggered by: %triggerpostun -- pupmod-old-package)"
|
12
|
-
|
13
|
-
# re-send the 'post' message
|
14
|
-
/usr/local/sbin/simp_rpm_helper --rpm_dir=/usr/share/simp/modules/package --rpm_section='post' --rpm_status=2
|
@@ -1 +0,0 @@
|
|
1
|
-
Obsoletes: pupmod-old-package < 3.0.0
|
@@ -1,33 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "new-package",
|
3
|
-
"version": "3.0.0",
|
4
|
-
"author": "simp",
|
5
|
-
"summary": "A SIMP test module for upgrading obsoleted packages",
|
6
|
-
"license": "Apache-2.0",
|
7
|
-
"source": "https://github.com/simp/rubygem-simp-rake-helpers",
|
8
|
-
"project_page": "https://github.com/simp/rubygem-simp-rake-helpers",
|
9
|
-
"issues_url": "https://simp/project.atlassian.net",
|
10
|
-
"tags": [ "simp", "test", "package"],
|
11
|
-
"dependencies": [
|
12
|
-
{
|
13
|
-
"name": "simp/simplib",
|
14
|
-
"version_requirement": ">= 1.1.0"
|
15
|
-
}
|
16
|
-
],
|
17
|
-
"operatingsystem_support": [
|
18
|
-
{
|
19
|
-
"operatingsystem": "CentOS",
|
20
|
-
"operatingsystemrelease": [
|
21
|
-
"6",
|
22
|
-
"7"
|
23
|
-
]
|
24
|
-
},
|
25
|
-
{
|
26
|
-
"operatingsystem": "RedHat",
|
27
|
-
"operatingsystemrelease": [
|
28
|
-
"6",
|
29
|
-
"7"
|
30
|
-
]
|
31
|
-
}
|
32
|
-
]
|
33
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
Requires: pupmod-simp-foo >= 1.2.3
|
@@ -1,33 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "old-package",
|
3
|
-
"version": "1.0.0",
|
4
|
-
"author": "simp",
|
5
|
-
"summary": "A SIMP test module for upgrading obsoleted packages",
|
6
|
-
"license": "Apache-2.0",
|
7
|
-
"source": "https://github.com/simp/rubygem-simp-rake-helpers",
|
8
|
-
"project_page": "https://github.com/simp/rubygem-simp-rake-helpers",
|
9
|
-
"issues_url": "https://simp/project.atlassian.net",
|
10
|
-
"tags": [ "simp", "test", "package"],
|
11
|
-
"dependencies": [
|
12
|
-
{
|
13
|
-
"name": "simp/simplib",
|
14
|
-
"version_requirement": ">= 1.1.0"
|
15
|
-
}
|
16
|
-
],
|
17
|
-
"operatingsystem_support": [
|
18
|
-
{
|
19
|
-
"operatingsystem": "CentOS",
|
20
|
-
"operatingsystemrelease": [
|
21
|
-
"6",
|
22
|
-
"7"
|
23
|
-
]
|
24
|
-
},
|
25
|
-
{
|
26
|
-
"operatingsystem": "RedHat",
|
27
|
-
"operatingsystemrelease": [
|
28
|
-
"6",
|
29
|
-
"7"
|
30
|
-
]
|
31
|
-
}
|
32
|
-
]
|
33
|
-
}
|