Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian: Configure correct shell for hdm user #19

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vendor/
.git/
.*.sw[op]
.metadata
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"

group :test do
gem 'voxpupuli-test', '~> 2.5', :require => false
gem 'voxpupuli-test', '~> 5', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'puppet_metadata', '~> 1.0', :require => false
Expand Down
35 changes: 35 additions & 0 deletions spec/acceptance/docker_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# frozen_string_literal: true

require 'spec_helper_acceptance'

describe 'hdm' do
context 'with docker' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
class { 'hdm':
method => 'docker',
}
PUPPET
end
end
describe service('docker-hdm') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end

# rubocop:disable RSpec/RepeatedExampleGroupBody
describe command('journalctl --unit docker-hdm --lines 500 --no-pager') do
its(:exit_status) { is_expected.to eq 0 }
end

describe command('docker container ls --all') do
its(:exit_status) { is_expected.to eq 0 }
end

describe command('docker image ls --all') do
its(:exit_status) { is_expected.to eq 0 }
end
# rubocop:enable RSpec/RepeatedExampleGroupBody
end
end
6 changes: 6 additions & 0 deletions spec/setup_acceptance_node.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Needed for os.distro.codebase fact
if $facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['full'] == '18.04' and versioncmp($facts['puppetversion'], '7') <= 0 {
package{'lsb-release':
ensure => present,
}
}
10 changes: 5 additions & 5 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# frozen_string_literal: true

# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

# puppetlabs_spec_helper will set up coverage if the env variable is set.
# We want to do this if lib exists and it hasn't been explicitly set.
ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../../lib', __FILE__))
ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../lib', __dir__))

require 'voxpupuli/test/spec_helper'

if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml')))
if facts
facts.each do |name, value|
add_custom_fact name.to_sym, value
end
facts&.each do |name, value|
add_custom_fact name.to_sym, value
end
end
10 changes: 10 additions & 0 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

require 'voxpupuli/acceptance/spec_helper_acceptance'

configure_beaker

Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f }