Skip to content

Commit

Permalink
(node/hvac.cp) add network test
Browse files Browse the repository at this point in the history
  • Loading branch information
dtapiacl committed Dec 18, 2024
1 parent 3325ec9 commit 3b24d08
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
32 changes: 32 additions & 0 deletions hieradata/node/hvac.cp.lsst.org.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
nm::connections:
ens192:
content:
connection:
id: "ens192"
uuid: "5c4da295-6537-35c0-bcbb-44ac7c3e6f96"
type: "ethernet"
interface-name: "ens192"
ethernet: {}
ipv4:
address1: "139.229.160.81/24,139.229.160.254"
dns: "139.229.135.53;139.229.135.54;139.229.135.55;"
dns-search: "cp.lsst.org;"
method: "manual"
ipv6:
method: "disabled"
proxy: {}
ens224:
content:
connection:
id: "ens224"
uuid: "f5503f66-ba6c-3c41-9e03-cbc7ed281590"
type: "ethernet"
interface-name: "ens224"
ethernet: {}
ipv4:
address1: "10.255.211.48/25"
method: "manual"
ipv6:
method: "disabled"
proxy: {}
53 changes: 53 additions & 0 deletions spec/hosts/nodes/hvac.cp.lsst.org_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'hvac.cp.lsst.org', :sitepp do
on_supported_os.each do |os, os_facts|
next unless os =~ %r{almalinux-9-x86_64}

context "on #{os}" do
let(:facts) do
lsst_override_facts(os_facts,
is_virtual: true,
virtual: 'vmware',
dmi: {
'product' => {
'name' => 'VMware7,1',
},
})
end
let(:node_params) do
{
role: 'generic',
site: 'cp',
}
end

it { is_expected.to compile.with_all_deps }

include_context 'with nm interface'
it { is_expected.to have_nm__connection_resource_count(2) }

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

it_behaves_like 'nm enabled interface'
it_behaves_like 'nm ethernet interface'
it { expect(nm_keyfile['ipv4']['address1']).to eq('139.229.160.81/24,139.229.160.254') }
it { expect(nm_keyfile['ipv4']['dns']).to eq('139.229.135.53;139.229.135.54;139.229.135.55;') }
it { expect(nm_keyfile['ipv4']['dns-search']).to eq('cp.lsst.org;') }
it { expect(nm_keyfile['ipv4']['method']).to eq('manual') }
end

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

it_behaves_like 'nm enabled interface'
it_behaves_like 'nm ethernet interface'
it { expect(nm_keyfile['ipv4']['address1']).to eq('10.255.211.48/25') }
it { expect(nm_keyfile['ipv4']['method']).to eq('manual') }
end
end # on os
end # on_supported_os
end

0 comments on commit 3b24d08

Please sign in to comment.