From fb62320d2e9a2c4f8cdc05d502f73cf7331fbaed Mon Sep 17 00:00:00 2001 From: cocker-cc Date: Tue, 24 Oct 2023 18:52:45 +0200 Subject: [PATCH] Remove legacy Facts from Rspec-Tests --- ...datadog_agent_integrations_haproxy_spec.rb | 1 - spec/classes/datadog_agent_redhat_spec.rb | 25 -------------- spec/classes/datadog_agent_reports_spec.rb | 11 ------ spec/classes/datadog_agent_spec.rb | 34 ------------------- spec/classes/datadog_agent_suse_spec.rb | 4 --- spec/classes/datadog_agent_ubuntu_spec.rb | 18 ---------- ...datadog_agent__install_integration_spec.rb | 3 -- 7 files changed, 96 deletions(-) diff --git a/spec/classes/datadog_agent_integrations_haproxy_spec.rb b/spec/classes/datadog_agent_integrations_haproxy_spec.rb index 999f1176..cd03c8a5 100644 --- a/spec/classes/datadog_agent_integrations_haproxy_spec.rb +++ b/spec/classes/datadog_agent_integrations_haproxy_spec.rb @@ -6,7 +6,6 @@ let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } let(:facts) do { - ipaddress: '1.2.3.4', networking: { 'ip' => '1.2.3.4' }, } end diff --git a/spec/classes/datadog_agent_redhat_spec.rb b/spec/classes/datadog_agent_redhat_spec.rb index bf6362e3..889cc9ea 100644 --- a/spec/classes/datadog_agent_redhat_spec.rb +++ b/spec/classes/datadog_agent_redhat_spec.rb @@ -8,9 +8,6 @@ let(:facts) do { - osfamily: 'redhat', - operatingsystem: 'Fedora', - architecture: 'x86_64', os: { 'architecture' => 'x86_64', 'family' => 'redhat', @@ -67,9 +64,6 @@ context 'agent 6' do let(:facts) do { - osfamily: 'redhat', - operatingsystem: 'Fedora', - architecture: 'x86_64', os: { 'architecture' => 'x86_64', 'family' => 'redhat', @@ -126,9 +120,6 @@ context 'agent 7' do let(:facts) do { - osfamily: 'redhat', - operatingsystem: 'Fedora', - architecture: 'x86_64', os: { 'architecture' => 'x86_64', 'family' => 'redhat', @@ -187,10 +178,6 @@ # we expect repo_gpgcheck to be false on 8.1 let(:facts) do { - osfamily: 'redhat', - operatingsystem: 'RedHat', - operatingsystemrelease: '8.1', - architecture: 'x86_64', os: { 'architecture' => 'x86_64', 'family' => 'redhat', @@ -229,10 +216,6 @@ # we expect repo_gpgcheck to be true on 8.2 (and later) let(:facts) do { - osfamily: 'redhat', - operatingsystem: 'RedHat', - operatingsystemrelease: '8.2', - architecture: 'x86_64', os: { 'architecture' => 'x86_64', 'family' => 'redhat', @@ -271,10 +254,6 @@ context 'almalinux 8', if: min_puppet_version('7.12.0') do let(:facts) do { - osfamily: 'redhat', - operatingsystem: 'AlmaLinux', - operatingsystemrelease: '8.5', - architecture: 'x86_64', os: { 'architecture' => 'x86_64', 'family' => 'redhat', @@ -312,10 +291,6 @@ context 'rocky 8', if: min_puppet_version('7.12.0') do let(:facts) do { - osfamily: 'redhat', - operatingsystem: 'Rocky', - operatingsystemrelease: '8.5', - architecture: 'x86_64', os: { 'architecture' => 'x86_64', 'family' => 'redhat', diff --git a/spec/classes/datadog_agent_reports_spec.rb b/spec/classes/datadog_agent_reports_spec.rb index 8ef1239f..a88c2041 100644 --- a/spec/classes/datadog_agent_reports_spec.rb +++ b/spec/classes/datadog_agent_reports_spec.rb @@ -20,9 +20,6 @@ describe "datadog_agent class common actions on #{operatingsystem}" do let(:facts) do { - operatingsystem: operatingsystem, - osfamily: getosfamily(operatingsystem), - operatingsystemrelease: getosrelease(operatingsystem), os: { 'architecture' => 'x86_64', 'family' => getosfamily(operatingsystem), @@ -90,8 +87,6 @@ describe 'datadog_agent class dogapi version override' do let(:facts) do { - operatingsystem: 'Debian', - osfamily: 'debian', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -141,8 +136,6 @@ describe 'datadog_agent class puppet gem provider override' do let(:facts) do { - operatingsystem: 'Debian', - osfamily: 'debian', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -187,8 +180,6 @@ describe 'datadog_agent class dogapi version override' do let(:facts) do { - operatingsystem: 'Debian', - osfamily: 'debian', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -235,8 +226,6 @@ describe 'datadog_agent class dogapi version override' do let(:facts) do { - operatingsystem: 'Debian', - osfamily: 'debian', os: { 'architecture' => 'x86_64', 'family' => 'debian', diff --git a/spec/classes/datadog_agent_spec.rb b/spec/classes/datadog_agent_spec.rb index f88bc711..6ca9999c 100644 --- a/spec/classes/datadog_agent_spec.rb +++ b/spec/classes/datadog_agent_spec.rb @@ -6,8 +6,6 @@ describe 'datadog_agent class without any parameters on Solaris/Nexenta' do let(:facts) do { - osfamily: 'Solaris', - operatingsystem: 'Nexenta', os: { 'architecture' => 'x86_64', 'family' => 'Solaris', @@ -36,8 +34,6 @@ end let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Ubuntu', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -64,8 +60,6 @@ end let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Ubuntu', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -92,8 +86,6 @@ end let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Ubuntu', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -120,8 +112,6 @@ end let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Ubuntu', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -148,8 +138,6 @@ end let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Ubuntu', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -176,8 +164,6 @@ end let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Ubuntu', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -204,8 +190,6 @@ end let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Ubuntu', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -234,8 +218,6 @@ end let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Ubuntu', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -260,8 +242,6 @@ context 'windows NPM' do let(:facts) do { - osfamily: 'windows', - operatingsystem: 'Windows', os: { 'architecture' => 'x86_64', 'family' => 'windows', @@ -316,8 +296,6 @@ ALL_OS.each do |operatingsystem| let(:facts) do { - operatingsystem: operatingsystem, - osfamily: getosfamily(operatingsystem), os: { 'architecture' => 'x86_64', 'family' => getosfamily(operatingsystem), @@ -367,8 +345,6 @@ end let(:facts) do { - operatingsystem: operatingsystem, - osfamily: getosfamily(operatingsystem), os: { 'architecture' => 'x86_64', 'family' => getosfamily(operatingsystem), @@ -1728,8 +1704,6 @@ end let(:facts) do { - operatingsystem: operatingsystem, - osfamily: getosfamily(operatingsystem), os: { 'architecture' => 'x86_64', 'family' => getosfamily(operatingsystem), @@ -1763,8 +1737,6 @@ end let(:facts) do { - operatingsystem: operatingsystem, - osfamily: getosfamily(operatingsystem), os: { 'architecture' => 'x86_64', 'family' => getosfamily(operatingsystem), @@ -2381,8 +2353,6 @@ end let(:facts) do { - 'operatingsystem' => 'CentOS', - 'osfamily' => 'redhat', 'os' => { 'architecture' => 'x86_64', 'family' => 'redhat', @@ -2425,8 +2395,6 @@ end let(:facts) do { - 'operatingsystem' => 'CentOS', - 'osfamily' => 'redhat', 'facts_array' => ['one', 'two'], 'facts_hash' => { 'actor' => { @@ -2463,8 +2431,6 @@ end let(:facts) do { - operatingsystem: 'CentOS', - osfamily: 'redhat', facts_array: ['one', 'two'], os: { 'architecture' => 'x86_64', diff --git a/spec/classes/datadog_agent_suse_spec.rb b/spec/classes/datadog_agent_suse_spec.rb index 125e8021..fbfe5e7a 100644 --- a/spec/classes/datadog_agent_suse_spec.rb +++ b/spec/classes/datadog_agent_suse_spec.rb @@ -7,8 +7,6 @@ let(:facts) do { - operatingsystem: 'OpenSuSE', - architecture: 'x86_64', os: { 'architecture' => 'x86_64', 'family' => 'redhat', @@ -24,7 +22,6 @@ context 'suse >= 15' do let(:facts) do { - operatingsystemmajrelease: '15', os: { 'architecture' => 'x86_64', 'family' => 'redhat', @@ -81,7 +78,6 @@ context 'suse < 15' do let(:facts) do { - operatingsystemmajrelease: '14', os: { 'architecture' => 'x86_64', 'family' => 'redhat', diff --git a/spec/classes/datadog_agent_ubuntu_spec.rb b/spec/classes/datadog_agent_ubuntu_spec.rb index 2fb98a48..6de162e5 100644 --- a/spec/classes/datadog_agent_ubuntu_spec.rb +++ b/spec/classes/datadog_agent_ubuntu_spec.rb @@ -34,8 +34,6 @@ end let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Ubuntu', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -88,8 +86,6 @@ let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Ubuntu', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -142,8 +138,6 @@ let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Ubuntu', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -193,9 +187,6 @@ let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Ubuntu', - operatingsystemrelease: '14.04', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -220,9 +211,6 @@ let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Ubuntu', - operatingsystemrelease: '16.04', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -247,9 +235,6 @@ let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Debian', - operatingsystemrelease: '8.0', os: { 'architecture' => 'x86_64', 'family' => 'debian', @@ -274,9 +259,6 @@ let(:facts) do { - osfamily: 'debian', - operatingsystem: 'Debian', - operatingsystemrelease: '9.0', os: { 'architecture' => 'x86_64', 'family' => 'debian', diff --git a/spec/defines/datadog_agent__install_integration_spec.rb b/spec/defines/datadog_agent__install_integration_spec.rb index d5404670..4ad2ef51 100644 --- a/spec/defines/datadog_agent__install_integration_spec.rb +++ b/spec/defines/datadog_agent__install_integration_spec.rb @@ -5,9 +5,6 @@ ALL_OS.each do |operatingsystem| let(:facts) do { - operatingsystem: operatingsystem, - osfamily: getosfamily(operatingsystem), - operatingsystemrelease: getosrelease(operatingsystem), os: { 'architecture' => 'x86_64', 'family' => getosfamily(operatingsystem),