From 4d4327235aee4786282c33818d508822089ab066 Mon Sep 17 00:00:00 2001 From: Christian Saller Date: Thu, 25 Jul 2024 15:17:29 +0200 Subject: [PATCH] Add spec test for extra network sections --- spec/defines/interface_spec.rb | 3 ++- spec/fixtures/test_files/peers_routes.network | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/defines/interface_spec.rb b/spec/defines/interface_spec.rb index 14c7048..dba3b17 100644 --- a/spec/defines/interface_spec.rb +++ b/spec/defines/interface_spec.rb @@ -255,7 +255,7 @@ it { is_expected.not_to compile.with_all_deps } end - context 'with required params (peers), routes and without firewall rules' do + context 'with required params (peers), routes, extra network sections and without firewall rules' do let :params do { peers: [ @@ -276,6 +276,7 @@ destination_addresses: [facts[:networking]['ip'],], addresses: [{ 'Address' => '192.0.2.1/24' }], routes: [{ 'Gateway' => '192.0.2.2', 'GatewayOnLink' => true, 'Destination' => '192.0.3.0/24' }], + extra_networkd_sections: [{ 'RoutingPolicyRule' => [{ 'From' => '10.0.0.0/24', 'Table' => '1010', 'IncomingInterface' => 'as1234' }]}], } end diff --git a/spec/fixtures/test_files/peers_routes.network b/spec/fixtures/test_files/peers_routes.network index 10b410b..21a9064 100644 --- a/spec/fixtures/test_files/peers_routes.network +++ b/spec/fixtures/test_files/peers_routes.network @@ -20,3 +20,8 @@ Gateway=192.0.2.2 GatewayOnLink=true Destination=192.0.3.0/24 +[RoutingPolicyRule] +From=10.0.0.0/24 +Table=1010 +IncomingInterface=as1234 +