Skip to content

Commit

Permalink
Merge pull request #66 from cthorn42/main/master/PE-20086_msi_install…
Browse files Browse the repository at this point in the history
…_method_for_2016.5.(0|1)_if_windows2008r2

(PE-20086) PE 2016.5.(0|1) should install via msi method if windows2008r2
  • Loading branch information
tvpartytonight authored Apr 18, 2017
2 parents a3c5d64 + 738e6f5 commit a77cf5b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/beaker-pe/install/pe_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -759,13 +759,16 @@ def feature_flag?(flag, opts)
Beaker::DSL::InstallUtils::FeatureFlags.new(opts).flag?(flag)
end

# @deprecated the !version_is_less(host['pe_ver'], '3.99') can be removed once we no longer support pre 2015.2.0 PE versions
# Check if windows host is able to frictionlessly install puppet
# @param [Beaker::Host] host that we are checking if it is possible to install frictionlessly to
# @return [Boolean] true if frictionless is supported and not affected by known bugs
def install_via_msi?(host)
#windows agents from 4.0 -> 2016.1.2 were only installable via the aio method
#powershell2 bug was fixed in PE 2016.4.3
(host['platform'] =~ /windows/ && (version_is_less(host['pe_ver'], '2016.4.0') && !version_is_less(host['pe_ver'], '3.99'))) || (host['platform'] =~ /windows-2008r2/ && (version_is_less(host['pe_ver'], '2016.4.3') && !version_is_less(host['pe_ver'], '3.99')))
#powershell2 bug was fixed in PE 2016.4.3, and PE 2017.1.0, but not 2016.5.z.
(host['platform'] =~ /windows/ && (version_is_less(host['pe_ver'], '2016.4.0') && !version_is_less(host['pe_ver'], '3.99'))) ||
(host['platform'] =~ /windows-2008r2/ && (version_is_less(host['pe_ver'], '2016.4.3') && !version_is_less(host['pe_ver'], '3.99'))) ||
(host['platform'] =~ /windows-2008r2/ && (!version_is_less(host['pe_ver'], '2016.4.99') && version_is_less(host['pe_ver'], '2016.5.99') && !version_is_less(host['pe_ver'], '3.99')))
end

# True if version is greater than or equal to MEEP_CLASSIFICATION_VERSION
Expand Down
16 changes: 16 additions & 0 deletions spec/beaker-pe/install/pe_utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,22 @@ def logger
expect(subject.install_via_msi?(the_host)).to eq(false)
end

it 'returns true if pe_version is 2016.5.1 and platform is windows-2008r2 bug' do
the_host = winhost.dup
the_host['roles'] = ['frictionless']
the_host['platform'] = 'windows-2008r2'
the_host['pe_ver'] = '2016.5.1'
expect(subject.install_via_msi?(the_host)).to eq(true)
end

it 'returns false if pe_version is 2017.1.0 and platform is windows-2008r2 bug' do
the_host = winhost.dup
the_host['roles'] = ['frictionless']
the_host['platform'] = 'windows-2008r2'
the_host['pe_ver'] = '2017.1.0'
expect(subject.install_via_msi?(the_host)).to eq(false)
end

end

describe 'higgs installer' do
Expand Down

0 comments on commit a77cf5b

Please sign in to comment.