|
| 1 | +# frozen_string_literal: true |
| 2 | + |
| 3 | +require 'spec_helper' |
| 4 | + |
| 5 | +describe 'merken01.cp.lsst.org', :sitepp do |
| 6 | + on_supported_os.each do |os, os_facts| |
| 7 | + next unless os =~ %r{almalinux-9-x86_64} |
| 8 | + |
| 9 | + context "on #{os}" do |
| 10 | + let(:facts) do |
| 11 | + lsst_override_facts(os_facts, |
| 12 | + is_virtual: false, |
| 13 | + virtual: 'physical', |
| 14 | + dmi: { |
| 15 | + 'product' => { |
| 16 | + 'name' => 'AS -1115HS-TNR', |
| 17 | + }, |
| 18 | + }) |
| 19 | + end |
| 20 | + let(:node_params) do |
| 21 | + { |
| 22 | + role: 'rke2server', |
| 23 | + site: 'cp', |
| 24 | + cluster: 'merken', |
| 25 | + } |
| 26 | + end |
| 27 | + |
| 28 | + it { is_expected.to compile.with_all_deps } |
| 29 | + |
| 30 | + include_examples 'baremetal' |
| 31 | + include_context 'with nm interface' |
| 32 | + include_examples 'ceph cluster' |
| 33 | + |
| 34 | + it { is_expected.to contain_class('tuned').with_active_profile('latency-performance') } |
| 35 | + |
| 36 | + it do |
| 37 | + is_expected.to contain_class('clustershell').with( |
| 38 | + groupmembers: { |
| 39 | + 'merken' => { |
| 40 | + 'group' => 'merken', |
| 41 | + 'member' => 'merken[01-04]', |
| 42 | + }, |
| 43 | + } |
| 44 | + ) |
| 45 | + end |
| 46 | + |
| 47 | + it do |
| 48 | + is_expected.to contain_class('rke2').with( |
| 49 | + node_type: 'server', |
| 50 | + release_series: '1.32', |
| 51 | + version: '1.32.2~rke2r1' |
| 52 | + ) |
| 53 | + end |
| 54 | + |
| 55 | + it do |
| 56 | + # Ensure the storage role label is applied to the RKE2 server node |
| 57 | + expect(catalogue.resource('class', 'rke2')[:config]['node-label']).to include('role=storage-node') |
| 58 | + end |
| 59 | + |
| 60 | + it do |
| 61 | + expect(catalogue.resource('class', 'nm')[:conf]).to include( |
| 62 | + 'device' => { |
| 63 | + 'keep-configuration' => 'no', |
| 64 | + 'allowed-connections' => 'except:origin:nm-initrd-generator', |
| 65 | + } |
| 66 | + ) |
| 67 | + end |
| 68 | + |
| 69 | + it { is_expected.to have_nm__connection_resource_count(8) } |
| 70 | + |
| 71 | + %w[ |
| 72 | + enp12s0f4u1u2c2 |
| 73 | + ].each do |i| |
| 74 | + context "with #{i}" do |
| 75 | + let(:interface) { i } |
| 76 | + |
| 77 | + it_behaves_like 'nm disabled interface' |
| 78 | + end |
| 79 | + end |
| 80 | + |
| 81 | + %w[ |
| 82 | + enp65s0f0 |
| 83 | + enp65s0f1 |
| 84 | + ].each do |i| |
| 85 | + context "with #{i}" do |
| 86 | + let(:interface) { i } |
| 87 | + |
| 88 | + it_behaves_like 'nm named interface' |
| 89 | + it_behaves_like 'nm ethernet interface' |
| 90 | + it_behaves_like 'nm no-ip interface' |
| 91 | + it { expect(nm_keyfile['connection']['master']).to eq('bond0') } |
| 92 | + it { expect(nm_keyfile['connection']['slave-type']).to eq('bond') } |
| 93 | + it { expect(nm_keyfile_raw).to match(%r{^\[ethernet\]$}) } |
| 94 | + it { expect(nm_keyfile_raw).to match(%r{^\[ipv4\]$}) } |
| 95 | + it { expect(nm_keyfile_raw).to match(%r{^\[ipv6\]$}) } |
| 96 | + end |
| 97 | + end |
| 98 | + |
| 99 | + context 'with bond0' do |
| 100 | + let(:interface) { 'bond0' } |
| 101 | + |
| 102 | + it_behaves_like 'nm named interface' |
| 103 | + it_behaves_like 'nm no-ip interface' |
| 104 | + it { expect(nm_keyfile['connection']['type']).to eq('bond') } |
| 105 | + it { expect(nm_keyfile['bond']['miimon']).to eq(100) } |
| 106 | + it { expect(nm_keyfile['bond']['mode']).to eq('802.3ad') } |
| 107 | + it { expect(nm_keyfile['bond']['xmit_hash_policy']).to eq('layer3+4') } |
| 108 | + it { expect(nm_keyfile_raw).to match(%r{^\[ethernet\]$}) } |
| 109 | + it { expect(nm_keyfile_raw).not_to match(%r{^\[proxy\]$}) } |
| 110 | + end |
| 111 | + |
| 112 | + %w[ |
| 113 | + 1131 |
| 114 | + ].each do |vlan| |
| 115 | + iface = "bond0.#{vlan}" |
| 116 | + |
| 117 | + context "with #{iface}" do |
| 118 | + let(:interface) { iface } |
| 119 | + |
| 120 | + it_behaves_like 'nm enabled interface' |
| 121 | + it_behaves_like 'nm vlan interface', id: vlan.to_i, parent: 'bond0' |
| 122 | + it_behaves_like 'nm bridge slave interface', master: "br#{vlan}" |
| 123 | + end |
| 124 | + end |
| 125 | + |
| 126 | + context 'with br1131' do |
| 127 | + let(:interface) { 'br1131' } |
| 128 | + |
| 129 | + it_behaves_like 'nm enabled interface' |
| 130 | + it_behaves_like 'nm bridge interface' |
| 131 | + it_behaves_like 'nm dhcp interface' |
| 132 | + end |
| 133 | + end # on os |
| 134 | + end # on_supported_os |
| 135 | +end |
0 commit comments