From 331a509335cfdd223f4b39a0c02387b772aa7c87 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 5 Mar 2023 16:20:59 +0000 Subject: [PATCH] Update networking tests for nftables switch --- .../networking/serverspec/nftables_spec.rb | 20 +++++++++++++++++++ .../networking/serverspec/shorewall_spec.rb | 20 ------------------- 2 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 test/integration/networking/serverspec/nftables_spec.rb delete mode 100644 test/integration/networking/serverspec/shorewall_spec.rb diff --git a/test/integration/networking/serverspec/nftables_spec.rb b/test/integration/networking/serverspec/nftables_spec.rb new file mode 100644 index 000000000..f1f1389fd --- /dev/null +++ b/test/integration/networking/serverspec/nftables_spec.rb @@ -0,0 +1,20 @@ +require "serverspec" + +# Required by serverspec +set :backend, :exec + +describe package("nftables") do + it { should be_installed } +end + +describe service("nftables") do + it { should be_enabled } + it { should be_running } +end + +describe file("/etc/nftables.conf") do + it { should be_file } + its(:content) { should match(/echo-request.*accept/) } + its(:content) { should match(/http.*accept/) } + its(:content) { should match(/https.*accept/) } +end diff --git a/test/integration/networking/serverspec/shorewall_spec.rb b/test/integration/networking/serverspec/shorewall_spec.rb deleted file mode 100644 index 2518b7231..000000000 --- a/test/integration/networking/serverspec/shorewall_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require "serverspec" - -# Required by serverspec -set :backend, :exec - -describe package("shorewall") do - it { should be_installed } -end - -describe service("shorewall") do - it { should be_enabled } - it { should be_running } -end - -describe file("/etc/shorewall/rules") do - it { should be_file } - its(:content) { should match(/ACCEPT.*echo-request/) } - its(:content) { should match(/ACCEPT.*http/) } - its(:content) { should match(/ACCEPT.*https/) } -end -- 2.39.5