From 1aeeca97dd9fed73a89b7613401a0d92157b8e1d Mon Sep 17 00:00:00 2001 From: Nathan Cerny Date: Tue, 24 Jan 2017 08:56:30 -0600 Subject: [PATCH 1/5] Unit test framework and automate unit tests. Signed-off-by: Nathan Cerny --- Berksfile | 7 +- libraries/matchers.rb | 57 +++++++ resources/automate.rb | 19 ++- spec/spec_helper.rb | 2 + spec/unit/chef_automate_spec.rb | 141 ++++++++++++++++++ spec/unit/recipes/default_spec.rb | 33 ---- test/fixtures/cookbooks/chef_test/metadata.rb | 4 + .../cookbooks/chef_test/recipes/automate.rb | 44 ++++++ test/{recipes => functional}/default_test.rb | 0 9 files changed, 258 insertions(+), 49 deletions(-) create mode 100644 libraries/matchers.rb create mode 100644 spec/unit/chef_automate_spec.rb delete mode 100644 spec/unit/recipes/default_spec.rb create mode 100644 test/fixtures/cookbooks/chef_test/metadata.rb create mode 100644 test/fixtures/cookbooks/chef_test/recipes/automate.rb rename test/{recipes => functional}/default_test.rb (100%) diff --git a/Berksfile b/Berksfile index 77d0da8..8de1376 100644 --- a/Berksfile +++ b/Berksfile @@ -2,9 +2,4 @@ source 'https://supermarket.chef.io' metadata -group :test do - cookbook 'chef-services', - '>= 4.0.0', - git: 'https://github.com/stephenlauck/chef-services.git', - branch: 'ad/simplify_pkgs' -end +cookbook 'chef_test', path: 'test/fixtures/cookbooks/chef_test' diff --git a/libraries/matchers.rb b/libraries/matchers.rb new file mode 100644 index 0000000..9d759f9 --- /dev/null +++ b/libraries/matchers.rb @@ -0,0 +1,57 @@ +if defined?(ChefSpec) + def create_chef_automate(name) + ChefSpec::Matchers::ResourceMatcher.new(:chef_automate, :create, name) + end + + def create_backend_cluster(name) + ChefSpec::Matchers::ResourceMatcher.new(:chef_backend, :create, name) + end + + def join_backend_cluster(name) + ChefSpec::Matchers::ResourceMatcher.new(:chef_backend, :join, name) + end + + def create_chef_org(name) + ChefSpec::Matchers::ResourceMatcher.new(:chef_org, :create, name) + end + + def delete_chef_org(name) + ChefSpec::Matchers::ResourceMatcher.new(:chef_org, :delete, name) + end + + def create_chef_user(name) + ChefSpec::Matchers::ResourceMatcher.new(:chef_user, :create, name) + end + + def delete_chef_user(name) + ChefSpec::Matchers::ResourceMatcher.new(:chef_user, :delete, name) + end + + def install_chef_client(name) + ChefSpec::Matchers::ResourceMatcher.new(:chef_client, :install, name) + end + + def register_chef_client(name) + ChefSpec::Matchers::ResourceMatcher.new(:chef_client, :register, name) + end + + def run_chef_client(name) + ChefSpec::Matchers::ResourceMatcher.new(:chef_client, :run, name) + end + + def create_chef_file(name) + ChefSpec::Matchers::ResourceMatcher.new(:chef_file, :create, name) + end + + def create_chef_server(name) + ChefSpec::Matchers::ResourceMatcher.new(:chef_server, :create, name) + end + + def create_chef_supermarket(name) + ChefSpec::Matchers::ResourceMatcher.new(:chef_supermarket, :create, name) + end + + def create_build_node(name) + ChefSpec::Matchers::ResourceMatcher.new(:workflow_builder, :create, name) + end +end diff --git a/resources/automate.rb b/resources/automate.rb index 1ba345a..ec8af1a 100644 --- a/resources/automate.rb +++ b/resources/automate.rb @@ -57,11 +57,10 @@ accept_license new_resource.accept_license end - directory '/etc/delivery' - directory '/etc/chef' - - directory '/var/opt/delivery/license/' do - recursive true + %w(/etc/delivery /etc/chef /var/opt/delivery/license).each do |dir| + directory dir do + recursive true + end end { @@ -85,16 +84,16 @@ mode '0644' end - directory '/var/opt/delivery/nginx/etc/addon.d/' do + directory '/var/opt/delivery/nginx/etc/addon.d' do recursive true end file '/var/opt/delivery/nginx/etc/addon.d/99-installer_internal.conf' do content <<-EOF - location /installer { - alias /opt/delivery/embedded/service/omnibus-ctl/installer; - } - EOF +location /installer { + alias /opt/delivery/embedded/service/omnibus-ctl/installer; +} +EOF end ingredient_config 'automate' do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1dd5126..4e00004 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,2 +1,4 @@ require 'chefspec' require 'chefspec/berkshelf' + +at_exit { ChefSpec::Coverage.report! } diff --git a/spec/unit/chef_automate_spec.rb b/spec/unit/chef_automate_spec.rb new file mode 100644 index 0000000..6af36ab --- /dev/null +++ b/spec/unit/chef_automate_spec.rb @@ -0,0 +1,141 @@ +# +# Cookbook Name:: chef_stack +# Spec:: chef_automate +# +# Copyright 2016 Chef Software Inc +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# rubocop:disable LineLength + +insecure_key = <<-EOS +-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzI +w+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoP +kcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2 +hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NO +Td0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcW +yLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQIBIwKCAQEA4iqWPJXtzZA68mKd +ELs4jJsdyky+ewdZeNds5tjcnHU5zUYE25K+ffJED9qUWICcLZDc81TGWjHyAqD1 +Bw7XpgUwFgeUJwUlzQurAv+/ySnxiwuaGJfhFM1CaQHzfXphgVml+fZUvnJUTvzf +TK2Lg6EdbUE9TarUlBf/xPfuEhMSlIE5keb/Zz3/LUlRg8yDqz5w+QWVJ4utnKnK +iqwZN0mwpwU7YSyJhlT4YV1F3n4YjLswM5wJs2oqm0jssQu/BT0tyEXNDYBLEF4A +sClaWuSJ2kjq7KhrrYXzagqhnSei9ODYFShJu8UWVec3Ihb5ZXlzO6vdNQ1J9Xsf +4m+2ywKBgQD6qFxx/Rv9CNN96l/4rb14HKirC2o/orApiHmHDsURs5rUKDx0f9iP +cXN7S1uePXuJRK/5hsubaOCx3Owd2u9gD6Oq0CsMkE4CUSiJcYrMANtx54cGH7Rk +EjFZxK8xAv1ldELEyxrFqkbE4BKd8QOt414qjvTGyAK+OLD3M2QdCQKBgQDtx8pN +CAxR7yhHbIWT1AH66+XWN8bXq7l3RO/ukeaci98JfkbkxURZhtxV/HHuvUhnPLdX +3TwygPBYZFNo4pzVEhzWoTtnEtrFueKxyc3+LjZpuo+mBlQ6ORtfgkr9gBVphXZG +YEzkCD3lVdl8L4cw9BVpKrJCs1c5taGjDgdInQKBgHm/fVvv96bJxc9x1tffXAcj +3OVdUN0UgXNCSaf/3A/phbeBQe9xS+3mpc4r6qvx+iy69mNBeNZ0xOitIjpjBo2+ +dBEjSBwLk5q5tJqHmy/jKMJL4n9ROlx93XS+njxgibTvU6Fp9w+NOFD/HvxB3Tcz +6+jJF85D5BNAG3DBMKBjAoGBAOAxZvgsKN+JuENXsST7F89Tck2iTcQIT8g5rwWC +P9Vt74yboe2kDT531w8+egz7nAmRBKNM751U/95P9t88EDacDI/Z2OwnuFQHCPDF +llYOUI+SpLJ6/vURRbHSnnn8a/XG+nzedGH5JGqEJNQsz+xT2axM0/W/CRknmGaJ +kda/AoGANWrLCz708y7VYgAtW2Uf1DPOIYMdvo6fxIB5i9ZfISgcJ/bbCUkFrhoH ++vq/5CIWxCPp0f85R4qxxQ5ihxJ0YDQT9Jpx4TMss4PSavPaBH3RXow5Ohe+bYoQ +NE5OgEXk2wVfZczCZpigBKbKZHNYcelXtTt/nP3rsCuGcM4h53s= +-----END RSA PRIVATE KEY----- +EOS + +require 'spec_helper' + +describe 'chef_test::automate' do + cached(:centos_7_2) do + stub_command('delivery-ctl list-enterprises --ssh-pub-key-file=/etc/delivery/builder_key.pub | grep -w test').and_return(false) + ChefSpec::ServerRunner.new( + step_into: 'chef_automate', + platform: 'centos', + version: '7.2.1511' + ).converge(described_recipe) + end + + context 'compiling the recipe' do + it 'creates chef_automate[automate.chefstack.local]' do + expect(centos_7_2).to create_chef_automate('automate.chefstack.local') + end + end + + context 'stepping into chef_automate' do + it 'upgrades chef_ingredient[automate]' do + expect(centos_7_2).to upgrade_chef_ingredient('automate') + .with( + channel: :current, + version: '0.6.64', + accept_license: true, + enterprise: ['test'], + license: 'license', + chef_user: 'chef_user', + chef_user_pem: insecure_key, + validation_pem: insecure_key, + builder_pem: insecure_key + ) + end + + it 'creates required directories' do + [ + '/var/opt/delivery/license', + '/etc/delivery', + '/etc/chef' + ].each do |dir| + expect(centos_7_2).to create_directory(dir) + end + end + + it 'creates automate keys' do + { + '/var/opt/delivery/license/delivery.license' => 'license', + '/etc/delivery/chef_user.pem' => insecure_key, + '/etc/chef/validation.pem' => insecure_key, + '/etc/delivery/builder_key' => insecure_key + }.each do |file, src| + expect(centos_7_2).to create_chef_file(file) + .with( + source: src, + user: 'root', + group: 'root', + mode: '0600' + ) + end + end + + it 'creates the builder public key' do + expect(centos_7_2).to create_file('/etc/delivery/builder_key.pub') + .with( + user: 'root', + group: 'root', + mode: '0644' + ) + end + + it 'configures nginx to host installation files' do + expect(centos_7_2).to create_directory('/var/opt/delivery/nginx/etc/addon.d') + expect(centos_7_2).to create_file('/var/opt/delivery/nginx/etc/addon.d/99-installer_internal.conf') + .with( + content: <<-EOF +location /installer { + alias /opt/delivery/embedded/service/omnibus-ctl/installer; +} +EOF + ) + end + + it 'reconfigures automate' do + expect(centos_7_2).to render_ingredient_config('automate') + expect(centos_7_2.ingredient_config('automate')).to notify('chef_ingredient[automate]').to(:reconfigure).immediately + end + + it 'configures automate enterprises' do + expect(centos_7_2).to run_execute('create enterprise test') + end + end +end diff --git a/spec/unit/recipes/default_spec.rb b/spec/unit/recipes/default_spec.rb deleted file mode 100644 index 9bcdc6e..0000000 --- a/spec/unit/recipes/default_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -# -# Cookbook Name:: chef_stack -# Spec:: default -# -# Copyright 2016 Chef Software Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require 'spec_helper' - -describe 'chef_stack::default' do - context 'When all attributes are default, on an unspecified platform' do - let(:chef_run) do - runner = ChefSpec::ServerRunner.new - runner.converge(described_recipe) - end - - it 'converges successfully' do - expect { chef_run }.to_not raise_error - end - end -end diff --git a/test/fixtures/cookbooks/chef_test/metadata.rb b/test/fixtures/cookbooks/chef_test/metadata.rb new file mode 100644 index 0000000..3df8494 --- /dev/null +++ b/test/fixtures/cookbooks/chef_test/metadata.rb @@ -0,0 +1,4 @@ +name 'chef_test' +version '0.1.0' + +depends 'chef_stack' diff --git a/test/fixtures/cookbooks/chef_test/recipes/automate.rb b/test/fixtures/cookbooks/chef_test/recipes/automate.rb new file mode 100644 index 0000000..7254ed5 --- /dev/null +++ b/test/fixtures/cookbooks/chef_test/recipes/automate.rb @@ -0,0 +1,44 @@ +insecure_key = <<-EOS +-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzI +w+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoP +kcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2 +hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NO +Td0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcW +yLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQIBIwKCAQEA4iqWPJXtzZA68mKd +ELs4jJsdyky+ewdZeNds5tjcnHU5zUYE25K+ffJED9qUWICcLZDc81TGWjHyAqD1 +Bw7XpgUwFgeUJwUlzQurAv+/ySnxiwuaGJfhFM1CaQHzfXphgVml+fZUvnJUTvzf +TK2Lg6EdbUE9TarUlBf/xPfuEhMSlIE5keb/Zz3/LUlRg8yDqz5w+QWVJ4utnKnK +iqwZN0mwpwU7YSyJhlT4YV1F3n4YjLswM5wJs2oqm0jssQu/BT0tyEXNDYBLEF4A +sClaWuSJ2kjq7KhrrYXzagqhnSei9ODYFShJu8UWVec3Ihb5ZXlzO6vdNQ1J9Xsf +4m+2ywKBgQD6qFxx/Rv9CNN96l/4rb14HKirC2o/orApiHmHDsURs5rUKDx0f9iP +cXN7S1uePXuJRK/5hsubaOCx3Owd2u9gD6Oq0CsMkE4CUSiJcYrMANtx54cGH7Rk +EjFZxK8xAv1ldELEyxrFqkbE4BKd8QOt414qjvTGyAK+OLD3M2QdCQKBgQDtx8pN +CAxR7yhHbIWT1AH66+XWN8bXq7l3RO/ukeaci98JfkbkxURZhtxV/HHuvUhnPLdX +3TwygPBYZFNo4pzVEhzWoTtnEtrFueKxyc3+LjZpuo+mBlQ6ORtfgkr9gBVphXZG +YEzkCD3lVdl8L4cw9BVpKrJCs1c5taGjDgdInQKBgHm/fVvv96bJxc9x1tffXAcj +3OVdUN0UgXNCSaf/3A/phbeBQe9xS+3mpc4r6qvx+iy69mNBeNZ0xOitIjpjBo2+ +dBEjSBwLk5q5tJqHmy/jKMJL4n9ROlx93XS+njxgibTvU6Fp9w+NOFD/HvxB3Tcz +6+jJF85D5BNAG3DBMKBjAoGBAOAxZvgsKN+JuENXsST7F89Tck2iTcQIT8g5rwWC +P9Vt74yboe2kDT531w8+egz7nAmRBKNM751U/95P9t88EDacDI/Z2OwnuFQHCPDF +llYOUI+SpLJ6/vURRbHSnnn8a/XG+nzedGH5JGqEJNQsz+xT2axM0/W/CRknmGaJ +kda/AoGANWrLCz708y7VYgAtW2Uf1DPOIYMdvo6fxIB5i9ZfISgcJ/bbCUkFrhoH ++vq/5CIWxCPp0f85R4qxxQ5ihxJ0YDQT9Jpx4TMss4PSavPaBH3RXow5Ohe+bYoQ +NE5OgEXk2wVfZczCZpigBKbKZHNYcelXtTt/nP3rsCuGcM4h53s= +-----END RSA PRIVATE KEY----- +EOS + +chef_automate 'automate.chefstack.local' do + channel :current + version '0.6.64' + config <<-EOS + nginx['ssl_protocols'] = 'TLSv1.2' + EOS + accept_license true + enterprise 'test' + license 'license' + chef_user 'chef_user' + chef_user_pem insecure_key + validation_pem insecure_key + builder_pem insecure_key +end diff --git a/test/recipes/default_test.rb b/test/functional/default_test.rb similarity index 100% rename from test/recipes/default_test.rb rename to test/functional/default_test.rb From f8761b6009a18a2128fc8db5c98550e581ad25fa Mon Sep 17 00:00:00 2001 From: Nathan Cerny Date: Tue, 24 Jan 2017 11:01:35 -0600 Subject: [PATCH 2/5] Add unit tests for chef_file. Signed-off-by: Nathan Cerny --- spec/unit/chef_file_spec.rb | 74 +++++++++++++++++++ .../cookbooks/chef_test/recipes/file.rb | 20 +++++ 2 files changed, 94 insertions(+) create mode 100644 spec/unit/chef_file_spec.rb create mode 100644 test/fixtures/cookbooks/chef_test/recipes/file.rb diff --git a/spec/unit/chef_file_spec.rb b/spec/unit/chef_file_spec.rb new file mode 100644 index 0000000..0281b31 --- /dev/null +++ b/spec/unit/chef_file_spec.rb @@ -0,0 +1,74 @@ +# +# Cookbook Name:: chef_stack +# Spec:: chef_file +# +# Copyright 2016 Chef Software Inc +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# rubocop:disable LineLength + +require 'spec_helper' + +describe 'chef_test::file' do + cached(:centos_7_2) do + ChefSpec::ServerRunner.new( + step_into: 'chef_file', + platform: 'centos', + version: '7.2.1511' + ).converge(described_recipe) + end + + context 'compiling the recipe' do + it 'creates chef_file[/tmp/uri.test]' do + expect(centos_7_2).to create_chef_file('/tmp/remote_file') + end + it 'creates chef_file[/tmp/cookbook.test]' do + expect(centos_7_2).to create_chef_file('/tmp/cookbook_file') + end + it 'creates chef_file[/tmp/content.test]' do + expect(centos_7_2).to create_chef_file('/tmp/file') + end + end + + context 'stepping into chef_file' do + it 'correctly creates cookbook_files' do + expect(centos_7_2).to create_cookbook_file('/tmp/cookbook_file') + .with( + source: 'testfile', + cookbook: 'chef_test', + user: 'root', + group: 'root', + mode: '0600' + ) + end + it 'correctly creates remote_files' do + expect(centos_7_2).to create_remote_file('/tmp/remote_file') + .with( + source: 'https://www.example.com/test', + user: 'root', + group: 'root', + mode: '0600' + ) + end + it 'correctly creates files' do + expect(centos_7_2).to create_file('/tmp/file') + .with( + content: 'abcdef', + user: 'root', + group: 'root', + mode: '0600' + ) + expect(centos_7_2).to render_file('/tmp/file').with_content('abcdef') + end + end +end diff --git a/test/fixtures/cookbooks/chef_test/recipes/file.rb b/test/fixtures/cookbooks/chef_test/recipes/file.rb new file mode 100644 index 0000000..18a56c1 --- /dev/null +++ b/test/fixtures/cookbooks/chef_test/recipes/file.rb @@ -0,0 +1,20 @@ +chef_file '/tmp/remote_file' do + source 'https://www.example.com/test' + user 'root' + group 'root' + mode '0600' +end + +chef_file '/tmp/cookbook_file' do + source 'cookbook_file://chef_test::testfile' + user 'root' + group 'root' + mode '0600' +end + +chef_file '/tmp/file' do + source 'abcdef' + user 'root' + group 'root' + mode '0600' +end From 3759d89310ec5a86a247534cc25ef2c4f720cc98 Mon Sep 17 00:00:00 2001 From: Nathan Cerny Date: Sat, 1 Apr 2017 11:59:22 -0500 Subject: [PATCH 3/5] stub delivery-ctl status command. Signed-off-by: Nathan Cerny --- spec/unit/chef_automate_spec.rb | 6 +++--- spec/unit/chef_file_spec.rb | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/spec/unit/chef_automate_spec.rb b/spec/unit/chef_automate_spec.rb index 6af36ab..6ef96b6 100644 --- a/spec/unit/chef_automate_spec.rb +++ b/spec/unit/chef_automate_spec.rb @@ -15,7 +15,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# rubocop:disable LineLength insecure_key = <<-EOS -----BEGIN RSA PRIVATE KEY----- @@ -52,6 +51,7 @@ describe 'chef_test::automate' do cached(:centos_7_2) do stub_command('delivery-ctl list-enterprises --ssh-pub-key-file=/etc/delivery/builder_key.pub | grep -w test').and_return(false) + stub_command('delivery-ctl status').and_return(false) ChefSpec::ServerRunner.new( step_into: 'chef_automate', platform: 'centos', @@ -85,7 +85,7 @@ [ '/var/opt/delivery/license', '/etc/delivery', - '/etc/chef' + '/etc/chef', ].each do |dir| expect(centos_7_2).to create_directory(dir) end @@ -96,7 +96,7 @@ '/var/opt/delivery/license/delivery.license' => 'license', '/etc/delivery/chef_user.pem' => insecure_key, '/etc/chef/validation.pem' => insecure_key, - '/etc/delivery/builder_key' => insecure_key + '/etc/delivery/builder_key' => insecure_key, }.each do |file, src| expect(centos_7_2).to create_chef_file(file) .with( diff --git a/spec/unit/chef_file_spec.rb b/spec/unit/chef_file_spec.rb index 0281b31..2dddd88 100644 --- a/spec/unit/chef_file_spec.rb +++ b/spec/unit/chef_file_spec.rb @@ -15,7 +15,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# rubocop:disable LineLength require 'spec_helper' From f2d6b19c5d4d661f7c172287da10b3f7b5e00644 Mon Sep 17 00:00:00 2001 From: Nathan Cerny Date: Sat, 1 Apr 2017 12:23:37 -0500 Subject: [PATCH 4/5] Fix stub - status should be true, not false. Signed-off-by: Nathan Cerny --- spec/unit/chef_automate_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/chef_automate_spec.rb b/spec/unit/chef_automate_spec.rb index 6ef96b6..c633456 100644 --- a/spec/unit/chef_automate_spec.rb +++ b/spec/unit/chef_automate_spec.rb @@ -51,7 +51,7 @@ describe 'chef_test::automate' do cached(:centos_7_2) do stub_command('delivery-ctl list-enterprises --ssh-pub-key-file=/etc/delivery/builder_key.pub | grep -w test').and_return(false) - stub_command('delivery-ctl status').and_return(false) + stub_command('delivery-ctl status').and_return(true) ChefSpec::ServerRunner.new( step_into: 'chef_automate', platform: 'centos', From 64708d12b3652afbc87b7129c1c0911d68196217 Mon Sep 17 00:00:00 2001 From: Nathan Cerny Date: Sat, 1 Apr 2017 13:18:47 -0500 Subject: [PATCH 5/5] Version Bump - 0.6.2 Signed-off-by: Nathan Cerny --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index facaaa6..130d0df 100644 --- a/metadata.rb +++ b/metadata.rb @@ -7,6 +7,6 @@ long_description 'Resource Cookbook for Managing Chef Software Inc Product Suite' issues_url 'https://github.com/ncerny/chef_stack/issues' if respond_to?(:issues_url) source_url 'https://github.com/ncerny/chef_stack' if respond_to?(:source_url) -version '0.6.1' +version '0.6.2' depends 'chef-ingredient'