Skip to content

Commit

Permalink
(FM-8220) convert to use litmus
Browse files Browse the repository at this point in the history
  • Loading branch information
tphoney committed Jul 22, 2019
1 parent 3ef32f6 commit d03e584
Show file tree
Hide file tree
Showing 23 changed files with 251 additions and 256 deletions.
3 changes: 3 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ fixtures:
repo: "git://github.com/puppetlabs/puppetlabs-concat.git"
stdlib:
repo: "git://github.com/puppetlabs/puppetlabs-stdlib.git"
facts: 'git://github.com/puppetlabs/puppetlabs-facts.git'
puppet_agent: 'git://github.com/puppetlabs/puppetlabs-puppet_agent.git'
provision: 'git://github.com/puppetlabs/provision.git'
symlinks:
haproxy: "#{source_dir}"
36 changes: 17 additions & 19 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
required:
- ---.project

.gitlab-ci.yml:
unmanaged: true

.travis.yml:
docker_sets:
- set: docker/centos-7
Expand All @@ -13,32 +16,27 @@
branches:
- release

.rubocop.yml:
default_configs:
inherit_from: .rubocop_todo.yml
require:
- rubocop-i18n
- rubocop-rspec

appveyor.yml:
delete: true

Gemfile:
required:
':system_tests':
- gem: 'puppet-module-posix-system-r#{minor_version}'
platforms: ruby
- gem: 'puppet-module-win-system-r#{minor_version}'
platforms:
- mswin
- mingw
- x64_mingw
optional:
':development':
- gem: 'github_changelog_generator'
git: 'https://github.com/skywinder/github-changelog-generator'
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"

appveyor.yml:
delete: true

.rubocop.yml:
default_configs:
inherit_from: .rubocop_todo.yml

.gitlab-ci.yml:
unmanaged: true

Rakefile:
changelog_user: puppetlabs

spec/spec_helper.rb:
mock_with: ':rspec'
coverage_report: true
56 changes: 46 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,58 @@ matrix:
fast_finish: true
include:
-
bundler_args:
bundler_args:
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/centos-7 BEAKER_TESTMODE=apply
rvm: 2.5.3
script: bundle exec rake beaker
env: PLATFORMS=deb_puppet5
rvm: 2.5.1
before_script:
- bundle exec rake 'litmus:provision_list[travis_deb]'
- bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='*'
- bundle exec rake 'litmus:install_agent[puppet5]'
- bundle exec rake litmus:install_module
script:
- bundle exec rake litmus:acceptance:parallel
services: docker
stage: acceptance
sudo: required
-
bundler_args:
bundler_args:
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/ubuntu-14.04 BEAKER_TESTMODE=apply
rvm: 2.5.3
script: bundle exec rake beaker
env: PLATFORMS=deb_puppet6
rvm: 2.5.1
before_script:
- bundle exec rake 'litmus:provision_list[travis_deb]'
- bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='*'
- bundle exec rake 'litmus:install_agent[puppet6]'
- bundle exec rake litmus:install_module
script:
- bundle exec rake litmus:acceptance:parallel
services: docker
sudo: required
-
bundler_args:
dist: trusty
env: PLATFORMS=el_puppet5
rvm: 2.5.1
before_script:
- bundle exec rake 'litmus:provision_list[travis_el]'
- bundle exec rake 'litmus:install_agent[puppet5]'
- bundle exec rake litmus:install_module
script:
- bundle exec rake litmus:acceptance:parallel
services: docker
sudo: required
-
bundler_args:
dist: trusty
env: PLATFORMS=el_puppet6
rvm: 2.5.1
before_script:
- bundle exec rake 'litmus:provision_list[travis_el]'
- bundle exec rake 'litmus:install_agent[puppet6]'
- bundle exec rake litmus:install_module
script:
- bundle exec rake litmus:acceptance:parallel
services: docker
stage: acceptance
sudo: required
-
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
Expand Down
6 changes: 1 addition & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end

ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

gem 'rb-readline'
group :development do
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
Expand All @@ -29,10 +29,6 @@ group :development do
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
end

puppet_version = ENV['PUPPET_GEM_VERSION']
facter_version = ENV['FACTER_GEM_VERSION']
Expand Down
25 changes: 25 additions & 0 deletions distelli-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
team-modules/puppetlabs-haproxy:
PreBuild:
- source /opt/rh/rh-ruby25/enable
- echo "--- LETS update BUNDLER ---"
- bundle install --path vendor/bundle --jobs 3
Build:
- echo "--- PROVISIONING ---"
- source /opt/rh/rh-ruby25/enable
- bundle exec rake litmus:provision_list[release_checks]
- cat inventory.yaml
- echo "--- AGENT INSTALLATION ---"
- bundle exec rake litmus:install_agent
- echo "--- MODULE INSTALLATION ---"
- bundle exec rake litmus:install_module
- echo "--- TESTS RUNNING ---"
- bundle exec rake litmus:acceptance:parallel
AfterBuildSuccess:
- source /opt/rh/rh-ruby25/enable
- bundle exec rake litmus:tear_down
AfterBuildFailure:
- source /opt/rh/rh-ruby25/enable
- bundle exec rake litmus:tear_down
CommitData:
- RepoType: Git
- RepoPath: .
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"5",
"6",
"7"
]
},
Expand Down Expand Up @@ -70,7 +71,7 @@
"version_requirement": ">= 5.5.10 < 7.0.0"
}
],
"template-url": "https://github.com/puppetlabs/pdk-templates#master",
"template-url": "https://github.com/puppetlabs/pdk-templates/#master",
"template-ref": "heads/master-0-gb096033",
"pdk-version": "1.11.1"
}
13 changes: 13 additions & 0 deletions provision.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
default:
provisioner: docker
images: ['waffleimage/debian8']
travis_deb:
provisioner: docker
images: ['debian:8', 'debian:9', 'ubuntu:14.04', 'ubuntu:16.04', 'ubuntu:18.04']
travis_el:
provisioner: docker_exp
images: ['centos:6', 'centos:7', 'oraclelinux:6', 'oraclelinux:7']
release_checks:
provisioner: vmpooler
images: ['redhat-6-x86_64', 'redhat-7-x86_64', 'centos-6-x86_64', 'centos-7-x86_64', 'debian-8-x86_64', 'debian-9-x86_64', 'ubuntu-1404-x86_64', 'ubuntu-1604-x86_64', 'ubuntu-1804-x86_64' ]
12 changes: 6 additions & 6 deletions spec/acceptance/basic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ class { 'haproxy': }

it 'has stats listening on each port' do
['9090', '9091'].each do |port|
shell("/usr/bin/curl -u puppet:puppet localhost:#{port}") do |r|
r.stdout.should =~ %r{HAProxy}
r.exit_code.should == 0
run_shell("/usr/bin/curl -u puppet:puppet localhost:#{port}") do |r|
expect(r.stdout).to contain %r{HAProxy}
expect(r.exit_code).to eq 0
end
end
end
Expand All @@ -83,9 +83,9 @@ class { 'haproxy': }

it 'has stats listening on each port' do
['9090', '9091'].each do |port|
shell("/usr/bin/curl -u puppet:puppet localhost:#{port}") do |r|
r.stdout.should =~ %r{HAProxy}
r.exit_code.should == 0
run_shell("/usr/bin/curl -u puppet:puppet localhost:#{port}") do |r|
expect(r.stdout).to contain %r{HAProxy}
expect(r.exit_code).to eq 0
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/acceptance/defaults_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class { 'haproxy': }
end

it 'does a curl against the LB to make sure it gets a response from each port' do
shell('curl localhost:5555').stdout.chomp.should match(%r{Response on 555(6|7)})
shell('curl localhost:5555').stdout.chomp.should match(%r{Response on 555(6|7)})
expect(run_shell('curl localhost:5555').stdout.chomp).to match(%r{Response on 555(6|7)})
expect(run_shell('curl localhost:5555').stdout.chomp).to match(%r{Response on 555(6|7)})
end

pp_two = <<-PUPPETCODE
Expand Down Expand Up @@ -122,7 +122,7 @@ class { 'haproxy': }
end

it 'does a curl against the LB to make sure it gets a response from each port #oldstyle' do
shell('curl localhost:5555').stdout.chomp.should match(%r{Response on 5556})
shell('curl localhost:6666').stdout.chomp.should match(%r{Response on 5557})
expect(run_shell('curl localhost:5555').stdout.chomp).to match(%r{Response on 5556})
expect(run_shell('curl localhost:6666').stdout.chomp).to match(%r{Response on 5557})
end
end
12 changes: 6 additions & 6 deletions spec/acceptance/frontbackend_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ class { 'haproxy': }
# balancer. Something with retries would be better.
# C9945
it 'does a curl against the LB to make sure it gets a response from each port' do
response_connection = shell('curl localhost:5555').stdout.chomp
response_connection.should match(%r{Response on 555(6|7)})
response_connection = run_shell('curl localhost:5555').stdout.chomp
expect(response_connection).to match(%r{Response on 555(6|7)})
if response_connection == 'Response on 5556'
shell('curl localhost:5555').stdout.chomp.should match(%r{Response on 5557})
expect(run_shell('curl localhost:5555').stdout.chomp).to match(%r{Response on 5557})
else
shell('curl localhost:5555').stdout.chomp.should match(%r{Response on 5556})
expect(run_shell('curl localhost:5555').stdout.chomp).to match(%r{Response on 5556})
end
end

Expand Down Expand Up @@ -70,8 +70,8 @@ class { 'haproxy': }

# C9951
it 'does a curl against the LB to make sure it gets a response from each port #onenodeup' do
shell('curl localhost:5555').stdout.chomp.should match(%r{Response on 5556})
shell('curl localhost:5555').stdout.chomp.should match(%r{Response on 5556})
expect(run_shell('curl localhost:5555').stdout.chomp).to match(%r{Response on 5556})
expect(run_shell('curl localhost:5555').stdout.chomp).to match(%r{Response on 5556})
end

pp_three = <<-PUPPETCODE
Expand Down
14 changes: 7 additions & 7 deletions spec/acceptance/listen_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class { 'haproxy': }
# balancer. Something with retries would be better.
# C9876 C9877 C9941 C9954
it 'does a curl against the LB to make sure it gets a response from each port' do
shell('curl localhost:5555').stdout.chomp.should match(%r{Response on 555(6|7)})
shell('curl localhost:5555').stdout.chomp.should match(%r{Response on 555(6|7)})
expect(run_shell('curl localhost:5555').stdout.chomp).to match(%r{Response on 555(6|7)})
expect(run_shell('curl localhost:5555').stdout.chomp).to match(%r{Response on 555(6|7)})
end

# C9955
Expand All @@ -53,14 +53,14 @@ class { 'haproxy': }
PUPPETCODE
it 'is able to configure the listen active/passive' do
retry_on_error_matching do
idempotent_apply(default, pp_two, {})
idempotent_apply(pp_two)
end
end

it 'does a curl against the LB to make sure it only gets a response from the active port' do
sleep(10)
shell('curl localhost:5555').stdout.chomp.should match(%r{Response on 5556})
shell('curl localhost:5555').stdout.chomp.should match(%r{Response on 5556})
expect(run_shell('curl localhost:5555').stdout.chomp).to match(%r{Response on 5556})
expect(run_shell('curl localhost:5555').stdout.chomp).to match(%r{Response on 5556})
end

# C9942 C9944 WONTFIX
Expand Down Expand Up @@ -89,8 +89,8 @@ class { 'haproxy': }
end

it 'does a curl against the LB to make sure it gets a response from each port #onenodeup' do
shell('curl localhost:5555').stdout.chomp.should match(%r{Response on 5556})
shell('curl localhost:5555').stdout.chomp.should match(%r{Response on 5556})
expect(run_shell('curl localhost:5555').stdout.chomp).to match(%r{Response on 5556})
expect(run_shell('curl localhost:5555').stdout.chomp).to match(%r{Response on 5556})
end

pp_four = <<-PUPPETCODE
Expand Down
10 changes: 0 additions & 10 deletions spec/acceptance/nodesets/centos-7-x64.yml

This file was deleted.

10 changes: 0 additions & 10 deletions spec/acceptance/nodesets/debian-8-x64.yml

This file was deleted.

18 changes: 0 additions & 18 deletions spec/acceptance/nodesets/default.yml

This file was deleted.

12 changes: 0 additions & 12 deletions spec/acceptance/nodesets/docker/centos-7.yml

This file was deleted.

11 changes: 0 additions & 11 deletions spec/acceptance/nodesets/docker/debian-8.yml

This file was deleted.

Loading

0 comments on commit d03e584

Please sign in to comment.