Skip to content

Commit

Permalink
Fix tests for beta versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ninaspitfire committed Sep 12, 2017
1 parent 2995e24 commit 1df00e2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ log
doc
*.lock
**.swp
files/logstash-output-cowsay-5.0.0.zip
8 changes: 3 additions & 5 deletions Vagrantfile.d/server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ systemctl start puppetserver
echo '127.0.0.1 localhost puppet' > /etc/hosts

# Install puppet-logstash dependencies.
for module in puppetlabs-stdlib puppetlabs-apt elastic-elastic_stack; do
/opt/puppetlabs/bin/puppet module install \
--target-dir=/etc/puppetlabs/code/environments/production/modules \
$module
done
/opt/puppetlabs/bin/puppet module install \
--target-dir=/etc/puppetlabs/code/environments/production/modules \
elastic-elastic_stack

# Install Java 8 for Logstash.
yum install -y java-1.8.0-openjdk-devel
Expand Down
4 changes: 4 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 3.2.0 <5.0.0"
},
{
"name": "elastic/elastic_stack",
"version_requirement": "<7.0.0"
}
],
"operatingsystem_support": [
Expand Down
10 changes: 8 additions & 2 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,17 @@ def logstash_package_filename
end

def logstash_package_version
if LS_VERSION =~ /(alpha|beta)/
package_version = LS_VERSION.gsub('-', '~')
else
package_version = LS_VERSION
end

case fact('osfamily') # FIXME: Put this logic in the module, not the tests.
when 'RedHat'
"#{LS_VERSION}-1"
"#{package_version}-1"
when 'Debian', 'Suse'
"1:#{LS_VERSION}-1"
"1:#{package_version}-1"
end
end

Expand Down

0 comments on commit 1df00e2

Please sign in to comment.