summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordheerajd-msys <dheeraj.dubey@msystechnologies.com>2018-09-04 15:25:29 +0530
committerdheerajd-msys <dheeraj.dubey@msystechnologies.com>2018-09-25 11:36:10 +0530
commit15544c17fe9ccea0408ddf4d652b1678ebcdd592 (patch)
tree244f2c9abd03af1569bd3498618f66eb56738972
parentbf03eadf0ed4533932d026a1aaa2cced7b77d743 (diff)
downloadchef-15544c17fe9ccea0408ddf4d652b1678ebcdd592.tar.gz
add suse rspec testing
Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
-rw-r--r--.travis.yml17
-rw-r--r--kitchen-tests/kitchen.travis.yml2
-rw-r--r--spec/functional/resource/zypper_package_spec.rb6
-rw-r--r--spec/spec_helper.rb1
4 files changed, 22 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml
index d6c6cd0f04..0594a68eab 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -340,6 +340,23 @@ matrix:
env:
- RSPEC_CENTOS=7
- KITCHEN_YAML=kitchen.travis.yml
+ - rvm: 2.4.4
+ services: docker
+ sudo: required
+ gemfile: kitchen-tests/Gemfile
+ before_install:
+ - gem update --system $(grep rubygems omnibus_overrides.rb | cut -d'"' -f2)
+ - gem install bundler -v $(grep :bundler omnibus_overrides.rb | cut -d'"' -f2)
+ before_script:
+ - sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
+ - cd kitchen-tests
+ script:
+ - bundle exec kitchen test rspec-opensuse-leap
+ after_failure:
+ - cat .kitchen/logs/kitchen.log
+ env:
+ - RSPEC_OPENSUSELEAP=42
+ - KITCHEN_YAML=kitchen.travis.yml
notifications:
on_change: true
diff --git a/kitchen-tests/kitchen.travis.yml b/kitchen-tests/kitchen.travis.yml
index aa15da8795..0161b3aeba 100644
--- a/kitchen-tests/kitchen.travis.yml
+++ b/kitchen-tests/kitchen.travis.yml
@@ -104,6 +104,8 @@ platforms:
driver:
image: dokken/opensuse-leap
pid_one_command: /bin/systemd
+ intermediate_instructions:
+ - RUN sed -i -e "s/Defaults.*requiretty.*/Defaults !requiretty/g" /etc/sudoers
suites:
- name: end-to-end
diff --git a/spec/functional/resource/zypper_package_spec.rb b/spec/functional/resource/zypper_package_spec.rb
index 16fc4d205c..c95c3575ca 100644
--- a/spec/functional/resource/zypper_package_spec.rb
+++ b/spec/functional/resource/zypper_package_spec.rb
@@ -20,9 +20,7 @@ require "spec_helper"
require "functional/resource/base"
require "chef/mixin/shell_out"
-# run this test only for following platforms.
-exclude_test = !(%w{suse}.include?(ohai[:platform_family]) && !File.exist?("/usr/bin/zypper"))
-describe Chef::Resource::ZypperPackage, :requires_root, external: exclude_test do
+describe Chef::Resource::ZypperPackage, :requires_root, :suse_only do
include Chef::Mixin::ShellOut
# NOTE: every single test here needs to explicitly call preinstall.
@@ -97,7 +95,7 @@ describe Chef::Resource::ZypperPackage, :requires_root, external: exclude_test d
end
end
- context "with versions or globs in the name" do
+ context "with versions" do
it "works with a version" do
zypper_package.package_name("chef_rpm")
zypper_package.version("1.10")
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index e77f5dc8d6..e87308e9ed 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -171,6 +171,7 @@ RSpec.configure do |config|
config.filter_run_excluding unix_only: true unless unix?
config.filter_run_excluding linux_only: true unless linux?
config.filter_run_excluding aix_only: true unless aix?
+ config.filter_run_excluding suse_only: true unless suse?
config.filter_run_excluding debian_family_only: true unless debian_family?
config.filter_run_excluding supports_cloexec: true unless supports_cloexec?
config.filter_run_excluding selinux_only: true unless selinux_enabled?