poise-build-essential 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.kitchen.yml +3 -0
- data/.travis.yml +60 -0
- data/.yardopts +7 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +35 -0
- data/LICENSE +201 -0
- data/README.md +85 -0
- data/Rakefile +17 -0
- data/chef/attributes/default.rb +21 -0
- data/chef/recipes/default.rb +19 -0
- data/lib/poise_build_essential.rb +22 -0
- data/lib/poise_build_essential/build_essential_providers.rb +49 -0
- data/lib/poise_build_essential/build_essential_providers/base.rb +103 -0
- data/lib/poise_build_essential/build_essential_providers/debian.rb +41 -0
- data/lib/poise_build_essential/build_essential_providers/freebsd.rb +46 -0
- data/lib/poise_build_essential/build_essential_providers/mac_os_x.rb +66 -0
- data/lib/poise_build_essential/build_essential_providers/omnios.rb +46 -0
- data/lib/poise_build_essential/build_essential_providers/rhel.rb +46 -0
- data/lib/poise_build_essential/build_essential_providers/smartos.rb +39 -0
- data/lib/poise_build_essential/build_essential_providers/solaris.rb +47 -0
- data/lib/poise_build_essential/build_essential_providers/suse.rb +43 -0
- data/lib/poise_build_essential/build_essential_providers/windows.rb +68 -0
- data/lib/poise_build_essential/cheftie.rb +18 -0
- data/lib/poise_build_essential/resources.rb +26 -0
- data/lib/poise_build_essential/resources/poise_build_essential.rb +48 -0
- data/lib/poise_build_essential/version.rb +20 -0
- data/poise-build-essential.gemspec +42 -0
- data/test/cookbook/attributes/default.rb +17 -0
- data/test/cookbook/metadata.rb +18 -0
- data/test/cookbook/recipes/default.rb +37 -0
- data/test/gemfiles/chef-12.1.gemfile +23 -0
- data/test/gemfiles/chef-12.10.gemfile +23 -0
- data/test/gemfiles/chef-12.11.gemfile +23 -0
- data/test/gemfiles/chef-12.12.gemfile +22 -0
- data/test/gemfiles/chef-12.13.gemfile +22 -0
- data/test/gemfiles/chef-12.14.gemfile +19 -0
- data/test/gemfiles/chef-12.15.gemfile +19 -0
- data/test/gemfiles/chef-12.16.gemfile +19 -0
- data/test/gemfiles/chef-12.17.gemfile +19 -0
- data/test/gemfiles/chef-12.18.gemfile +19 -0
- data/test/gemfiles/chef-12.19.gemfile +19 -0
- data/test/gemfiles/chef-12.2.gemfile +23 -0
- data/test/gemfiles/chef-12.3.gemfile +23 -0
- data/test/gemfiles/chef-12.4.gemfile +24 -0
- data/test/gemfiles/chef-12.5.gemfile +23 -0
- data/test/gemfiles/chef-12.6.gemfile +23 -0
- data/test/gemfiles/chef-12.7.gemfile +23 -0
- data/test/gemfiles/chef-12.8.gemfile +23 -0
- data/test/gemfiles/chef-12.9.gemfile +23 -0
- data/test/gemfiles/chef-12.gemfile +19 -0
- data/test/gemfiles/master.gemfile +26 -0
- data/test/integration/default/serverspec/default_spec.rb +27 -0
- data/test/spec/build_essential_providers/debian_spec.rb +49 -0
- data/test/spec/build_essential_providers/freebsd_spec.rb +68 -0
- data/test/spec/build_essential_providers/mac_os_x_spec.rb +52 -0
- data/test/spec/build_essential_providers/omnios_spec.rb +67 -0
- data/test/spec/build_essential_providers/rhel_spec.rb +54 -0
- data/test/spec/build_essential_providers/smartos_spec.rb +64 -0
- data/test/spec/build_essential_providers/solaris_spec.rb +108 -0
- data/test/spec/build_essential_providers/suse_spec.rb +54 -0
- data/test/spec/recipe_spec.rb +35 -0
- data/test/spec/resources/poise_build_essential_spec.rb +49 -0
- data/test/spec/spec_helper.rb +19 -0
- metadata +210 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
require 'serverspec'
|
18
|
+
set :backend, :exec
|
19
|
+
|
20
|
+
describe command('sh -c "cd /build_essential_test && make"') do
|
21
|
+
its(:exit_status) { is_expected.to eq 0 }
|
22
|
+
end
|
23
|
+
|
24
|
+
describe command('/build_essential_test/hello') do
|
25
|
+
its(:exit_status) { is_expected.to eq 0 }
|
26
|
+
its(:stdout) { is_expected.to eq "Hello, World!\n" }
|
27
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
require 'spec_helper'
|
18
|
+
|
19
|
+
describe PoiseBuildEssential::BuildEssentialProviders::Debian do
|
20
|
+
let(:chefspec_options) { {platform: 'ubuntu', version: '16.04'} }
|
21
|
+
step_into(:poise_build_essential)
|
22
|
+
|
23
|
+
describe 'action :install' do
|
24
|
+
recipe do
|
25
|
+
poise_build_essential 'build_essential' do
|
26
|
+
action :install
|
27
|
+
end
|
28
|
+
end
|
29
|
+
it { is_expected.to install_package(%w{autoconf binutils-doc bison build-essential flex gettext ncurses-dev}) }
|
30
|
+
end # /describe action :install
|
31
|
+
|
32
|
+
describe 'action :upgrade' do
|
33
|
+
recipe do
|
34
|
+
poise_build_essential 'build_essential' do
|
35
|
+
action :upgrade
|
36
|
+
end
|
37
|
+
end
|
38
|
+
it { is_expected.to upgrade_package(%w{autoconf binutils-doc bison build-essential flex gettext ncurses-dev}) }
|
39
|
+
end # /describe action :upgrade
|
40
|
+
|
41
|
+
describe 'action :remove' do
|
42
|
+
recipe do
|
43
|
+
poise_build_essential 'build_essential' do
|
44
|
+
action :remove
|
45
|
+
end
|
46
|
+
end
|
47
|
+
it { is_expected.to remove_package(%w{autoconf binutils-doc bison build-essential flex gettext ncurses-dev}) }
|
48
|
+
end # /describe action :remove
|
49
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
require 'spec_helper'
|
18
|
+
|
19
|
+
describe PoiseBuildEssential::BuildEssentialProviders::FreeBSD do
|
20
|
+
let(:chefspec_options) { {platform: 'freebsd', version: '11.0'} }
|
21
|
+
step_into(:poise_build_essential)
|
22
|
+
|
23
|
+
describe 'action :install' do
|
24
|
+
recipe do
|
25
|
+
poise_build_essential 'build_essential' do
|
26
|
+
action :install
|
27
|
+
end
|
28
|
+
end
|
29
|
+
it { is_expected.to install_package('devel/gmake') }
|
30
|
+
it { is_expected.to install_package('devel/autoconf') }
|
31
|
+
it { is_expected.to install_package('devel/m4') }
|
32
|
+
it { is_expected.to install_package('devel/gettext') }
|
33
|
+
it { is_expected.to_not install_package('lang/gcc49') }
|
34
|
+
|
35
|
+
context 'on FreeBSD 9.3' do
|
36
|
+
let(:chefspec_options) { {platform: 'freebsd', version: '9.3'} }
|
37
|
+
it { is_expected.to install_package('devel/gmake') }
|
38
|
+
it { is_expected.to install_package('devel/autoconf') }
|
39
|
+
it { is_expected.to install_package('devel/m4') }
|
40
|
+
it { is_expected.to install_package('devel/gettext') }
|
41
|
+
it { is_expected.to install_package('lang/gcc49') }
|
42
|
+
end # /context on FreeBSD 9.3
|
43
|
+
end # /describe action :install
|
44
|
+
|
45
|
+
describe 'action :upgrade' do
|
46
|
+
recipe do
|
47
|
+
poise_build_essential 'build_essential' do
|
48
|
+
action :upgrade
|
49
|
+
end
|
50
|
+
end
|
51
|
+
it { is_expected.to upgrade_package('devel/gmake') }
|
52
|
+
it { is_expected.to upgrade_package('devel/autoconf') }
|
53
|
+
it { is_expected.to upgrade_package('devel/m4') }
|
54
|
+
it { is_expected.to upgrade_package('devel/gettext') }
|
55
|
+
end # /describe action :upgrade
|
56
|
+
|
57
|
+
describe 'action :remove' do
|
58
|
+
recipe do
|
59
|
+
poise_build_essential 'build_essential' do
|
60
|
+
action :remove
|
61
|
+
end
|
62
|
+
end
|
63
|
+
it { is_expected.to remove_package('devel/gmake') }
|
64
|
+
it { is_expected.to remove_package('devel/autoconf') }
|
65
|
+
it { is_expected.to remove_package('devel/m4') }
|
66
|
+
it { is_expected.to remove_package('devel/gettext') }
|
67
|
+
end # /describe action :remove
|
68
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
require 'spec_helper'
|
18
|
+
|
19
|
+
describe PoiseBuildEssential::BuildEssentialProviders::MacOSX do
|
20
|
+
let(:chefspec_options) { {platform: 'mac_os_x', version: '10.12'} }
|
21
|
+
step_into(:poise_build_essential)
|
22
|
+
before do
|
23
|
+
stub_command('pkgutil --pkgs=com.apple.pkg.CLTools_Executables').and_return(false)
|
24
|
+
end
|
25
|
+
|
26
|
+
describe 'action :install' do
|
27
|
+
recipe do
|
28
|
+
poise_build_essential 'build_essential' do
|
29
|
+
action :install
|
30
|
+
end
|
31
|
+
end
|
32
|
+
it { is_expected.to run_execute('install XCode Command Line tools') }
|
33
|
+
end # /describe action :install
|
34
|
+
|
35
|
+
describe 'action :upgrade' do
|
36
|
+
recipe do
|
37
|
+
poise_build_essential 'build_essential' do
|
38
|
+
action :upgrade
|
39
|
+
end
|
40
|
+
end
|
41
|
+
it { is_expected.to run_execute('install XCode Command Line tools') }
|
42
|
+
end # /describe action :upgrade
|
43
|
+
|
44
|
+
describe 'action :remove' do
|
45
|
+
recipe do
|
46
|
+
poise_build_essential 'build_essential' do
|
47
|
+
action :remove
|
48
|
+
end
|
49
|
+
end
|
50
|
+
it { expect { subject }.to raise_error NotImplementedError }
|
51
|
+
end # /describe action :remove
|
52
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
require 'spec_helper'
|
18
|
+
|
19
|
+
describe PoiseBuildEssential::BuildEssentialProviders::OmniOS do
|
20
|
+
let(:chefspec_options) { {platform: 'omnios', version: '151018'} }
|
21
|
+
step_into(:poise_build_essential)
|
22
|
+
|
23
|
+
describe 'action :install' do
|
24
|
+
recipe do
|
25
|
+
poise_build_essential 'build_essential' do
|
26
|
+
action :install
|
27
|
+
end
|
28
|
+
end
|
29
|
+
it { is_expected.to install_package('developer/gcc48') }
|
30
|
+
it { is_expected.to install_package('developer/object-file') }
|
31
|
+
it { is_expected.to install_package('developer/linker') }
|
32
|
+
it { is_expected.to install_package('developer/library/lint') }
|
33
|
+
it { is_expected.to install_package('developer/build/gnu-make') }
|
34
|
+
it { is_expected.to install_package('system/header') }
|
35
|
+
it { is_expected.to install_package('system/library/math/header-math') }
|
36
|
+
end # /describe action :install
|
37
|
+
|
38
|
+
describe 'action :upgrade' do
|
39
|
+
recipe do
|
40
|
+
poise_build_essential 'build_essential' do
|
41
|
+
action :upgrade
|
42
|
+
end
|
43
|
+
end
|
44
|
+
it { is_expected.to upgrade_package('developer/gcc48') }
|
45
|
+
it { is_expected.to upgrade_package('developer/object-file') }
|
46
|
+
it { is_expected.to upgrade_package('developer/linker') }
|
47
|
+
it { is_expected.to upgrade_package('developer/library/lint') }
|
48
|
+
it { is_expected.to upgrade_package('developer/build/gnu-make') }
|
49
|
+
it { is_expected.to upgrade_package('system/header') }
|
50
|
+
it { is_expected.to upgrade_package('system/library/math/header-math') }
|
51
|
+
end # /describe action :upgrade
|
52
|
+
|
53
|
+
describe 'action :remove' do
|
54
|
+
recipe do
|
55
|
+
poise_build_essential 'build_essential' do
|
56
|
+
action :remove
|
57
|
+
end
|
58
|
+
end
|
59
|
+
it { is_expected.to remove_package('developer/gcc48') }
|
60
|
+
it { is_expected.to remove_package('developer/object-file') }
|
61
|
+
it { is_expected.to remove_package('developer/linker') }
|
62
|
+
it { is_expected.to remove_package('developer/library/lint') }
|
63
|
+
it { is_expected.to remove_package('developer/build/gnu-make') }
|
64
|
+
it { is_expected.to remove_package('system/header') }
|
65
|
+
it { is_expected.to remove_package('system/library/math/header-math') }
|
66
|
+
end # /describe action :remove
|
67
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
require 'spec_helper'
|
18
|
+
|
19
|
+
describe PoiseBuildEssential::BuildEssentialProviders::RHEL do
|
20
|
+
let(:chefspec_options) { {platform: 'redhat', version: '7.3'} }
|
21
|
+
step_into(:poise_build_essential)
|
22
|
+
|
23
|
+
describe 'action :install' do
|
24
|
+
recipe do
|
25
|
+
poise_build_essential 'build_essential' do
|
26
|
+
action :install
|
27
|
+
end
|
28
|
+
end
|
29
|
+
it { is_expected.to install_package(%w{autoconf bison flex gcc gcc-c++ gettext kernel-devel make m4 ncurses-devel patch}) }
|
30
|
+
|
31
|
+
context 'on RedHat 5.10' do
|
32
|
+
let(:chefspec_options) { {platform: 'redhat', version: '5.10'} }
|
33
|
+
it { is_expected.to install_package(%w{autoconf bison flex gcc gcc-c++ gettext kernel-devel make m4 ncurses-devel patch gcc44 gcc44-c++}) }
|
34
|
+
end # /context on RedHat 5.10
|
35
|
+
end # /describe action :install
|
36
|
+
|
37
|
+
describe 'action :upgrade' do
|
38
|
+
recipe do
|
39
|
+
poise_build_essential 'build_essential' do
|
40
|
+
action :upgrade
|
41
|
+
end
|
42
|
+
end
|
43
|
+
it { is_expected.to upgrade_package(%w{autoconf bison flex gcc gcc-c++ gettext kernel-devel make m4 ncurses-devel patch}) }
|
44
|
+
end # /describe action :upgrade
|
45
|
+
|
46
|
+
describe 'action :remove' do
|
47
|
+
recipe do
|
48
|
+
poise_build_essential 'build_essential' do
|
49
|
+
action :remove
|
50
|
+
end
|
51
|
+
end
|
52
|
+
it { is_expected.to remove_package(%w{autoconf bison flex gcc gcc-c++ gettext kernel-devel make m4 ncurses-devel patch}) }
|
53
|
+
end # /describe action :remove
|
54
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
require 'spec_helper'
|
18
|
+
|
19
|
+
describe PoiseBuildEssential::BuildEssentialProviders::SmartOS do
|
20
|
+
let(:chefspec_options) { {platform: 'smartos', version: '5.11'} }
|
21
|
+
step_into(:poise_build_essential)
|
22
|
+
|
23
|
+
describe 'action :install' do
|
24
|
+
recipe do
|
25
|
+
poise_build_essential 'build_essential' do
|
26
|
+
action :install
|
27
|
+
end
|
28
|
+
end
|
29
|
+
it { is_expected.to install_package('autoconf') }
|
30
|
+
it { is_expected.to install_package('binutils') }
|
31
|
+
it { is_expected.to install_package('build-essential') }
|
32
|
+
it { is_expected.to install_package('gcc47') }
|
33
|
+
it { is_expected.to install_package('gmake') }
|
34
|
+
it { is_expected.to install_package('pkg-config') }
|
35
|
+
end # /describe action :install
|
36
|
+
|
37
|
+
describe 'action :upgrade' do
|
38
|
+
recipe do
|
39
|
+
poise_build_essential 'build_essential' do
|
40
|
+
action :upgrade
|
41
|
+
end
|
42
|
+
end
|
43
|
+
it { is_expected.to upgrade_package('autoconf') }
|
44
|
+
it { is_expected.to upgrade_package('binutils') }
|
45
|
+
it { is_expected.to upgrade_package('build-essential') }
|
46
|
+
it { is_expected.to upgrade_package('gcc47') }
|
47
|
+
it { is_expected.to upgrade_package('gmake') }
|
48
|
+
it { is_expected.to upgrade_package('pkg-config') }
|
49
|
+
end # /describe action :upgrade
|
50
|
+
|
51
|
+
describe 'action :remove' do
|
52
|
+
recipe do
|
53
|
+
poise_build_essential 'build_essential' do
|
54
|
+
action :remove
|
55
|
+
end
|
56
|
+
end
|
57
|
+
it { is_expected.to remove_package('autoconf') }
|
58
|
+
it { is_expected.to remove_package('binutils') }
|
59
|
+
it { is_expected.to remove_package('build-essential') }
|
60
|
+
it { is_expected.to remove_package('gcc47') }
|
61
|
+
it { is_expected.to remove_package('gmake') }
|
62
|
+
it { is_expected.to remove_package('pkg-config') }
|
63
|
+
end # /describe action :remove
|
64
|
+
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2017, Noah Kantrowitz
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
|
17
|
+
require 'spec_helper'
|
18
|
+
|
19
|
+
describe PoiseBuildEssential::BuildEssentialProviders::Solaris do
|
20
|
+
let(:chefspec_options) { {platform: 'solaris2', version: '5.11'} }
|
21
|
+
step_into(:poise_build_essential)
|
22
|
+
|
23
|
+
describe 'action :install' do
|
24
|
+
recipe do
|
25
|
+
poise_build_essential 'build_essential' do
|
26
|
+
action :install
|
27
|
+
end
|
28
|
+
end
|
29
|
+
it { is_expected.to install_package('gcc').with(version: '4.8.2') }
|
30
|
+
it { is_expected.to install_package('autoconf') }
|
31
|
+
it { is_expected.to install_package('automake') }
|
32
|
+
it { is_expected.to install_package('bison') }
|
33
|
+
it { is_expected.to install_package('gnu-coreutils') }
|
34
|
+
it { is_expected.to install_package('flex') }
|
35
|
+
it { is_expected.to install_package('gcc-3') }
|
36
|
+
it { is_expected.to install_package('gnu-grep') }
|
37
|
+
it { is_expected.to install_package('gnu-make') }
|
38
|
+
it { is_expected.to install_package('gnu-patch') }
|
39
|
+
it { is_expected.to install_package('gnu-tar') }
|
40
|
+
it { is_expected.to install_package('make') }
|
41
|
+
it { is_expected.to install_package('pkg-config') }
|
42
|
+
it { is_expected.to install_package('ucb') }
|
43
|
+
|
44
|
+
context 'on Solaris 10' do
|
45
|
+
let(:chefspec_options) { {platform: 'solaris2', version: '5.10'} }
|
46
|
+
it { expect { subject }.to raise_error RuntimeError }
|
47
|
+
|
48
|
+
context 'with allow_unsupported_platform' do
|
49
|
+
recipe do
|
50
|
+
poise_build_essential 'build_essential' do
|
51
|
+
action :install
|
52
|
+
allow_unsupported_platform true
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
it do
|
57
|
+
expect(Chef::Log).to receive(:warn)
|
58
|
+
# Confirm that no packages or anything else got installed.
|
59
|
+
expect(chef_run.run_context.resource_collection.map(&:to_s)).to eq %w{poise_build_essential[build_essential]}
|
60
|
+
end
|
61
|
+
end # /context with allow_unsupported_platform
|
62
|
+
end # /context on Solaris 10
|
63
|
+
end # /describe action :install
|
64
|
+
|
65
|
+
describe 'action :upgrade' do
|
66
|
+
recipe do
|
67
|
+
poise_build_essential 'build_essential' do
|
68
|
+
action :upgrade
|
69
|
+
end
|
70
|
+
end
|
71
|
+
it { is_expected.to upgrade_package('gcc').with(version: '4.8.2') }
|
72
|
+
it { is_expected.to upgrade_package('autoconf') }
|
73
|
+
it { is_expected.to upgrade_package('automake') }
|
74
|
+
it { is_expected.to upgrade_package('bison') }
|
75
|
+
it { is_expected.to upgrade_package('gnu-coreutils') }
|
76
|
+
it { is_expected.to upgrade_package('flex') }
|
77
|
+
it { is_expected.to upgrade_package('gcc-3') }
|
78
|
+
it { is_expected.to upgrade_package('gnu-grep') }
|
79
|
+
it { is_expected.to upgrade_package('gnu-make') }
|
80
|
+
it { is_expected.to upgrade_package('gnu-patch') }
|
81
|
+
it { is_expected.to upgrade_package('gnu-tar') }
|
82
|
+
it { is_expected.to upgrade_package('make') }
|
83
|
+
it { is_expected.to upgrade_package('pkg-config') }
|
84
|
+
it { is_expected.to upgrade_package('ucb') }
|
85
|
+
end # /describe action :upgrade
|
86
|
+
|
87
|
+
describe 'action :remove' do
|
88
|
+
recipe do
|
89
|
+
poise_build_essential 'build_essential' do
|
90
|
+
action :remove
|
91
|
+
end
|
92
|
+
end
|
93
|
+
it { is_expected.to remove_package('gcc') }
|
94
|
+
it { is_expected.to remove_package('autoconf') }
|
95
|
+
it { is_expected.to remove_package('automake') }
|
96
|
+
it { is_expected.to remove_package('bison') }
|
97
|
+
it { is_expected.to remove_package('gnu-coreutils') }
|
98
|
+
it { is_expected.to remove_package('flex') }
|
99
|
+
it { is_expected.to remove_package('gcc-3') }
|
100
|
+
it { is_expected.to remove_package('gnu-grep') }
|
101
|
+
it { is_expected.to remove_package('gnu-make') }
|
102
|
+
it { is_expected.to remove_package('gnu-patch') }
|
103
|
+
it { is_expected.to remove_package('gnu-tar') }
|
104
|
+
it { is_expected.to remove_package('make') }
|
105
|
+
it { is_expected.to remove_package('pkg-config') }
|
106
|
+
it { is_expected.to remove_package('ucb') }
|
107
|
+
end # /describe action :remove
|
108
|
+
end
|