From c9bbbbc7795207361c2237aabedb97fe51390708 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 25 Feb 2022 14:33:12 +0100 Subject: [PATCH] rubocop: safe autocorrect --- spec/acceptance/keepalived_spec.rb | 5 ++ spec/classes/keepalived_spec.rb | 19 ++--- .../keepalived_lvs_real_server_spec.rb | 1 - .../keepalived_lvs_virtual_server_spec.rb | 19 ++--- spec/defines/keepalived_vrrp_instance_spec.rb | 75 ++++++++++++++++++- spec/defines/keepalived_vrrp_script_spec.rb | 9 +++ .../keepalived_vrrp_sync_group_spec.rb | 10 +++ .../keepalived_vrrp_track_process_spec.rb | 12 ++- spec/unit/facter/keepalived_version_spec.rb | 8 +- 9 files changed, 130 insertions(+), 28 deletions(-) diff --git a/spec/acceptance/keepalived_spec.rb b/spec/acceptance/keepalived_spec.rb index 558e66b780..ee5209a7ff 100644 --- a/spec/acceptance/keepalived_spec.rb +++ b/spec/acceptance/keepalived_spec.rb @@ -15,6 +15,7 @@ class { 'keepalived': it 'works with no error' do apply_manifest(pp, catch_failures: true) end + it 'works idempotently' do pp2 = <<-EOS class { 'keepalived': @@ -23,6 +24,7 @@ class { 'keepalived': EOS apply_manifest(pp2, catch_changes: true) end + it 'creates fact keepalived_version' do service_fact = apply_manifest(pp, catch_failures: true) expect(service_fact.output).to match %r{.*Keepalived version was: (\d.\d.\d).*} @@ -58,6 +60,7 @@ class { 'keepalived': it 'works with no error' do apply_manifest(pp, catch_failures: true) end + it 'works idempotently' do apply_manifest(pp, catch_changes: true) end @@ -92,6 +95,7 @@ class { 'keepalived::global_defs': it 'works with no error' do apply_manifest(pp, catch_failures: true) end + it 'works idempotently' do apply_manifest(pp, catch_changes: true) end @@ -121,6 +125,7 @@ class { 'keepalived': it 'works with no error' do apply_manifest(pp, catch_failures: true) end + it 'works idempotently' do apply_manifest(pp, catch_changes: true) end diff --git a/spec/classes/keepalived_spec.rb b/spec/classes/keepalived_spec.rb index 0e59c3ba1a..d8589da6a3 100644 --- a/spec/classes/keepalived_spec.rb +++ b/spec/classes/keepalived_spec.rb @@ -21,28 +21,29 @@ it { is_expected.to contain_concat('/etc/keepalived/keepalived.conf').with( - 'group' => 'root', - 'mode' => '0644', - 'owner' => 'root' + 'group' => 'root', + 'mode' => '0644', + 'owner' => 'root' ) } + case facts[:osfamily] when 'Debian' it { is_expected.to contain_service('keepalived').with( - 'ensure' => 'running', - 'enable' => 'true', + 'ensure' => 'running', + 'enable' => 'true', 'hasrestart' => 'false', - 'hasstatus' => 'false' + 'hasstatus' => 'false' ) } else it { is_expected.to contain_service('keepalived').with( - 'ensure' => 'running', - 'enable' => 'true', + 'ensure' => 'running', + 'enable' => 'true', 'hasrestart' => 'true', - 'hasstatus' => 'true' + 'hasstatus' => 'true' ) } end diff --git a/spec/defines/keepalived_lvs_real_server_spec.rb b/spec/defines/keepalived_lvs_real_server_spec.rb index b5239557d6..063380ed2d 100644 --- a/spec/defines/keepalived_lvs_real_server_spec.rb +++ b/spec/defines/keepalived_lvs_real_server_spec.rb @@ -1,4 +1,3 @@ - require 'spec_helper' describe 'keepalived::lvs::real_server', type: 'define' do diff --git a/spec/defines/keepalived_lvs_virtual_server_spec.rb b/spec/defines/keepalived_lvs_virtual_server_spec.rb index 1db40a863d..c22280fc67 100644 --- a/spec/defines/keepalived_lvs_virtual_server_spec.rb +++ b/spec/defines/keepalived_lvs_virtual_server_spec.rb @@ -1,4 +1,3 @@ - require 'spec_helper' describe 'keepalived::lvs::virtual_server', type: 'define' do @@ -86,11 +85,13 @@ %r{\s+delay_loop 60\s+lb_algo lc\s+lb_kind NAT\s+persistence_timeout 5\s+ha_suspend\s+virtualhost example.com} ) } + it { is_expected.to contain_concat__fragment('keepalived.conf_lvs_virtual_server__TITLE_').with_content( - %r{\s+alpha\s+omega\s+quorum 5\s+quorum_up "\/bin\/true"\s+quorum_down "\/bin\/true"} + %r{\s+alpha\s+omega\s+quorum 5\s+quorum_up "/bin/true"\s+quorum_down "/bin/true"} ) } + it { is_expected.to contain_concat__fragment('keepalived.conf_lvs_virtual_server__TITLE_').with_content( %r{\s+hysteresis 9\s+protocol UDP\s+sorry_server 10.1.1.3 999\s+} @@ -198,7 +199,7 @@ port: 8080, lb_algo: 'lc', real_servers: [{ 'ip_address' => '10.1.1.2', - 'port' => 8081 }] + 'port' => 8081 }] } end @@ -217,7 +218,7 @@ lb_algo: 'lc', tcp_check: { 'connect_timeout' => 5 }, real_servers: [{ 'ip_address' => '10.1.1.2', - 'port' => 8081 }] + 'port' => 8081 }] } end @@ -236,7 +237,7 @@ lb_algo: 'lc', tcp_check: { 'connect_timeout' => 5 }, real_servers: [{ 'ip_address' => '10.1.1.2', - 'port' => 8081 }], + 'port' => 8081 }], real_server_options: { 'MISC_CHECK' => { 'misc_path' => 'somepath' @@ -260,10 +261,10 @@ lb_algo: 'lc', tcp_check: { 'connect_timeout' => 5 }, real_servers: [{ 'ip_address' => '10.1.1.2', - 'port' => 8081 }], + 'port' => 8081 }], real_server_options: { 'TCP_CHECK' => { - 'connect_port' => 42, + 'connect_port' => 42, 'connect_timeout' => 10 } } @@ -302,9 +303,9 @@ port: 8080, lb_algo: 'lc', real_servers: [{ 'ip_address' => '10.1.1.2', - 'port' => 8081 }, + 'port' => 8081 }, { 'ip_address' => '10.1.1.3', - 'port' => 8082 }] + 'port' => 8082 }] } end diff --git a/spec/defines/keepalived_vrrp_instance_spec.rb b/spec/defines/keepalived_vrrp_instance_spec.rb index 2fa4c3083b..8ce11c1100 100644 --- a/spec/defines/keepalived_vrrp_instance_spec.rb +++ b/spec/defines/keepalived_vrrp_instance_spec.rb @@ -35,6 +35,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -53,6 +54,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -83,6 +85,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -99,6 +102,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -116,6 +120,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -132,6 +137,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -148,6 +154,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -164,6 +171,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -180,6 +188,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -196,6 +205,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -212,6 +222,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -228,6 +239,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -244,6 +256,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -260,6 +273,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -278,6 +292,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -308,6 +323,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -325,6 +341,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -342,6 +359,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -358,6 +376,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -374,6 +393,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -390,6 +410,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -406,6 +427,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -422,6 +444,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -439,6 +462,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -456,6 +480,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -474,6 +499,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -496,6 +522,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -523,6 +550,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -530,6 +558,7 @@ ) } end + describe 'with virtual_ipaddress as hash containing device and array of ips' do let(:params) do mandatory_params.merge( @@ -540,6 +569,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -562,6 +592,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -580,6 +611,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -598,6 +630,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -615,6 +648,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -632,6 +666,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -649,6 +684,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -671,6 +707,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -694,6 +731,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -701,6 +739,7 @@ ) } end + describe 'with virtual_ipaddress_excluded as hash containing device and array of ips' do let(:params) do mandatory_params.merge( @@ -711,6 +750,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -733,6 +773,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -751,6 +792,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -769,6 +811,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -786,6 +829,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -803,6 +847,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -824,6 +869,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -847,6 +893,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -865,6 +912,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -878,12 +926,13 @@ mandatory_params.merge( virtual_ipaddress_int: '_VALUE_', virtual_routes: [{ 'to' => '10.0.1.0/24', - 'via' => '192.168.0.1', + 'via' => '192.168.0.1', 'scope' => '_SCOPE_' }] ) end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -897,12 +946,13 @@ mandatory_params.merge( virtual_ipaddress_int: '_VALUE_', virtual_routes: [{ 'to' => '10.0.1.0/24', - 'via' => '192.168.0.1', + 'via' => '192.168.0.1', 'table' => '_TABLE_' }] ) end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -919,6 +969,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -935,6 +986,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -947,6 +999,7 @@ let(:params) { mandatory_params } it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.not_to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME__upeers_header') @@ -963,6 +1016,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME__upeers_header').with( @@ -1001,6 +1055,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME__upeers_header').with( @@ -1032,6 +1087,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME__upeers_header').with( @@ -1076,6 +1132,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME__upeers_header').with( @@ -1101,6 +1158,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -1118,6 +1176,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -1139,6 +1198,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -1162,6 +1222,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -1192,6 +1253,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -1221,6 +1283,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -1261,6 +1324,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -1278,6 +1342,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -1285,6 +1350,7 @@ ) } end + describe 'with native_ipv6' do let(:params) do mandatory_params.merge( @@ -1293,6 +1359,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -1300,6 +1367,7 @@ ) } end + describe 'with garp_lower_prio_repeat' do let(:params) do mandatory_params.merge( @@ -1308,6 +1376,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( @@ -1315,6 +1384,7 @@ ) } end + describe 'with higher_prio_send_advert' do let(:params) do mandatory_params.merge( @@ -1323,6 +1393,7 @@ end it { is_expected.to create_keepalived__vrrp__instance('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_instance__NAME_').with( diff --git a/spec/defines/keepalived_vrrp_script_spec.rb b/spec/defines/keepalived_vrrp_script_spec.rb index 8331ef1f3d..03c6fdd15a 100644 --- a/spec/defines/keepalived_vrrp_script_spec.rb +++ b/spec/defines/keepalived_vrrp_script_spec.rb @@ -27,6 +27,7 @@ end it { is_expected.to create_keepalived__vrrp__script('_TITLE_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_script__TITLE_').with( @@ -43,6 +44,7 @@ end it { is_expected.to create_keepalived__vrrp__script('_TITLE_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_script__TITLE_').with( @@ -60,6 +62,7 @@ end it { is_expected.to create_keepalived__vrrp__script('_TITLE_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_script__TITLE_').with( @@ -77,6 +80,7 @@ end it { is_expected.to create_keepalived__vrrp__script('_TITLE_') } + it { is_expected.not_to \ contain_concat__fragment('keepalived.conf_vrrp_script__TITLE_').with( @@ -94,6 +98,7 @@ end it { is_expected.to create_keepalived__vrrp__script('_TITLE_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_script__TITLE_').with( @@ -111,6 +116,7 @@ end it { is_expected.to create_keepalived__vrrp__script('_TITLE_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_script__TITLE_').with( @@ -128,6 +134,7 @@ end it { is_expected.to create_keepalived__vrrp__script('_TITLE_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_script__TITLE_').with( @@ -145,6 +152,7 @@ end it { is_expected.to create_keepalived__vrrp__script('_TITLE_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_script__TITLE_').with( @@ -163,6 +171,7 @@ end it { is_expected.to create_keepalived__vrrp__script('_TITLE_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_script__TITLE_').with( diff --git a/spec/defines/keepalived_vrrp_sync_group_spec.rb b/spec/defines/keepalived_vrrp_sync_group_spec.rb index 0c85bd0e4b..faf451527f 100644 --- a/spec/defines/keepalived_vrrp_sync_group_spec.rb +++ b/spec/defines/keepalived_vrrp_sync_group_spec.rb @@ -26,6 +26,7 @@ end it { is_expected.to create_keepalived__vrrp__sync_group('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_sync_group__NAME_').with( @@ -42,6 +43,7 @@ end it { is_expected.to create_keepalived__vrrp__sync_group('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_sync_group__NAME_').with( @@ -59,6 +61,7 @@ end it { is_expected.to create_keepalived__vrrp__sync_group('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_sync_group__NAME_').with( @@ -76,6 +79,7 @@ end it { is_expected.to create_keepalived__vrrp__sync_group('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_sync_group__NAME_').with( @@ -93,6 +97,7 @@ end it { is_expected.to create_keepalived__vrrp__sync_group('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_sync_group__NAME_').with( @@ -110,6 +115,7 @@ end it { is_expected.to create_keepalived__vrrp__sync_group('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_sync_group__NAME_').with( @@ -127,6 +133,7 @@ end it { is_expected.to create_keepalived__vrrp__sync_group('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_sync_group__NAME_').with( @@ -144,6 +151,7 @@ end it { is_expected.to create_keepalived__vrrp__sync_group('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_sync_group__NAME_').with( @@ -161,6 +169,7 @@ end it { is_expected.to create_keepalived__vrrp__sync_group('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_sync_group__NAME_').with( @@ -178,6 +187,7 @@ end it { is_expected.to create_keepalived__vrrp__sync_group('_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_sync_group__NAME_').with( diff --git a/spec/defines/keepalived_vrrp_track_process_spec.rb b/spec/defines/keepalived_vrrp_track_process_spec.rb index 1bb37a8a35..b409907977 100644 --- a/spec/defines/keepalived_vrrp_track_process_spec.rb +++ b/spec/defines/keepalived_vrrp_track_process_spec.rb @@ -26,6 +26,7 @@ end it { is_expected.to create_keepalived__vrrp__track_process('_PROC_NAME_') } + it do is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_track_process__PROC_NAME_').with( @@ -43,6 +44,7 @@ end it { is_expected.to create_keepalived__vrrp__track_process('_PROC_NAME_') } + it do is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_track_process__PROC_NAME_').with( @@ -54,12 +56,13 @@ describe 'with parameter quorum' do let(:params) do { - quorum: 203, + quorum: 203, proc_name: '_PROC_NAME_' } end it { is_expected.to create_keepalived__vrrp__track_process('_PROC_NAME_') } + it do is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_track_process__PROC_NAME_').with( @@ -71,12 +74,13 @@ describe 'with parameter delay' do let(:params) do { - delay: 1200, + delay: 1200, proc_name: '_PROC_NAME_' } end it { is_expected.to create_keepalived__vrrp__track_process('_PROC_NAME_') } + it { is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_track_process__PROC_NAME_').with( @@ -94,6 +98,7 @@ end it { is_expected.to create_keepalived__vrrp__track_process('_PROC_NAME_') } + it do is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_track_process__PROC_NAME_').with( @@ -106,11 +111,12 @@ let(:params) do { full_command: true, - proc_name: '_PROC_NAME_' + proc_name: '_PROC_NAME_' } end it { is_expected.to create_keepalived__vrrp__track_process('_PROC_NAME_') } + it do is_expected.to \ contain_concat__fragment('keepalived.conf_vrrp_track_process__PROC_NAME_').with( diff --git a/spec/unit/facter/keepalived_version_spec.rb b/spec/unit/facter/keepalived_version_spec.rb index 8e858672f3..9e98f912fb 100644 --- a/spec/unit/facter/keepalived_version_spec.rb +++ b/spec/unit/facter/keepalived_version_spec.rb @@ -8,8 +8,8 @@ describe 'keepalived_version' do context 'returns keepalived version when keepalived present' do it do - keepalived_version_output = <<-EOS -Keepalived v1.2.2 (10/03,2013) + keepalived_version_output = <<~EOS + Keepalived v1.2.2 (10/03,2013) EOS allow(Facter::Util::Resolution).to receive(:which).with('keepalived'). and_return(true) @@ -21,8 +21,8 @@ context 'returns keepalived version when keepalived present and last number more than one digit' do it do - keepalived_version_output = <<-EOS -Keepalived v1.2.13 (08/07,2014) + keepalived_version_output = <<~EOS + Keepalived v1.2.13 (08/07,2014) EOS allow(Facter::Util::Resolution).to receive(:which).with('keepalived'). and_return(true)