Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #470 from apenney/unsupported-tests

Add unsupported infrastructure for excluding OSes we can't test on.
  • Loading branch information...
commit c8bff9b0ec41010fab8e80c2d1ef06dcaf4c03af 2 parents 6019705 + d1f4597
Ashley Penney authored
2  spec/acceptance/mysql_account_delete_spec.rb
View
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'
-describe 'mysql::server::account_security class' do
+describe 'mysql::server::account_security class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'running puppet code' do
it 'should work with no errors' do
pp = <<-EOS
2  spec/acceptance/mysql_backup_spec.rb
View
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'
-describe 'mysql::server::backup class' do
+describe 'mysql::server::backup class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
context 'should work with no errors' do
it 'when configuring mysql backups' do
pp = <<-EOS
2  spec/acceptance/mysql_bindings_spec.rb
View
@@ -44,7 +44,7 @@
end
end
-describe 'mysql::bindings class' do
+describe 'mysql::bindings class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'running puppet code' do
it 'should work with no errors' do
2  spec/acceptance/mysql_db_spec.rb
View
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'
-describe 'mysql::db define' do
+describe 'mysql::db define', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'creating a database' do
# Using puppet_apply as a helper
it 'should work with no errors' do
2  spec/acceptance/mysql_server_config_spec.rb
View
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'
-describe 'config location' do
+describe 'config location', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
it 'creates the file elsewhere' do
pp = <<-EOS
class { 'mysql::server':
2  spec/acceptance/mysql_server_monitor_spec.rb
View
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'
-describe 'mysql::server::monitor class' do
+describe 'mysql::server::monitor class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
it 'should work with no errors' do
pp = <<-EOS
class { 'mysql::server': root_password => 'password' }
2  spec/acceptance/mysql_server_root_password_spec.rb
View
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'
-describe 'mysql::server::root_password class' do
+describe 'mysql::server::root_password class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'reset' do
it 'shuts down mysql' do
2  spec/acceptance/mysql_server_spec.rb
View
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'
-describe 'mysql class' do
+describe 'mysql class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
case fact('osfamily')
when 'RedHat'
package_name = 'mysql-server'
2  spec/acceptance/types/mysql_database_spec.rb
View
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'
-describe 'mysql_database' do
+describe 'mysql_database', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'setup' do
it 'should work with no errors' do
pp = <<-EOS
8 spec/acceptance/types/mysql_grant_spec.rb
View
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'
-describe 'mysql_grant' do
+describe 'mysql_grant', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'setup' do
it 'setup mysql::server' do
@@ -283,7 +283,7 @@ class { 'mysql::server': }
expect(apply_manifest(pp, :catch_failures => true).exit_code).to eq(0)
end
end
-
+
describe 'adding procedure privileges' do
it 'should work without errors' do
pp = <<-EOS
@@ -294,10 +294,10 @@ class { 'mysql::server': }
privileges => ['EXECUTE'],
}
EOS
-
+
apply_manifest(pp, :catch_failures => true)
end
-
+
it 'should find the user' do
shell("mysql -NBe \"SHOW GRANTS FOR test2@tester\"") do |r|
expect(r.stdout).to match(/GRANT EXECUTE ON PROCEDURE `test`.`simpleproc` TO 'test2'@'tester'/)
2  spec/acceptance/types/mysql_user_spec.rb
View
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'
-describe 'mysql_user' do
+describe 'mysql_user', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'setup' do
it 'should work with no errors' do
pp = <<-EOS
10 spec/acceptance/unsupported_spec.rb
View
@@ -0,0 +1,10 @@
+require 'spec_helper_acceptance'
+
+describe 'unsupported distributions and OSes', :if => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+ it 'should fail' do
+ pp = <<-EOS
+ class { 'mysql::server': }
+ EOS
+ expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/unsupported osfamily/i)
+ end
+end
2  spec/spec_helper_acceptance.rb
View
@@ -1,5 +1,7 @@
require 'beaker-rspec'
+UNSUPPORTED_PLATFORMS = [ 'Windows', 'Solaris', 'AIX' ]
+
unless ENV['RS_PROVISION'] == 'no'
hosts.each do |host|
# Install Puppet
Please sign in to comment.
Something went wrong with that request. Please try again.