Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure catalog compiles when endpoint is missing #103

Merged
merged 1 commit into from
Jan 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions spec/defines/interface_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,33 @@
it { is_expected.to contain_nftables__simplerule('allow_out_wg_as1234-0') }
it { is_expected.to contain_nftables__simplerule('allow_out_wg_as1234-1') }
end

# Usually we parse the src port for incoming packets / the dst port for outgoing packets from the $endpoint param
# The param is optional, in case you want to create a passive endpoint for clients with dynamic ip addresses
# In those cases we still need to create firewall rules, but without src port for incoming packets / the dst port
# To make this all a bit easier, we also added a new parameter, $endpoint_port, which takes precedence over parsing $endpoint
context '' do
let :pre_condition do
'class {"systemd":
manage_networkd => true
}'
end
let :params do
{
public_key: 'blabla==',
manage_firewall: true,
destination_addresses: [],
addresses: [{ 'Address' => '192.0.2.1/24' }],
source_addresses: ['fe80::1', '127.0.0.1'],
}
end

it { is_expected.to compile.with_all_deps }

Check failure on line 570 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

wireguard::interface on gentoo-2-x86_64 is expected to compile into a catalogue without dependency cycles Failure/Error: it { is_expected.to compile.with_all_deps } error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1210-752.u01o3k0fnecuzb3k2fx4wwelcf.cx.internal.cloudapp.net

Check failure on line 570 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

wireguard::interface on archlinux-rolling-x86_64 is expected to compile into a catalogue without dependency cycles Failure/Error: it { is_expected.to compile.with_all_deps } error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1210-752.u01o3k0fnecuzb3k2fx4wwelcf.cx.internal.cloudapp.net

Check failure on line 570 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

wireguard::interface on debian-11-x86_64 is expected to compile into a catalogue without dependency cycles Failure/Error: it { is_expected.to compile.with_all_deps } error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1118-740.jboa14ee0bjuvjv5ua334yvpdd.cx.internal.cloudapp.net

Check failure on line 570 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

wireguard::interface on archlinux-rolling-x86_64 is expected to compile into a catalogue without dependency cycles Failure/Error: it { is_expected.to compile.with_all_deps } error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1118-740.jboa14ee0bjuvjv5ua334yvpdd.cx.internal.cloudapp.net
it { is_expected.to contain_nftables__simplerule('allow_in_wg_as1234-0').without_sport.with_dport(1234) }

Check failure on line 571 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

wireguard::interface on gentoo-2-x86_64 is expected to contain Nftables::Simplerule[allow_in_wg_as1234-0] with dport => 1234 and sport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_in_wg_as1234-0').without_sport.with_dport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1210-752.u01o3k0fnecuzb3k2fx4wwelcf.cx.internal.cloudapp.net

Check failure on line 571 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

wireguard::interface on archlinux-rolling-x86_64 is expected to contain Nftables::Simplerule[allow_in_wg_as1234-0] with dport => 1234 and sport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_in_wg_as1234-0').without_sport.with_dport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1210-752.u01o3k0fnecuzb3k2fx4wwelcf.cx.internal.cloudapp.net

Check failure on line 571 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

wireguard::interface on debian-11-x86_64 is expected to contain Nftables::Simplerule[allow_in_wg_as1234-0] with dport => 1234 and sport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_in_wg_as1234-0').without_sport.with_dport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1118-740.jboa14ee0bjuvjv5ua334yvpdd.cx.internal.cloudapp.net

Check failure on line 571 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

wireguard::interface on archlinux-rolling-x86_64 is expected to contain Nftables::Simplerule[allow_in_wg_as1234-0] with dport => 1234 and sport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_in_wg_as1234-0').without_sport.with_dport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1118-740.jboa14ee0bjuvjv5ua334yvpdd.cx.internal.cloudapp.net
it { is_expected.to contain_nftables__simplerule('allow_in_wg_as1234-1').without_sport.with_dport(1234) }

Check failure on line 572 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

wireguard::interface on gentoo-2-x86_64 is expected to contain Nftables::Simplerule[allow_in_wg_as1234-1] with dport => 1234 and sport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_in_wg_as1234-1').without_sport.with_dport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1210-752.u01o3k0fnecuzb3k2fx4wwelcf.cx.internal.cloudapp.net

Check failure on line 572 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

wireguard::interface on archlinux-rolling-x86_64 is expected to contain Nftables::Simplerule[allow_in_wg_as1234-1] with dport => 1234 and sport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_in_wg_as1234-1').without_sport.with_dport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1210-752.u01o3k0fnecuzb3k2fx4wwelcf.cx.internal.cloudapp.net

Check failure on line 572 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

wireguard::interface on debian-11-x86_64 is expected to contain Nftables::Simplerule[allow_in_wg_as1234-1] with dport => 1234 and sport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_in_wg_as1234-1').without_sport.with_dport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1118-740.jboa14ee0bjuvjv5ua334yvpdd.cx.internal.cloudapp.net

Check failure on line 572 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

wireguard::interface on archlinux-rolling-x86_64 is expected to contain Nftables::Simplerule[allow_in_wg_as1234-1] with dport => 1234 and sport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_in_wg_as1234-1').without_sport.with_dport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1118-740.jboa14ee0bjuvjv5ua334yvpdd.cx.internal.cloudapp.net
it { is_expected.to contain_nftables__simplerule('allow_out_wg_as1234-0').without_dport.with_sport(1234) }

Check failure on line 573 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

wireguard::interface on gentoo-2-x86_64 is expected to contain Nftables::Simplerule[allow_out_wg_as1234-0] with sport => 1234 and dport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_out_wg_as1234-0').without_dport.with_sport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1210-752.u01o3k0fnecuzb3k2fx4wwelcf.cx.internal.cloudapp.net

Check failure on line 573 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

wireguard::interface on archlinux-rolling-x86_64 is expected to contain Nftables::Simplerule[allow_out_wg_as1234-0] with sport => 1234 and dport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_out_wg_as1234-0').without_dport.with_sport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1210-752.u01o3k0fnecuzb3k2fx4wwelcf.cx.internal.cloudapp.net

Check failure on line 573 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

wireguard::interface on debian-11-x86_64 is expected to contain Nftables::Simplerule[allow_out_wg_as1234-0] with sport => 1234 and dport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_out_wg_as1234-0').without_dport.with_sport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1118-740.jboa14ee0bjuvjv5ua334yvpdd.cx.internal.cloudapp.net

Check failure on line 573 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

wireguard::interface on archlinux-rolling-x86_64 is expected to contain Nftables::Simplerule[allow_out_wg_as1234-0] with sport => 1234 and dport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_out_wg_as1234-0').without_dport.with_sport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1118-740.jboa14ee0bjuvjv5ua334yvpdd.cx.internal.cloudapp.net
it { is_expected.to contain_nftables__simplerule('allow_out_wg_as1234-1').without_dport.with_sport(1234) }

Check failure on line 574 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

wireguard::interface on gentoo-2-x86_64 is expected to contain Nftables::Simplerule[allow_out_wg_as1234-1] with sport => 1234 and dport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_out_wg_as1234-1').without_dport.with_sport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1210-752.u01o3k0fnecuzb3k2fx4wwelcf.cx.internal.cloudapp.net

Check failure on line 574 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

wireguard::interface on archlinux-rolling-x86_64 is expected to contain Nftables::Simplerule[allow_out_wg_as1234-1] with sport => 1234 and dport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_out_wg_as1234-1').without_dport.with_sport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1210-752.u01o3k0fnecuzb3k2fx4wwelcf.cx.internal.cloudapp.net

Check failure on line 574 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

wireguard::interface on debian-11-x86_64 is expected to contain Nftables::Simplerule[allow_out_wg_as1234-1] with sport => 1234 and dport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_out_wg_as1234-1').without_dport.with_sport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1118-740.jboa14ee0bjuvjv5ua334yvpdd.cx.internal.cloudapp.net

Check failure on line 574 in spec/defines/interface_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

wireguard::interface on archlinux-rolling-x86_64 is expected to contain Nftables::Simplerule[allow_out_wg_as1234-1] with sport => 1234 and dport undefined Failure/Error: it { is_expected.to contain_nftables__simplerule('allow_out_wg_as1234-1').without_dport.with_sport(1234) } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Left match operand must result in a String value. Got an Undef Value. (file: /home/runner/work/puppet-wireguard/puppet-wireguard/spec/fixtures/modules/wireguard/manifests/interface.pp, line: 128, column: 8) (line: 5) on node fv-az1118-740.jboa14ee0bjuvjv5ua334yvpdd.cx.internal.cloudapp.net
end
end
end
end