summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/functional/resource/dnf_package_spec.rb10
-rw-r--r--spec/spec_helper.rb2
-rw-r--r--spec/support/platform_helpers.rb8
3 files changed, 15 insertions, 5 deletions
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 5ed5e73506..582e183b36 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -190,6 +190,8 @@ RSpec.configure do |config|
config.filter_run_excluding rhel5: true unless rhel5?
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 f446a30862..43b3500e46 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -183,6 +183,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