diff --git a/Gemfile b/Gemfile index 14d48b3..0c916ff 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,7 @@ +## THIS GEMFILE IS DEPRECATED AND WILL BE REMOVED AFTER THE NEXT RELEASE +## THERE WON'T BE ANY UPDATES TO THIS FILE DURING THIS RELEASE CYCLE +## WE SWITCHED TO CHEFDK AS THE BUNDLE FOR THE NEEDED GEMS + # encoding: UTF-8 source 'https://rubygems.org' diff --git a/README.md b/README.md index 3336522..47fa172 100644 --- a/README.md +++ b/README.md @@ -253,6 +253,7 @@ License and Author | **Author** | Mark Vanderwiel () | | **Author** | Eric Zhou () | | **Author** | Edwin Wang () | +| **Author** | Jan Klare () | | | | | **Copyright** | Copyright (c) 2012, Rackspace US, Inc. | | **Copyright** | Copyright (c) 2012-2013, AT&T Services, Inc. | diff --git a/Rakefile b/Rakefile index e9952df..357a6c0 100644 --- a/Rakefile +++ b/Rakefile @@ -2,32 +2,25 @@ task default: ["test"] task :test => [:lint, :style, :unit] -task :bundler_prep do - mkdir_p '.bundle' - sh %{bundle install --path=.bundle --jobs 1 --retry 3 --verbose} +task :berks_prep do + sh %{chef exec berks vendor} end -task :berks_prep => :bundler_prep do - sh %{bundle exec berks vendor} +task :lint do + sh %{chef exec foodcritic --epic-fail any --tags ~FC003 --tags ~FC023 .} end -task :lint => :bundler_prep do - sh %{bundle exec foodcritic --epic-fail any --tags ~FC003 --tags ~FC023 .} -end - -task :style => :bundler_prep do - sh %{bundle exec rubocop} +task :style do + sh %{chef exec rubocop} end task :unit => :berks_prep do - sh %{bundle exec rspec --format documentation} + sh %{chef exec rspec --format documentation} end task :clean do rm_rf [ - '.bundle', 'berks-cookbooks', - 'Gemfile.lock', 'Berksfile.lock' ] end diff --git a/TESTING.md b/TESTING.md index fa2e9c1..d9a964d 100644 --- a/TESTING.md +++ b/TESTING.md @@ -1,18 +1,18 @@ # Testing the Cookbook # -This cookbook uses [bundler](http://gembundler.com/) and [berkshelf](http://berkshelf.com/) to isolate dependencies. Make sure you have `ruby 1.9.x`, `bundler`, `rake`, build essentials and the header files for `gecode` installed before continuing. Make sure that you're using gecode version 3. More info [here](https://github.com/opscode/dep-selector-libgecode/tree/0bad63fea305ede624c58506423ced697dd2545e#using-a-system-gecode-instead). +This cookbook uses [chefdk](https://downloads.chef.io/chef-dk/) and [berkshelf](http://berkshelf.com/) to isolate dependencies. Make sure you have chefdk and the header files for `gecode` installed before continuing. Make sure that you're using gecode version 3. More info [here](https://github.com/opscode/dep-selector-libgecode/tree/0bad63fea305ede624c58506423ced697dd2545e#using-a-system-gecode-instead). For more detailed information on what needs to be installed, you can have a quick look into the bootstrap.sh file in this repository, which does install all the needed things to get going on ubuntu trusty. The tests defined in the Rakefile include lint, style and unit. For integration testing please refere to the [openstack-chef-repo](https://github.com/stackforge/openstack-chef-repo). -We have three test suites which you can run individually (there are three rake tasks): +We have three test suites which you can run either, individually (there are three rake tasks): - $ rake lint - $ rake style - $ rake unit + $ chef exec rake lint + $ chef exec rake style + $ chef exec rake unit or altogether: - $ rake test + $ chef exec rake -The `rake` tasks will take care of installing the needed gem dependencies and cookbooks with `berkshelf`. +The `rake` tasks will take care of installing the needed cookbooks with `berkshelf`. ## Rubocop ## @@ -27,4 +27,4 @@ The `rake` tasks will take care of installing the needed gem dependencies and co ## Chefspec -[ChefSpec](https://github.com/sethvargo/chefspec/) is a unit testing framework for testing Chef cookbooks. ChefSpec makes it easy to write examples and get fast feedback on cookbook changes without the need for virtual machines or cloud servers. +[ChefSpec](https://github.com/sethvargo/chefspec) is a unit testing framework for testing Chef cookbooks. ChefSpec makes it easy to write examples and get fast feedback on cookbook changes without the need for virtual machines or cloud servers. diff --git a/spec/api-opensuse_spec.rb b/spec/api-opensuse_spec.rb index dedca93..22b3443 100644 --- a/spec/api-opensuse_spec.rb +++ b/spec/api-opensuse_spec.rb @@ -6,7 +6,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::api' do describe 'suse' do - let(:runner) { ChefSpec::Runner.new(SUSE_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(SUSE_OPTS) } let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } diff --git a/spec/api-redhat_spec.rb b/spec/api-redhat_spec.rb index d7ad3a4..afeefa0 100644 --- a/spec/api-redhat_spec.rb +++ b/spec/api-redhat_spec.rb @@ -6,7 +6,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::api' do describe 'redhat' do - let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) } let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } diff --git a/spec/api_spec.rb b/spec/api_spec.rb index cfbac72..9a25580 100644 --- a/spec/api_spec.rb +++ b/spec/api_spec.rb @@ -6,7 +6,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::api' do describe 'ubuntu' do - let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } diff --git a/spec/cinder_common-redhat_spec.rb b/spec/cinder_common-redhat_spec.rb index fe364bd..7cff8ca 100644 --- a/spec/cinder_common-redhat_spec.rb +++ b/spec/cinder_common-redhat_spec.rb @@ -6,7 +6,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::cinder-common' do describe 'rhel' do - let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) } let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } diff --git a/spec/cinder_common-suse_spec.rb b/spec/cinder_common-suse_spec.rb index bfe7f86..4164ea7 100644 --- a/spec/cinder_common-suse_spec.rb +++ b/spec/cinder_common-suse_spec.rb @@ -6,7 +6,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::cinder-common' do describe 'suse' do - let(:runner) { ChefSpec::Runner.new(SUSE_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(SUSE_OPTS) } let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb index 51e9d2a..8ed5454 100644 --- a/spec/cinder_common_spec.rb +++ b/spec/cinder_common_spec.rb @@ -6,7 +6,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::cinder-common' do describe 'ubuntu' do - let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } let(:node) { runner.node } let(:chef_run) do node.set['openstack']['mq']['host'] = '127.0.0.1' diff --git a/spec/client-redhat_spec.rb b/spec/client-redhat_spec.rb index 166ea62..de32b0b 100644 --- a/spec/client-redhat_spec.rb +++ b/spec/client-redhat_spec.rb @@ -3,7 +3,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::client' do describe 'redhat' do - let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) } let(:node) { runner.node } let(:chef_run) do runner.converge(described_recipe) diff --git a/spec/client_spec.rb b/spec/client_spec.rb index b58ea36..eae242a 100644 --- a/spec/client_spec.rb +++ b/spec/client_spec.rb @@ -3,7 +3,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::client' do describe 'ubuntu' do - let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } let(:node) { runner.node } let(:chef_run) do runner.converge(described_recipe) diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb index 7f8ef2c..c726343 100644 --- a/spec/identity_registration_spec.rb +++ b/spec/identity_registration_spec.rb @@ -6,7 +6,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::identity_registration' do describe 'ubuntu' do - let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } diff --git a/spec/scheduler-redhat_spec.rb b/spec/scheduler-redhat_spec.rb index 55322e0..5d774fb 100644 --- a/spec/scheduler-redhat_spec.rb +++ b/spec/scheduler-redhat_spec.rb @@ -6,7 +6,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::scheduler' do describe 'redhat' do - let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) } let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } diff --git a/spec/scheduler-suse_spec.rb b/spec/scheduler-suse_spec.rb index c53a04d..791e1a1 100644 --- a/spec/scheduler-suse_spec.rb +++ b/spec/scheduler-suse_spec.rb @@ -6,7 +6,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::scheduler' do describe 'suse' do - let(:runner) { ChefSpec::Runner.new(SUSE_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(SUSE_OPTS) } let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } diff --git a/spec/scheduler_spec.rb b/spec/scheduler_spec.rb index 037d8c5..6d12195 100644 --- a/spec/scheduler_spec.rb +++ b/spec/scheduler_spec.rb @@ -6,7 +6,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::scheduler' do describe 'ubuntu' do - let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } diff --git a/spec/volume-redhat_spec.rb b/spec/volume-redhat_spec.rb index 331d196..6fe3637 100644 --- a/spec/volume-redhat_spec.rb +++ b/spec/volume-redhat_spec.rb @@ -6,7 +6,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::volume' do describe 'redhat' do - let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) } let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } @@ -107,7 +107,7 @@ describe 'openstack-block-storage::volume' do describe 'IBM GPFS volume driver' do before do - @chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS do |n| + @chef_run = ::ChefSpec::SoloRunner.new ::REDHAT_OPTS do |n| n.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.ibm.gpfs.GPFSDriver' n.set['openstack']['block-storage']['gpfs']['gpfs_mount_point_base'] = 'volumes' end diff --git a/spec/volume-suse_spec.rb b/spec/volume-suse_spec.rb index ad6d32a..6e1019a 100644 --- a/spec/volume-suse_spec.rb +++ b/spec/volume-suse_spec.rb @@ -6,7 +6,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::volume' do describe 'suse' do - let(:runner) { ChefSpec::Runner.new(SUSE_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(SUSE_OPTS) } let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } diff --git a/spec/volume_spec.rb b/spec/volume_spec.rb index f891089..548b795 100644 --- a/spec/volume_spec.rb +++ b/spec/volume_spec.rb @@ -6,7 +6,7 @@ require_relative 'spec_helper' describe 'openstack-block-storage::volume' do describe 'ubuntu' do - let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) } + let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) }