simp-rake-helpers 5.11.6 → 5.12.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +49 -0
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +0 -3
- data/README.md +3 -38
- data/Rakefile +2 -3
- data/lib/simp/command_utils.rb +21 -0
- data/lib/simp/local_gpg_signing_key.rb +128 -79
- data/lib/simp/rake/build/auto.rb +4 -2
- data/lib/simp/rake/build/build.rb +5 -4
- data/lib/simp/rake/build/iso.rb +57 -31
- data/lib/simp/rake/build/pkg.rb +118 -56
- data/lib/simp/rake/build/spec.rb +1 -1
- data/lib/simp/rake/build/tar.rb +1 -1
- data/lib/simp/rake/build/unpack.rb +1 -1
- data/lib/simp/rake/build/upload.rb +1 -1
- data/lib/simp/rake/build/vermap.yaml +1 -1
- data/lib/simp/rake/helpers/assets/rpm_spec/simp6.spec +3 -3
- data/lib/simp/rake/helpers/assets/rpm_spec/simpdefault.spec +3 -3
- data/lib/simp/rake/helpers/version.rb +1 -1
- data/lib/simp/rake/helpers.rb +2 -2
- 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/rake.rb +3 -17
- data/lib/simp/rpm.rb +10 -127
- data/lib/simp/rpm_signer.rb +321 -0
- data/spec/acceptance/nodesets/default.yml +0 -3
- data/spec/acceptance/{00_pkg_rpm_custom_scriptlets_spec.rb → suites/default/00_pkg_rpm_custom_scriptlets_spec.rb} +21 -22
- data/spec/acceptance/{10_pkg_rpm_spec.rb → suites/default/10_pkg_rpm_spec.rb} +50 -52
- data/spec/acceptance/{30_pkg_misc_spec.rb → suites/default/30_pkg_misc_spec.rb} +1 -1
- data/spec/acceptance/{50_local_gpg_signing_key_spec.rb → suites/default/50_local_gpg_signing_key_spec.rb} +7 -3
- data/spec/acceptance/suites/default/55_build_pkg_signing_spec.rb +391 -0
- data/spec/acceptance/{development → suites/default/development}/docker_env.sh +0 -0
- data/spec/acceptance/{development → suites/default/development}/rerun_acceptance_tests.sh +0 -0
- data/spec/acceptance/{development → suites/default/development}/vagrant_rsync.sh +0 -0
- data/spec/acceptance/{files → suites/default/files}/asset/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/asset/build/asset.spec +0 -0
- data/spec/acceptance/{files → suites/default/files}/asset_with_misordered_entries/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/asset_with_misordered_entries/build/asset_with_misordered_entries.spec +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/RPM-GPG-KEY-SIMP-Dev +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/gengpgkey +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/pubring.gpg +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/random_seed +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/run_gpg_agent +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/secring.gpg +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/pkg/gpg-keydir.expired.2018-04-06/trustdb.gpg +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/Puppetfile.tracking +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/README.md +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/build/project_skeleton/src/assets/simp/build/simp.spec +0 -0
- data/spec/acceptance/{files → suites/default/files}/module/CHANGELOG +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-new-package-2.1 → suites/default/files/module}/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/module/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/module_with_misordered_entries/CHANGELOG +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-new-package-3.0 → suites/default/files/module_with_misordered_entries}/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/module_with_misordered_entries/metadata.json +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-new-package-2.1 → suites/default/files/simplib}/CHANGELOG +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-1.0 → suites/default/files/simplib}/Rakefile +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-1.0 → suites/default/files/simplib}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/simplib/metadata.json +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-new-package-3.0 → suites/default/files/testpackage}/CHANGELOG +0 -0
- data/spec/acceptance/suites/default/files/testpackage/README +8 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-2.0 → suites/default/files/testpackage}/Rakefile +0 -0
- data/spec/acceptance/{files/package_upgrades/pupmod-simp-testpackage-1.0 → suites/default/files/testpackage}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage/metadata.json +0 -0
- data/spec/acceptance/suites/default/files/testpackage/spec/classes/init_spec.rb +1 -0
- data/spec/acceptance/suites/default/files/testpackage/spec/files/mock_something.rb +3 -0
- data/spec/acceptance/suites/default/files/testpackage/utils/convert_v1_to_v2.rb +3 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-1.0 → suites/default/files/testpackage_custom_scriptlet}/CHANGELOG +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-2.2 → suites/default/files/testpackage_custom_scriptlet}/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_custom_scriptlet/build/rpm_metadata/custom/overrides +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-2.0 → suites/default/files/testpackage_custom_scriptlet}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_custom_scriptlet/metadata.json +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-2.0 → suites/default/files/testpackage_missing_license}/CHANGELOG +0 -0
- data/spec/acceptance/{files/module → suites/default/files/testpackage_missing_license}/Rakefile +0 -0
- data/spec/acceptance/{files/simplib → suites/default/files/testpackage_missing_license}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_license/metadata.json +0 -0
- data/spec/acceptance/{files/custom_scriptlet_triggers/pupmod-old-package-2.2 → suites/default/files/testpackage_missing_metadata_file}/CHANGELOG +0 -0
- data/spec/acceptance/{files/module_with_misordered_entries → suites/default/files/testpackage_missing_metadata_file}/Rakefile +0 -0
- data/spec/acceptance/{files/testpackage_custom_scriptlet → suites/default/files/testpackage_missing_metadata_file}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files/simplib → suites/default/files/testpackage_missing_name}/CHANGELOG +0 -0
- data/spec/acceptance/{files/package_upgrades/pupmod-simp-testpackage-1.0 → suites/default/files/testpackage_missing_name}/Rakefile +0 -0
- data/spec/acceptance/{files/testpackage_missing_license → suites/default/files/testpackage_missing_name}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_name/metadata.json +0 -0
- data/spec/acceptance/{files/testpackage → suites/default/files/testpackage_missing_source}/CHANGELOG +0 -0
- data/spec/acceptance/{files/package_upgrades/pupmod-simp-testpackage-2.0 → suites/default/files/testpackage_missing_source}/Rakefile +0 -0
- data/spec/acceptance/{files/testpackage_missing_metadata_file → suites/default/files/testpackage_missing_source}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_source/metadata.json +0 -0
- data/spec/acceptance/{files/testpackage_custom_scriptlet → suites/default/files/testpackage_missing_summary}/CHANGELOG +0 -0
- data/spec/acceptance/{files/simplib → suites/default/files/testpackage_missing_summary}/Rakefile +0 -0
- data/spec/acceptance/{files/testpackage_missing_name → suites/default/files/testpackage_missing_summary}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_summary/metadata.json +0 -0
- data/spec/acceptance/{files/testpackage_missing_license → suites/default/files/testpackage_missing_version}/CHANGELOG +0 -0
- data/spec/acceptance/{files/testpackage → suites/default/files/testpackage_missing_version}/Rakefile +0 -0
- data/spec/acceptance/{files/testpackage_missing_source → suites/default/files/testpackage_missing_version}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_missing_version/metadata.json +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_bad_changelog_date/CHANGELOG +0 -0
- data/spec/acceptance/{files/testpackage_custom_scriptlet → suites/default/files/testpackage_with_bad_changelog_date}/Rakefile +0 -0
- data/spec/acceptance/{files/testpackage_missing_summary → suites/default/files/testpackage_with_bad_changelog_date}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_bad_changelog_date/metadata.json +0 -0
- data/spec/acceptance/{files/testpackage_missing_metadata_file → suites/default/files/testpackage_with_release}/CHANGELOG +0 -0
- data/spec/acceptance/{files/testpackage_missing_license → suites/default/files/testpackage_with_release}/Rakefile +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_release/build/rpm_metadata/release +0 -0
- data/spec/acceptance/{files/testpackage_missing_version → suites/default/files/testpackage_with_release}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_with_release/metadata.json +0 -0
- data/spec/acceptance/{files/testpackage_missing_metadata_file → suites/default/files/testpackage_without_changelog}/Rakefile +0 -0
- data/spec/acceptance/{files/testpackage_with_bad_changelog_date → suites/default/files/testpackage_without_changelog}/build/rpm_metadata/requires +0 -0
- data/spec/acceptance/{files → suites/default/files}/testpackage_without_changelog/metadata.json +0 -0
- data/spec/acceptance/{support → suites/default/support}/build_project_helpers.rb +33 -9
- data/spec/acceptance/{support → suites/default/support}/build_user_helpers.rb +0 -0
- data/spec/acceptance/{support → suites/default/support}/pkg_rpm_helpers.rb +0 -0
- data/spec/lib/simp/command_utils_spec.rb +29 -0
- data/spec/lib/simp/local_gpg_signing_key_spec.rb.beaker-only +115 -18
- data/spec/lib/simp/rake/pupmod/fixtures/simpmod/README.md +2 -2
- data/spec/lib/simp/rpm_signer_spec.rb +98 -0
- data/spec/lib/simp/rpm_spec.rb +0 -6
- data/spec/spec_helper_acceptance.rb +4 -0
- metadata +92 -149
- data/.travis.yml +0 -41
- data/lib/simp/rake/helpers/assets/rpm_spec/simp4.spec +0 -388
- data/lib/simp/rake/helpers/assets/rpm_spec/simp5.spec +0 -388
- data/spec/acceptance/20_pkg_rpm_upgrade_spec.rb +0 -236
- data/spec/acceptance/55_build_pkg_signing_spec.rb +0 -140
- 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/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/metadata.json +0 -33
- 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/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/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/mock_packages/simp-adapter.spec +0 -43
- 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/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/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/acceptance/files/testpackage/build/rpm_metadata/requires +0 -2
- data/spec/acceptance/files/testpackage_missing_name/CHANGELOG +0 -2
- data/spec/acceptance/files/testpackage_missing_name/Rakefile +0 -3
- data/spec/acceptance/files/testpackage_missing_source/CHANGELOG +0 -2
- data/spec/acceptance/files/testpackage_missing_source/Rakefile +0 -3
- data/spec/acceptance/files/testpackage_missing_summary/CHANGELOG +0 -2
- data/spec/acceptance/files/testpackage_missing_summary/Rakefile +0 -3
- data/spec/acceptance/files/testpackage_missing_version/CHANGELOG +0 -2
- data/spec/acceptance/files/testpackage_missing_version/Rakefile +0 -3
- data/spec/acceptance/files/testpackage_with_bad_changelog_date/Rakefile +0 -3
- data/spec/acceptance/files/testpackage_with_release/CHANGELOG +0 -2
- data/spec/acceptance/files/testpackage_with_release/Rakefile +0 -3
- data/spec/acceptance/files/testpackage_with_release/build/rpm_metadata/requires +0 -1
- data/spec/acceptance/files/testpackage_without_changelog/Rakefile +0 -3
- data/spec/acceptance/files/testpackage_without_changelog/build/rpm_metadata/requires +0 -1
- 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
@@ -1,140 +0,0 @@
|
|
1
|
-
require 'spec_helper_acceptance'
|
2
|
-
require_relative 'support/build_user_helpers'
|
3
|
-
require_relative 'support/build_project_helpers'
|
4
|
-
|
5
|
-
RSpec.configure do |c|
|
6
|
-
c.include Simp::BeakerHelpers::SimpRakeHelpers::BuildUserHelpers
|
7
|
-
c.extend Simp::BeakerHelpers::SimpRakeHelpers::BuildUserHelpers
|
8
|
-
c.include Simp::BeakerHelpers::SimpRakeHelpers::BuildProjectHelpers
|
9
|
-
c.extend Simp::BeakerHelpers::SimpRakeHelpers::BuildProjectHelpers
|
10
|
-
end
|
11
|
-
|
12
|
-
describe 'rake pkg:signrpms' do
|
13
|
-
def opts
|
14
|
-
{ run_in_parallel: true, environment: { 'SIMP_PKG_verbose' => 'yes' } }
|
15
|
-
end
|
16
|
-
|
17
|
-
# Clean out RPMs dir and copy in a fresh dummy RPM
|
18
|
-
def prep_rpms_dir(rpms_dir, src_rpms, opts = {})
|
19
|
-
copy_cmds = src_rpms.map { |_rpm| "cp -a '#{_rpm}' '#{rpms_dir}'" }.join('; ')
|
20
|
-
on(hosts, %(#{run_cmd} "rm -f '#{rpms_dir}/*'; #{copy_cmds} "), opts)
|
21
|
-
end
|
22
|
-
|
23
|
-
# Provides a scaffolded test project and `let` variables
|
24
|
-
shared_context 'a freshly-scaffolded test project' do |dir|
|
25
|
-
opts = {}
|
26
|
-
test__dir = "#{build_user_homedir}/test--#{dir}"
|
27
|
-
rpms__dir = "#{test__dir}/test.rpms"
|
28
|
-
src__rpm = "#{build_user_host_files}/spec/lib/simp/files/testpackage-1-0.noarch.rpm"
|
29
|
-
host__dirs = {}
|
30
|
-
|
31
|
-
hosts.each do |host|
|
32
|
-
dist_dir = distribution_dir(host, test__dir, opts)
|
33
|
-
host__dirs[host] = {
|
34
|
-
test_dir: test__dir,
|
35
|
-
dev_keydir: "#{dist_dir}/build_keys/dev",
|
36
|
-
dvd_dir: "#{dist_dir}/DVD",
|
37
|
-
}
|
38
|
-
host__dirs[host.name] = host__dirs[host]
|
39
|
-
end
|
40
|
-
|
41
|
-
before(:all) do
|
42
|
-
# Scaffold a project skeleton
|
43
|
-
scaffold_build_project(hosts, test__dir, opts)
|
44
|
-
|
45
|
-
# Provide an RPM directory to process and a dummy RPM to sign
|
46
|
-
on(hosts, %(#{run_cmd} "mkdir '#{rpms__dir}'"))
|
47
|
-
|
48
|
-
# Ensure a DVD directory exists that is appropriate to each SUT
|
49
|
-
hosts.each do |host|
|
50
|
-
on(host, %(#{run_cmd} "mkdir -p '#{host__dirs[host][:dvd_dir]}'"), opts)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
let(:test_dir) { test__dir }
|
55
|
-
let(:rpms_dir) { rpms__dir }
|
56
|
-
let(:src_rpm) { src__rpm }
|
57
|
-
let(:test_rpm) { "#{rpms__dir}/#{File.basename(src__rpm)}" }
|
58
|
-
let(:dirs) { host__dirs }
|
59
|
-
end
|
60
|
-
|
61
|
-
let(:rpm_unsigned_regex) do
|
62
|
-
%r{^Signature\s+:\s+\(none\)$}
|
63
|
-
end
|
64
|
-
|
65
|
-
let(:rpm_signed_regex) do
|
66
|
-
%r{^Signature\s+:\s+.*,\s*Key ID (?<key_id>[0-9a-f]+)$}
|
67
|
-
end
|
68
|
-
|
69
|
-
let(:expired_keydir) do
|
70
|
-
"#{build_user_host_files}/spec/acceptance/files/build/pkg/gpg-keydir.expired.2018-04-06"
|
71
|
-
end
|
72
|
-
|
73
|
-
shared_examples 'it creates a new GPG dev signing key' do
|
74
|
-
it 'creates a new GPG dev signing key' do
|
75
|
-
on(hosts, %(#{run_cmd} "cd '#{test_dir}'; bundle exec rake pkg:signrpms[dev,'#{rpms_dir}']"), opts)
|
76
|
-
hosts.each do |host|
|
77
|
-
expect { dev_signing_key_id(host, test_dir, opts) }.not_to(raise_error)
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
shared_examples 'it begins with unsigned RPMs' do
|
83
|
-
it 'begins with unsigned RPMs' do
|
84
|
-
prep_rpms_dir(rpms_dir, [src_rpm], opts)
|
85
|
-
rpms_before_signing = on(hosts, %(#{run_cmd} "rpm -qip '#{test_rpm}' | grep ^Signature"), opts)
|
86
|
-
rpms_before_signing.each do |result|
|
87
|
-
expect(result.stdout).to match rpm_unsigned_regex
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
shared_examples 'it signs RPM packages in the directory using the GPG dev signing key' do
|
93
|
-
it 'signs RPM packages in the directory using the GPG dev signing key' do
|
94
|
-
on(hosts, %(#{run_cmd} "cd '#{test_dir}'; bundle exec rake pkg:signrpms[dev,'#{rpms_dir}']"), opts)
|
95
|
-
rpms_after_signing = on(hosts, %(#{run_cmd} "rpm -qip '#{test_rpm}' | grep ^Signature"), opts)
|
96
|
-
rpms_after_signing.each do |result|
|
97
|
-
host = hosts_with_name(hosts, result.host).first
|
98
|
-
on(host, "gpg --list-keys --homedir='#{dirs[host][:dev_keydir]}'", opts)
|
99
|
-
|
100
|
-
expect(result.stdout).to match rpm_signed_regex
|
101
|
-
signed_rpm_data = rpm_signed_regex.match(result.stdout)
|
102
|
-
expect(signed_rpm_data[:key_id]).to eql dev_signing_key_id(host, test_dir, opts)
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
describe 'when starting without a dev key' do
|
108
|
-
include_context('a freshly-scaffolded test project', 'pkg-signrpms')
|
109
|
-
include_examples('it creates a new GPG dev signing key')
|
110
|
-
include_examples('it begins with unsigned RPMs')
|
111
|
-
include_examples('it signs RPM packages in the directory using the GPG dev signing key')
|
112
|
-
|
113
|
-
context 'when there is an unexpired GPG dev signing key' do
|
114
|
-
include_examples('it begins with unsigned RPMs')
|
115
|
-
include_examples('it signs RPM packages in the directory using the GPG dev signing key')
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
describe 'when starting with an expired dev key' do
|
120
|
-
include_context('a freshly-scaffolded test project', 'pkg-signrpms-expired_dev_key')
|
121
|
-
|
122
|
-
it 'begins with an expired GPG signing key' do
|
123
|
-
prep_rpms_dir(rpms_dir, [src_rpm], opts)
|
124
|
-
hosts.each do |host|
|
125
|
-
copy_expired_keydir_to_dev_cmds = [
|
126
|
-
"mkdir -p '$(dirname '#{dirs[host][:dev_keydir]}')'",
|
127
|
-
"cp -aT '#{expired_keydir}' '#{dirs[host][:dev_keydir]}'",
|
128
|
-
"ls -lart '#{expired_keydir}'"
|
129
|
-
].join(' && ')
|
130
|
-
on(host, %(#{run_cmd} "#{copy_expired_keydir_to_dev_cmds}"), opts)
|
131
|
-
result = on(host, %(#{run_cmd} "gpg --list-keys --homedir='#{dirs[host][:dev_keydir]}'"), opts)
|
132
|
-
expect(result.stdout).to match(/expired: 2018-04-06/)
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
include_examples('it creates a new GPG dev signing key')
|
137
|
-
include_examples('it begins with unsigned RPMs')
|
138
|
-
include_examples('it signs RPM packages in the directory using the GPG dev signing key')
|
139
|
-
end
|
140
|
-
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,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
|
-
}
|
@@ -1,33 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "old-package",
|
3
|
-
"version": "2.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,14 +0,0 @@
|
|
1
|
-
%triggerpostun -- pupmod-new-package
|
2
|
-
|
3
|
-
echo
|
4
|
-
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
|
5
|
-
echo "@@@@@@ Executing SIMP-3895 workaround @@@@@@"
|
6
|
-
echo "@@@@@@ @@@@@@"
|
7
|
-
echo "@@@@@@ upgrading from obsoleted pkg @@@@@@"
|
8
|
-
echo "@@@@@@ 'pupmod-new-package' @@@@@@"
|
9
|
-
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
|
10
|
-
echo
|
11
|
-
echo "pupmod-old-package: post 1=2 (triggered by: %triggerpostun -- pupmod-new-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-new-package < 2.2.0
|
@@ -1,33 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "old-package",
|
3
|
-
"version": "2.2.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,32 +0,0 @@
|
|
1
|
-
Name: pupmod-puppetlabs-stdlib
|
2
|
-
Version: 5.9.9
|
3
|
-
Release: 9
|
4
|
-
Summary: mock simplib test package
|
5
|
-
BuildArch: noarch
|
6
|
-
|
7
|
-
License: Apache-2.0
|
8
|
-
URL: http://foo.bar
|
9
|
-
|
10
|
-
%description
|
11
|
-
A mock RPM package used for acceptance tests
|
12
|
-
|
13
|
-
%prep
|
14
|
-
exit 0
|
15
|
-
|
16
|
-
%build
|
17
|
-
exit 0
|
18
|
-
|
19
|
-
|
20
|
-
%install
|
21
|
-
exit 0
|
22
|
-
|
23
|
-
%clean
|
24
|
-
exit 0
|
25
|
-
|
26
|
-
%files
|
27
|
-
%doc
|
28
|
-
|
29
|
-
|
30
|
-
%changelog
|
31
|
-
* Fri Feb 23 2018 nobody
|
32
|
-
- some comment
|
@@ -1,32 +0,0 @@
|
|
1
|
-
Name: pupmod-simp-foo
|
2
|
-
Version: 1.9.9
|
3
|
-
Release: 9
|
4
|
-
Summary: mock foo test package
|
5
|
-
BuildArch: noarch
|
6
|
-
|
7
|
-
License: Apache-2.0
|
8
|
-
URL: http://foo.bar
|
9
|
-
|
10
|
-
%description
|
11
|
-
A mock RPM package used for acceptance tests
|
12
|
-
|
13
|
-
%prep
|
14
|
-
exit 0
|
15
|
-
|
16
|
-
%build
|
17
|
-
exit 0
|
18
|
-
|
19
|
-
|
20
|
-
%install
|
21
|
-
exit 0
|
22
|
-
|
23
|
-
%clean
|
24
|
-
exit 0
|
25
|
-
|
26
|
-
%files
|
27
|
-
%doc
|
28
|
-
|
29
|
-
|
30
|
-
%changelog
|
31
|
-
* Fri Feb 23 2018 nobody
|
32
|
-
- some comment
|
@@ -1,32 +0,0 @@
|
|
1
|
-
Name: pupmod-simp-simplib
|
2
|
-
Version: 1.9.9
|
3
|
-
Release: 9
|
4
|
-
Summary: mock simplib test package
|
5
|
-
BuildArch: noarch
|
6
|
-
|
7
|
-
License: Apache-2.0
|
8
|
-
URL: http://foo.bar
|
9
|
-
|
10
|
-
%description
|
11
|
-
A mock RPM package used for acceptance tests
|
12
|
-
|
13
|
-
%prep
|
14
|
-
exit 0
|
15
|
-
|
16
|
-
%build
|
17
|
-
exit 0
|
18
|
-
|
19
|
-
|
20
|
-
%install
|
21
|
-
exit 0
|
22
|
-
|
23
|
-
%clean
|
24
|
-
exit 0
|
25
|
-
|
26
|
-
%files
|
27
|
-
%doc
|
28
|
-
|
29
|
-
|
30
|
-
%changelog
|
31
|
-
* Fri Feb 23 2018 nobody
|
32
|
-
- some comment
|
@@ -1,25 +0,0 @@
|
|
1
|
-
spec_file=$1
|
2
|
-
|
3
|
-
FAKE_RPM_SRC_DIR=${FAKE_RPM_SRC_DIR:-${PWD}/pkg}
|
4
|
-
FAKE_RPM_BUILD_DIR=${FAKE_RPM_BUILD_DIR:-${FAKE_RPM_SRC_DIR}/rpmbuild}
|
5
|
-
|
6
|
-
# clean up old builds
|
7
|
-
rm -rf "${FAKE_RPM_BUILD_DIR}"/{BUILDROOT,BUILD,SOURCES}/** &> /dev/null :
|
8
|
-
mkdir -p "${FAKE_RPM_BUILD_DIR}"/{BUILDROOT,BUILD,SOURCES}
|
9
|
-
|
10
|
-
|
11
|
-
# if there is a directory with the same name as the spec file, build a tar ball
|
12
|
-
# from it and stage it under SOURCES
|
13
|
-
source_dir=`echo ${spec_file}| sed -e 's/.spec$//'`
|
14
|
-
if [ -d "${source_dir}" ]; then
|
15
|
-
echo "Found a directory named '${source_dir}'; building tarball"
|
16
|
-
pushd "${source_dir}" > /dev/null
|
17
|
-
tar -zcv --exclude=.*.swp -f "${FAKE_RPM_BUILD_DIR}/SOURCES/files.tar.gz" *
|
18
|
-
popd > /dev/null
|
19
|
-
else
|
20
|
-
echo "NOTE: no source directory ar '${source_dir}'"
|
21
|
-
fi
|
22
|
-
|
23
|
-
|
24
|
-
# rpmbuild
|
25
|
-
rpmbuild -D "buildroot ${FAKE_RPM_BUILD_DIR}/BUILDROOT" -D "builddir ${FAKE_RPM_BUILD_DIR}/BUILD" -D "_sourcedir ${FAKE_RPM_BUILD_DIR}/SOURCES" -D "_rpmdir ${FAKE_RPM_SRC_DIR}/dist" -D "_srcrpmdir ${FAKE_RPM_SRC_DIR}/dist" -D "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" -ba $@ "${spec_file}"
|