diff options
-rw-r--r-- | .expeditor/verify.pipeline.yml | 46 | ||||
-rw-r--r-- | .travis.yml | 33 | ||||
-rw-r--r-- | CHANGELOG.md | 11 | ||||
-rw-r--r-- | Gemfile.lock | 30 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | chef-bin/lib/chef-bin/version.rb | 2 | ||||
-rw-r--r-- | chef-config/lib/chef-config/version.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/package/dnf/dnf_helper.py | 16 | ||||
-rw-r--r-- | lib/chef/resource/dnf_package.rb | 4 | ||||
-rw-r--r-- | lib/chef/resource/kernel_module.rb | 20 | ||||
-rw-r--r-- | lib/chef/version.rb | 2 | ||||
-rw-r--r-- | omnibus/Gemfile.lock | 4 | ||||
-rw-r--r-- | omnibus/omnibus-test.sh | 5 | ||||
-rw-r--r-- | spec/functional/resource/dnf_package_spec.rb | 10 | ||||
-rw-r--r-- | spec/spec_helper.rb | 2 | ||||
-rw-r--r-- | spec/support/platform_helpers.rb | 8 | ||||
-rw-r--r-- | spec/unit/resource/kernel_module_spec.rb | 1 |
17 files changed, 143 insertions, 55 deletions
diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 2cb076e10c..b5677a6ff6 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -142,6 +142,50 @@ steps: - FORCE_FFI_YAJL=ext - CHEF_LICENSE=accept-no-persist +- label: "Integration Specs Fedora :ruby: 2.6" + commands: + - /workdir/scripts/bk_tests/bk_container_prep.sh + - cd /workdir; bundle install --jobs=3 --retry=3 --without omnibus_package docgen + - bundle exec rake spec:integration + expeditor: + executor: + docker: + image: rubydistros/fedora-latest + privileged: true + environment: + - FORCE_FFI_YAJL=ext + - CHEF_LICENSE=accept-no-persist + - BUNDLE_GEMFILE=/workdir/Gemfile + +- label: "Functional Specs Fedora :ruby: 2.6" + commands: + - /workdir/scripts/bk_tests/bk_container_prep.sh + - yum install -y crontabs e2fsprogs util-linux + - cd /workdir; bundle install --jobs=3 --retry=3 --without omnibus_package docgen ruby_prof + - bundle exec rake spec:functional + expeditor: + executor: + docker: + image: rubydistros/fedora-latest + privileged: true + environment: + - FORCE_FFI_YAJL=ext + - CHEF_LICENSE=accept-no-persist + +- label: "Unit Specs Fedora :ruby: 2.6" + commands: + - /workdir/scripts/bk_tests/bk_container_prep.sh + - bundle install --jobs=3 --retry=3 --without omnibus_package docgen ruby_prof + - bundle exec rake spec:unit + - bundle exec rake component_specs + expeditor: + executor: + docker: + image: rubydistros/fedora-latest + environment: + - FORCE_FFI_YAJL=ext + - CHEF_LICENSE=accept-no-persist + - label: "Chefstyle :ruby: 2.6" commands: - /workdir/scripts/bk_tests/bk_container_prep.sh @@ -413,7 +457,7 @@ steps: # linux: # privileged: true # single-use: true -# +# # - label: "Kitchen Tests openSUSE Leap: 42" # commands: # - scripts/bk_tests/bk_linux_exec.sh diff --git a/.travis.yml b/.travis.yml index 6904a1da75..2d711f7e10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,6 @@ before_install: - rm -f .bundle/config before_script: - # force all .rspec tests into progress display to reduce line count - - echo --color > .rspec - - echo -fp >> .rspec # necessary for sudo: true tests, ingore failures on tests invoked with sudo: false - sudo sed -i -e 's/^Defaults\tsecure_path.*$//' /etc/sudoers @@ -34,7 +31,7 @@ env: matrix: include: - - rvm: 2.5.5 + - rvm: 2.6.3 services: docker gemfile: kitchen-tests/Gemfile before_install: @@ -50,7 +47,7 @@ matrix: env: - AMAZON=2 - KITCHEN_YAML=kitchen.yml - - rvm: 2.5.5 + - rvm: 2.6.3 services: docker gemfile: kitchen-tests/Gemfile before_install: @@ -66,7 +63,7 @@ matrix: env: - AMAZON=201X - KITCHEN_YAML=kitchen.yml - - rvm: 2.5.5 + - rvm: 2.6.3 services: docker gemfile: kitchen-tests/Gemfile before_install: @@ -82,7 +79,7 @@ matrix: env: - UBUNTU=16.04 - KITCHEN_YAML=kitchen.yml - - rvm: 2.5.5 + - rvm: 2.6.3 services: docker gemfile: kitchen-tests/Gemfile before_install: @@ -98,7 +95,7 @@ matrix: env: - UBUNTU=18.04 - KITCHEN_YAML=kitchen.yml - - rvm: 2.5.5 + - rvm: 2.6.3 services: docker gemfile: kitchen-tests/Gemfile before_install: @@ -114,7 +111,7 @@ matrix: env: - DEBIAN=8 - KITCHEN_YAML=kitchen.yml - - rvm: 2.5.5 + - rvm: 2.6.3 services: docker gemfile: kitchen-tests/Gemfile before_install: @@ -130,7 +127,7 @@ matrix: env: - DEBIAN=9 - KITCHEN_YAML=kitchen.yml - - rvm: 2.5.5 + - rvm: 2.6.3 services: docker gemfile: kitchen-tests/Gemfile before_install: @@ -146,7 +143,7 @@ matrix: env: - DEBIAN=10 - KITCHEN_YAML=kitchen.yml - - rvm: 2.5.5 + - rvm: 2.6.3 services: docker gemfile: kitchen-tests/Gemfile before_install: @@ -162,7 +159,7 @@ matrix: env: - CENTOS=6 - KITCHEN_YAML=kitchen.yml - - rvm: 2.5.5 + - rvm: 2.6.3 services: docker gemfile: kitchen-tests/Gemfile before_install: @@ -178,7 +175,7 @@ matrix: env: - CENTOS=7 - KITCHEN_YAML=kitchen.yml - - rvm: 2.5.5 + - rvm: 2.6.3 services: docker gemfile: kitchen-tests/Gemfile before_install: @@ -194,7 +191,7 @@ matrix: env: - FEDORA=latest - KITCHEN_YAML=kitchen.yml - - rvm: 2.5.5 + - rvm: 2.6.3 services: docker gemfile: kitchen-tests/Gemfile before_install: @@ -210,7 +207,7 @@ matrix: env: - OPENSUSELEAP=42 - KITCHEN_YAML=kitchen.yml - - rvm: 2.5.5 + - rvm: 2.6.3 before_install: - gem update --system $(grep rubygems omnibus_overrides.rb | cut -d'"' -f2) - rvm @global do gem uninstall bundler -a -x || true @@ -228,9 +225,3 @@ matrix: - cat /tmp/out.txt - sudo cat /var/log/squid3/cache.log - sudo cat /var/log/squid3/access.log - -notifications: - on_change: true - on_failure: true - on_success: change - on_pull_requests: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 92ef8b67aa..b61814e090 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,20 @@ <!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ --> -<!-- latest_release 15.1.53 --> -## [v15.1.53](https://github.com/chef/chef/tree/v15.1.53) (2019-07-15) +<!-- latest_release 15.2.0 --> +## [v15.2.0](https://github.com/chef/chef/tree/v15.2.0) (2019-07-22) #### Merged Pull Requests -- Remove the unused rspec kitchen tests [#8741](https://github.com/chef/chef/pull/8741) ([tas50](https://github.com/tas50)) +- Bump InSpec, Ohai, and appbundler to the latest [#8761](https://github.com/chef/chef/pull/8761) ([tas50](https://github.com/tas50)) <!-- latest_release --> <!-- release_rollup since=15.1.36 --> ### Changes not yet released to stable #### Merged Pull Requests +- Bump InSpec, Ohai, and appbundler to the latest [#8761](https://github.com/chef/chef/pull/8761) ([tas50](https://github.com/tas50)) <!-- 15.2.0 --> +- Implement disable for disabling kernel_modules [#8747](https://github.com/chef/chef/pull/8747) ([tomdoherty](https://github.com/tomdoherty)) <!-- 15.1.58 --> +- Add rspec testing on Fedora in Buildkite [#8759](https://github.com/chef/chef/pull/8759) ([tas50](https://github.com/tas50)) <!-- 15.1.57 --> +- dnf_package fixes for RHEL8 [#8754](https://github.com/chef/chef/pull/8754) ([lamont-granquist](https://github.com/lamont-granquist)) <!-- 15.1.56 --> +- test that inspec binstub is in the omnibus artifact [#8750](https://github.com/chef/chef/pull/8750) ([lamont-granquist](https://github.com/lamont-granquist)) <!-- 15.1.54 --> - Remove the unused rspec kitchen tests [#8741](https://github.com/chef/chef/pull/8741) ([tas50](https://github.com/tas50)) <!-- 15.1.53 --> - Fix RDoc copy-pasta in Chef::Mixin::ParamsValidate#validate [#8740](https://github.com/chef/chef/pull/8740) ([RubyTuesdayDONO](https://github.com/RubyTuesdayDONO)) <!-- 15.1.52 --> - Pull in latest omnibus-software to fix Windows builds [#8739](https://github.com/chef/chef/pull/8739) ([btm](https://github.com/btm)) <!-- 15.1.51 --> diff --git a/Gemfile.lock b/Gemfile.lock index b8e4d3263c..e52788a5cc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,10 +8,10 @@ GIT GIT remote: https://github.com/chef/ohai.git - revision: f5eed7c04a407b5ee138125000860b29325e1f21 + revision: 70b7b54cabef12e1cc4ac771c0952ad0c5c45eb8 branch: master specs: - ohai (15.1.6) + ohai (15.2.1) chef-config (>= 12.8, < 16) ffi (~> 1.9) ffi-yajl (~> 2.2) @@ -27,11 +27,11 @@ GIT PATH remote: . specs: - chef (15.1.53) + chef (15.2.0) addressable bcrypt_pbkdf (~> 1.0) bundler (>= 1.10) - chef-config (= 15.1.53) + chef-config (= 15.2.0) chef-zero (>= 14.0.11) diff-lcs (~> 1.2, >= 1.2.4) ed25519 (~> 1.2) @@ -57,11 +57,11 @@ PATH train-core (~> 2.0, >= 2.0.12) tty-screen (~> 0.6) uuidtools (~> 2.1.5) - chef (15.1.53-universal-mingw32) + chef (15.2.0-universal-mingw32) addressable bcrypt_pbkdf (~> 1.0) bundler (>= 1.10) - chef-config (= 15.1.53) + chef-config (= 15.2.0) chef-zero (>= 14.0.11) diff-lcs (~> 1.2, >= 1.2.4) ed25519 (~> 1.2) @@ -103,13 +103,13 @@ PATH PATH remote: chef-bin specs: - chef-bin (15.1.53) - chef (= 15.1.53) + chef-bin (15.2.0) + chef (= 15.2.0) PATH remote: chef-config specs: - chef-config (15.1.53) + chef-config (15.2.0) addressable fuzzyurl mixlib-config (>= 2.2.12, < 4.0) @@ -121,7 +121,7 @@ GEM specs: addressable (2.6.0) public_suffix (>= 2.0.2, < 4.0) - appbundler (0.12.5) + appbundler (0.13.1) mixlib-cli (>= 1.4, < 3.0) mixlib-shellout (>= 2.0, < 4.0) ast (2.4.0) @@ -169,13 +169,13 @@ GEM ffi (>= 1.0.1) gyoku (1.3.1) builder (>= 2.1.2) - hashdiff (0.4.0) + hashdiff (1.0.0) hashie (3.6.0) highline (1.7.10) htmlentities (4.3.4) httpclient (2.8.3) iniparse (1.4.4) - inspec-core (4.7.3) + inspec-core (4.7.18) addressable (~> 2.4) faraday (>= 0.9.0) faraday_middleware (~> 0.12.2) @@ -200,8 +200,8 @@ GEM train-core (~> 2.0) tty-prompt (~> 0.17) tty-table (~> 0.10) - inspec-core-bin (4.7.3) - inspec-core (= 4.7.3) + inspec-core-bin (4.7.18) + inspec-core (= 4.7.18) ipaddress (0.8.3) iso8601 (0.12.1) jaro_winkler (1.5.3) @@ -324,7 +324,7 @@ GEM tins (~> 1.0) thor (0.20.3) timers (4.3.0) - tins (1.21.0) + tins (1.21.1) tomlrb (1.2.8) train-core (2.1.13) json (>= 1.8, < 3.0) @@ -1 +1 @@ -15.1.53
\ No newline at end of file +15.2.0
\ No newline at end of file diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index 92be11ff4d..6635a5f81a 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("../..", __FILE__) - VERSION = "15.1.53".freeze + VERSION = "15.2.0".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index b836fd30fe..5aa531dc55 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -21,7 +21,7 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("../..", __FILE__) - VERSION = "15.1.53".freeze + VERSION = "15.2.0".freeze end # diff --git a/lib/chef/provider/package/dnf/dnf_helper.py b/lib/chef/provider/package/dnf/dnf_helper.py index 501d6fceee..0859348212 100644 --- a/lib/chef/provider/package/dnf/dnf_helper.py +++ b/lib/chef/provider/package/dnf/dnf_helper.py @@ -14,8 +14,22 @@ def get_sack(): global base if base is None: base = dnf.Base() + conf = base.conf + conf.read() + conf.installroot = '/' + subst = conf.substitutions + subst.update_from_etc(conf.installroot) + try: + base.init_plugins() + base.pre_configure_plugins() + except AttributeError: + pass base.read_all_repos() - base.fill_sack() + try: + base.configure_plugins() + except AttributeError: + pass + base.fill_sack(load_system_repo='auto') return base.sack # FIXME: leaks memory and does not work diff --git a/lib/chef/resource/dnf_package.rb b/lib/chef/resource/dnf_package.rb index c90e135335..d115c4d5a8 100644 --- a/lib/chef/resource/dnf_package.rb +++ b/lib/chef/resource/dnf_package.rb @@ -1,5 +1,5 @@ # -# Copyright:: Copyright 2016-2017, Chef Software Inc. +# Copyright:: Copyright 2016-2019, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -73,7 +73,7 @@ class Chef unless arg.nil? Chef.deprecated(:dnf_package_allow_downgrade, "the allow_downgrade property on the dnf_package provider is not used, DNF supports downgrades by default.") end - false + true end end end diff --git a/lib/chef/resource/kernel_module.rb b/lib/chef/resource/kernel_module.rb index 882f9de975..1176990071 100644 --- a/lib/chef/resource/kernel_module.rb +++ b/lib/chef/resource/kernel_module.rb @@ -13,7 +13,7 @@ class Chef class KernelModule < Chef::Resource resource_name :kernel_module - description "Use the kernel_module resource to manage kernel modules on Linux systems. This resource can load, unload, blacklist, install, and uninstall modules." + description "Use the kernel_module resource to manage kernel modules on Linux systems. This resource can load, unload, blacklist, disable, install, and uninstall modules." introduced "14.3" property :modname, String, @@ -92,6 +92,24 @@ class Chef new_resource.run_action(:unload) end + action :disable do + description "Disable a kernel module." + + file "#{new_resource.unload_dir}/disable_#{new_resource.modname}.conf" do + content "install #{new_resource.modname} /bin/false" + notifies :run, "execute[update initramfs]", :delayed + end + + with_run_context :root do + find_resource(:execute, "update initramfs") do + command initramfs_command + action :nothing + end + end + + new_resource.run_action(:unload) + end + action :load do description "Load a kernel module." diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 50f3ac1e36..f20302a73c 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("../..", __FILE__) - VERSION = Chef::VersionString.new("15.1.53") + VERSION = Chef::VersionString.new("15.2.0") end # diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index 356899d5c4..a5e233c090 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -18,7 +18,7 @@ GIT GIT remote: https://github.com/chef/omnibus-software - revision: d97b02edd0b12dafc0ffdd554d9744ff9f5a0a24 + revision: 9467dfd2f4e7a85764c487b6607db19b28654ac5 branch: master specs: omnibus-software (4.0.0) @@ -32,7 +32,7 @@ GEM public_suffix (>= 2.0.2, < 4.0) awesome_print (1.8.0) aws-eventstream (1.0.3) - aws-partitions (1.187.0) + aws-partitions (1.190.0) aws-sdk-core (3.59.0) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1.0) diff --git a/omnibus/omnibus-test.sh b/omnibus/omnibus-test.sh index 95ac30bec4..068dac1a13 100644 --- a/omnibus/omnibus-test.sh +++ b/omnibus/omnibus-test.sh @@ -93,6 +93,11 @@ if [[ ! -L $USR_BIN_DIR/ohai ]] || [[ $(ls -l $USR_BIN_DIR/ohai | awk '{print$NF exit 1 fi +if [[ ! -x $EMBEDDED_BIN_DIR/inspec ]]; then + echo "$EMBEDDED_BIN_DIR/inspec does not exist!" + exit 1 +fi + # Ensure the calling environment (disapproval look Bundler) does not # infect our Ruby environment created by the `chef-client` cli. for ruby_env_var in _ORIGINAL_GEM_PATH \ diff --git a/spec/functional/resource/dnf_package_spec.rb b/spec/functional/resource/dnf_package_spec.rb index 392c3d4012..0e7009f003 100644 --- a/spec/functional/resource/dnf_package_spec.rb +++ b/spec/functional/resource/dnf_package_spec.rb @@ -1,5 +1,5 @@ # -# Copyright:: Copyright 2016, Chef Software Inc. +# Copyright:: Copyright 2016-2019, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -190,8 +190,8 @@ describe Chef::Resource::RpmPackage, :requires_root, external: exclude_test do expect(shell_out("rpm -q chef_rpm").stdout.chomp).to eql("chef_rpm-1.10-1.x86_64") end - it "matches with a vr glob" do - pending "doesn't work on command line either" + # only works on rhel >= 8, was broken on old dnf + it "matches with a vr glob", :rhel_gte_8 do flush_cache dnf_package.package_name("chef_rpm") dnf_package.version("1.10-1*") @@ -200,8 +200,8 @@ describe Chef::Resource::RpmPackage, :requires_root, external: exclude_test do expect(shell_out("rpm -q chef_rpm").stdout.chomp).to eql("chef_rpm-1.10-1.x86_64") end - it "matches with an evr glob" do - pending "doesn't work on command line either" + # only works on rhel >= 8, was broken on old dnf + it "matches with an evr glob", :rhel_gte_8 do flush_cache dnf_package.package_name("chef_rpm") dnf_package.version("0:1.10-1*") diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9b54761df5..5ab97a8320 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -188,6 +188,8 @@ RSpec.configure do |config| config.filter_run_excluding rhel: true unless rhel? config.filter_run_excluding rhel6: true unless rhel6? config.filter_run_excluding rhel7: true unless rhel7? + config.filter_run_excluding rhel8: true unless rhel8? + config.filter_run_excluding rhel_gte_8: true unless rhel_gte_8? config.filter_run_excluding intel_64bit: true unless intel_64bit? config.filter_run_excluding not_rhel: true if rhel? config.filter_run_excluding not_rhel6: true if rhel6? diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb index 509ca6e71e..0b13169ac1 100644 --- a/spec/support/platform_helpers.rb +++ b/spec/support/platform_helpers.rb @@ -175,6 +175,14 @@ def rhel7? rhel? && !!(ohai[:platform_version].to_i == 7) end +def rhel8? + rhel? && !!(ohai[:platform_version].to_i == 8) +end + +def rhel_gte_8? + rhel? && !!(ohai[:platform_version].to_i >= 8) +end + def debian_family? !!(ohai[:platform_family] == "debian") end diff --git a/spec/unit/resource/kernel_module_spec.rb b/spec/unit/resource/kernel_module_spec.rb index 6cbc047e79..9242959bd6 100644 --- a/spec/unit/resource/kernel_module_spec.rb +++ b/spec/unit/resource/kernel_module_spec.rb @@ -36,6 +36,7 @@ describe Chef::Resource::KernelModule do expect { resource.action :install }.not_to raise_error expect { resource.action :uninstall }.not_to raise_error expect { resource.action :blacklist }.not_to raise_error + expect { resource.action :disable }.not_to raise_error expect { resource.action :load }.not_to raise_error expect { resource.action :unload }.not_to raise_error expect { resource.action :delete }.to raise_error(ArgumentError) |