Skip to content

Commit

Permalink
(spec) test roles against centos 7 using facterdb data
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt committed Jul 28, 2022
1 parent 7a621a2 commit 87de878
Show file tree
Hide file tree
Showing 21 changed files with 838 additions and 673 deletions.
23 changes: 23 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "lsst-itconf",
"version": "0.1.0",
"author": "AURA/LSST/Rubin Observatory",
"summary": "LSST/Rubin control repo",
"license": "Apache-2.0",
"source": "https://github.com/lsst-it/lsst-itconf",
"dependencies": [],
"operatingsystem_support": [
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7"
]
}
],
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 6.0.0 < 8.0.0"
}
]
}
58 changes: 33 additions & 25 deletions spec/classes/core/docker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,42 @@
require 'spec_helper'

describe 'profile::core::docker' do
it { is_expected.to compile.with_all_deps }

it do
is_expected.to contain_class('docker').with(
overlay2_override_kernel_check: true,
socket_group: 70_014,
socket_override: false,
storage_driver: 'overlay2',
version: '19.03.15',
)
end
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts
end

it { is_expected.to contain_class('yum::plugin::versionlock') }
it { is_expected.to have_yum__versionlock_resource_count(2) }
it { is_expected.to contain_class('docker::networks') }
it { is_expected.to compile.with_all_deps }

it do
is_expected.to contain_systemd__dropin_file('wait-for-docker-group.conf').with(
unit: 'docker.socket',
content: %r{SocketGroup=root},
)
end
it do
is_expected.to contain_class('docker').with(
overlay2_override_kernel_check: true,
socket_group: 70_014,
socket_override: false,
storage_driver: 'overlay2',
version: '19.03.15',
)
end

it do
is_expected.to contain_file('/etc/systemd/system/docker.service.d/wait-for-docker-group.conf').with_content(%r{Requires=docker.socket containerd.service sssd.service})
end
it { is_expected.to contain_class('yum::plugin::versionlock') }
it { is_expected.to have_yum__versionlock_resource_count(2) }
it { is_expected.to contain_class('docker::networks') }

it do
is_expected.to contain_systemd__dropin_file('wait-for-docker-group.conf').with(
unit: 'docker.socket',
content: %r{SocketGroup=root},
)
end

it do
is_expected.to contain_file('/etc/systemd/system/docker.service.d/wait-for-docker-group.conf').with_content(%r{Requires=docker.socket containerd.service sssd.service})
end

it do
is_expected.to contain_file('/etc/docker/daemon.json').with_content(%r{"live-restore": true})
it do
is_expected.to contain_file('/etc/docker/daemon.json').with_content(%r{"live-restore": true})
end
end
end
end
43 changes: 27 additions & 16 deletions spec/hosts/roles/amor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,33 @@

require 'spec_helper'

describe 'test1.dev.lsst.org' do
describe 'amor role' do
lsst_sites.each do |site|
context "with site #{site}", :site, :common do
let(:node_params) do
{
site: site,
role: 'amor',
cluster: 'amor',
}
end
role = 'amor'

it { is_expected.to compile.with_all_deps }
describe "#{role} role" do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge(
fqdn: self.class.description,
)
end

it { is_expected.to contain_class('docker::networks') }
let(:node_params) do
{
role: role,
site: site,
cluster: role,
}
end
end # site
end # role
end

lsst_sites.each do |site|
describe "#{role}.#{site}.lsst.org", :site, :common do
let(:site) { site }

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('docker::networks') }
end # host
end # lsst_sites
end # on os
end # on_supported_os
end # role
73 changes: 31 additions & 42 deletions spec/hosts/roles/atsccs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,34 @@

require 'spec_helper'

shared_examples 'generic auxtel-mcm' do
it { is_expected.to contain_class('ccs_sal') }
end

describe 'atsccs role' do
let(:node_params) do
{
role: 'atsccs',
cluster: 'auxtel-ccs',
}
end

let(:facts) { { fqdn: self.class.description } }

context 'with tu site' do
let(:node_params) do
super().merge(
site: 'tu',
)
end

describe 'auxtel-mcm.tu.lsst.org', :site, :common do
it { is_expected.to compile.with_all_deps }

include_examples 'generic auxtel-mcm'
end
end # site

context 'with cp site' do
let(:node_params) do
super().merge(
site: 'cp',
)
end

describe 'auxtel-mcm.cp.lsst.org', :site, :common do
it { is_expected.to compile.with_all_deps }

include_examples 'generic auxtel-mcm'
end
end # site
end
role = 'atsccs'

describe "#{role} role" do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge(
fqdn: self.class.description,
)
end

let(:node_params) do
{
role: role,
site: site,
cluster: 'auxtel-ccs',
}
end

lsst_sites.each do |site|
describe "#{role}.#{site}.lsst.org", :site, :common do
let(:site) { site }

it { is_expected.to compile.with_all_deps }

it { is_expected.to contain_class('ccs_sal') }
end # host
end # lsst_sites
end # on os
end # on_supported_os
end # role
74 changes: 35 additions & 39 deletions spec/hosts/roles/atsdaq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,39 @@

require 'spec_helper'

shared_examples 'generic auxtel-fp' do
include_examples 'lsst-daq client'
# it { is_expected.to contain_class('ccs_daq') }
# it { is_expected.to contain_class('daq::daqsdk').with_version('R5-V0.6') }
end

describe 'atsdaq role' do
let(:node_params) do
{
role: 'atsdaq',
cluster: 'auxtel-ccs',
}
end

let(:facts) { { fqdn: self.class.description } }

describe 'auxtel-fp01.cp.lsst.org', :site, :common do
let(:node_params) do
super().merge(
site: 'cp',
)
end

it { is_expected.to compile.with_all_deps }

include_examples 'generic auxtel-fp'
end # host

describe 'auxtel-fp01.tu.lsst.org', :site, :common do
let(:node_params) do
super().merge(
site: 'tu',
)
end

it { is_expected.to compile.with_all_deps }

include_examples 'generic auxtel-fp'
end # host
role = 'atsdaq'

describe "#{role} role" do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge(
fqdn: self.class.description,
)
end

let(:node_params) do
{
role: role,
site: site,
cluster: 'auxtel-ccs',
}
end

lsst_sites.each do |site|
describe "auxtel-fp01.#{site}.lsst.org", :site, :common do
let(:site) { site }

it { is_expected.to compile.with_all_deps }

case site
when 'tu', 'cp'
include_examples 'lsst-daq client'
end
# it { is_expected.to contain_class('ccs_daq') }
# it { is_expected.to contain_class('daq::daqsdk').with_version('R5-V0.6') }
end # host
end # lsst_sites
end # on os
end # on_supported_os
end # role
90 changes: 51 additions & 39 deletions spec/hosts/roles/auxtel_archiver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,55 @@

require 'spec_helper'

describe 'test1.dev.lsst.org' do
describe 'auxtel-archiver role' do
lsst_sites.each do |site|
context "with site #{site}", :site, :common do
let(:node_params) do
{
site: site,
role: 'auxtel-archiver',
}
end

it { is_expected.to compile.with_all_deps }

include_examples 'lhn sysctls'
include_examples 'archiver'

it { is_expected.to contain_file('/data/repo/LATISS') }

it { is_expected.to contain_rabbitmq_vhost('/test_at') }
it { is_expected.to contain_rabbitmq_user_permissions('iip@/test_at') }
it { is_expected.to contain_rabbitmq_user_permissions('guest@/test_at') }
it { is_expected.to contain_rabbitmq_exchange('message@/test_at') }

%w[
f98_consume@/test_at
f99_consume@/test_at
at_foreman_ack_publish@/test_at
at_publish_to_oods@/test_at
oods_publish_to_at@/test_at
archive_ctrl_publish@/test_at
archive_ctrl_consume@/test_at
telemetry_queue@/test_at
].each do |q|
it { is_expected.to contain_rabbitmq_queue(q) }
it { is_expected.to contain_rabbitmq_binding("message@#{q}") }
end
role = 'auxtel-archiver'

describe "#{role} role" do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge(
fqdn: self.class.description,
)
end

let(:node_params) do
{
role: role,
site: site,
}
end
end # site
end # role
end

lsst_sites.each do |site|
describe "#{role}.#{site}.lsst.org", :site, :common do
let(:site) { site }

it { is_expected.to compile.with_all_deps }

include_examples 'lhn sysctls'
include_examples 'archiver'

it { is_expected.to contain_file('/data/repo/LATISS') }

it { is_expected.to contain_rabbitmq_vhost('/test_at') }
it { is_expected.to contain_rabbitmq_user_permissions('iip@/test_at') }
it { is_expected.to contain_rabbitmq_user_permissions('guest@/test_at') }
it { is_expected.to contain_rabbitmq_exchange('message@/test_at') }

%w[
f98_consume@/test_at
f99_consume@/test_at
at_foreman_ack_publish@/test_at
at_publish_to_oods@/test_at
oods_publish_to_at@/test_at
archive_ctrl_publish@/test_at
archive_ctrl_consume@/test_at
telemetry_queue@/test_at
].each do |q|
it { is_expected.to contain_rabbitmq_queue(q) }
it { is_expected.to contain_rabbitmq_binding("message@#{q}") }
end
end # host
end # lsst_sites
end # on os
end # on_supported_os
end # role
Loading

0 comments on commit 87de878

Please sign in to comment.