summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-12-01 13:46:22 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2015-12-01 13:46:22 -0800
commit00c46965d02fc58ebac44c4b3e8008c3b1fb8bb8 (patch)
tree5d3f1144206c57e067bcdbbf5a5d96530f028d27
parent38fbdf8f7e12338f6c4ec4ec07d5a6f6808a3008 (diff)
parenta58627523f580b509255c70014c78ae556e428dc (diff)
downloadchef-00c46965d02fc58ebac44c4b3e8008c3b1fb8bb8.tar.gz
Merge pull request #3790 from chef/jdm/travis-sudo
A lot of our tests require sudo
-rw-r--r--.travis.yml5
-rw-r--r--spec/functional/resource/ifconfig_spec.rb4
-rw-r--r--spec/functional/resource/mount_spec.rb4
-rw-r--r--spec/spec_helper.rb1
4 files changed, 11 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml
index 3a37c6dbc1..d2c1f4bcff 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,7 +19,8 @@ branches:
# do not run expensive spec tests on PRs, only on branches
script: "
echo '--color\n-fp' > .rspec;
-bundle exec rake spec;
+sudo sed -i -e 's/^Defaults\tsecure_path.*$//' /etc/sudoers;
+sudo -E $(which bundle) exec rake spec;
"
env:
@@ -29,7 +30,9 @@ env:
matrix:
include:
- rvm: 2.1
+ sudo: true
- rvm: 2.2
+ sudo: true
- rvm: 2.2
cache:
env: "GEMFILE_MOD=\"gem 'chef-zero', github: 'chef/chef-zero'\""
diff --git a/spec/functional/resource/ifconfig_spec.rb b/spec/functional/resource/ifconfig_spec.rb
index 9c613544ac..4733b05f35 100644
--- a/spec/functional/resource/ifconfig_spec.rb
+++ b/spec/functional/resource/ifconfig_spec.rb
@@ -22,7 +22,9 @@ require 'chef/mixin/shell_out'
# run this test only for following platforms.
include_flag = !(['ubuntu', 'centos', 'aix'].include?(ohai[:platform]))
-describe Chef::Resource::Ifconfig, :requires_root, :external => include_flag do
+describe Chef::Resource::Ifconfig, :requires_root, :skip_travis, :external => include_flag do
+ # This test does not work in travis because there is no eth0
+
include Chef::Mixin::ShellOut
let(:new_resource) do
diff --git a/spec/functional/resource/mount_spec.rb b/spec/functional/resource/mount_spec.rb
index a016d12293..002a927c96 100644
--- a/spec/functional/resource/mount_spec.rb
+++ b/spec/functional/resource/mount_spec.rb
@@ -23,7 +23,9 @@ require 'tmpdir'
# run this test only for following platforms.
include_flag = !(['ubuntu', 'centos', 'aix', 'solaris2'].include?(ohai[:platform]))
-describe Chef::Resource::Mount, :requires_root, :external => include_flag do
+describe Chef::Resource::Mount, :requires_root, :skip_travis, :external => include_flag do
+ # Disabled in travis because it refuses to let us mount a ramdisk. /dev/ramX does not
+ # exist even after loading the kernel module
include Chef::Mixin::ShellOut
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 4f7fde8eaf..5ebd9cb896 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -121,6 +121,7 @@ RSpec.configure do |config|
config.filter_run_excluding :skip_appveyor => true if ENV["APPVEYOR"]
config.filter_run_excluding :appveyor_only => true unless ENV["APPVEYOR"]
+ config.filter_run_excluding :skip_travis => true if ENV["TRAVIS"]
config.filter_run_excluding :windows_only => true unless windows?
config.filter_run_excluding :not_supported_on_mac_osx_106 => true if mac_osx_106?