Skip to content

Commit

Permalink
(spec) update to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dtapiacl committed Nov 20, 2023
1 parent 41fb637 commit c890903
Showing 1 changed file with 31 additions and 27 deletions.
58 changes: 31 additions & 27 deletions spec/hosts/nodes/auxtel-hcu02.cp.lsst.org_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
require 'spec_helper'

describe 'auxtel-hcu02.cp.lsst.org', :sitepp do
on_supported_os.each do |os, facts|
next if os =~ %r{centos-7-x86_64}
on_supported_os.each do |os, os_facts|
next unless os =~ %r{centos-7-x86_64}

context "on #{os}" do
let(:facts) do
override_facts(facts,
override_facts(os_facts,
fqdn: 'auxtel-hcu02.cp.lsst.org',
is_virtual: false,
virtual: 'physical',
Expand All @@ -28,37 +28,41 @@
it { is_expected.to compile.with_all_deps }

include_examples 'baremetal no bmc'
include_context 'with nm interface'
it { is_expected.to have_nm__connection_resource_count(4) }

context 'with eno1' do
let(:interface) { 'eno1' }

it_behaves_like 'nm enabled interface'
it_behaves_like 'nm dhcp interface'
it_behaves_like 'nm ethernet interface'
it do
is_expected.to contain_network__interface('eno1').with(
bootproto: 'dhcp',
defroute: 'yes',
onboot: 'yes',
type: 'Ethernet',
)
end

context 'with enp8s0' do
let(:interface) { 'enp8s0' }

it_behaves_like 'nm disabled interface'
it do
is_expected.to contain_network__interface('enp6s0').with(
bootproto: 'none',
ipaddress: '192.168.1.1',
netmask: '255.255.255.0',
onboot: 'yes',
type: 'Ethernet',
)
end

context 'with enp7s0' do
let(:interface) { 'enp7s0' }

it_behaves_like 'nm disabled interface'
it do
is_expected.to contain_network__interface('enp7s0').with(
bootproto: 'none',
onboot: 'no',
type: 'Ethernet',
)
end

context 'with enp6s0' do
let(:interface) { 'enp6s0' }

it_behaves_like 'nm enabled interface'
it_behaves_like 'nm ethernet interface'
it { expect(nm_keyfile['ipv4']['address1']).to eq('192.168.1.1/24') }
it { expect(nm_keyfile['ipv4']['method']).to eq('manual') }
it do
is_expected.to contain_network__interface('enp8s0').with(
bootproto: 'none',
onboot: 'no',
type: 'Ethernet',
)
end
end # on os
end # on_supported_os
end
end # role

0 comments on commit c890903

Please sign in to comment.