Skip to content

Commit

Permalink
rolled back regex %r{nodelist} to be less strict
Browse files Browse the repository at this point in the history
Removed typing error "$"char
  • Loading branch information
Doninelli Davide authored and Doninelli Davide committed Oct 14, 2024
1 parent 23b2109 commit 702cfad
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions spec/classes/corosync_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@

it 'configures votequorum' do
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{nodelist\s*\{}
%r{nodelist}
)
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{^\s*ring0_addr:\s*node1\.test\.org\s*(?:\r\n|\n)\s*nodeid:\s*1\s*$}
%r{^\s*ring0_addr:\s*node1\.test\.org\s*(?:\r\n|\n)\s*nodeid:\s*1\s*}
)
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{^\s*ring0_addr:\s*node2\.test\.org\s*(?:\r\n|\n)\s*nodeid:\s*2\s*$}
%r{^\s*ring0_addr:\s*node2\.test\.org\s*(?:\r\n|\n)\s*nodeid:\s*2\s*}
)
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{^\s*two_node:\s*1}
Expand All @@ -77,7 +77,7 @@

it 'supports persistent node IDs' do
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{nodelist\s*\{}
%r{nodelist}
)
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{^\s*ring0_addr:\s*node1\.test\.org\s*(?:\r\n|\n)\s*nodeid:\s*3}
Expand All @@ -98,7 +98,7 @@

it 'supports persistent node names' do
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{nodelist\s*\{}
%r{nodelist}
)
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{^\s*ring0_addr:\s*192\.168\.0\.1(?:\r\n|\n)\s*nodeid:\s*1(?:\r\n|\n)\s*name:\s*node1\.test\.org}
Expand Down Expand Up @@ -149,7 +149,7 @@

it 'configures nodelist' do
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{nodelist\s*\{}
%r{nodelist}
)
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{^\s*ring0_addr:\s*node1\.test\.org(?:\r\n|\n)\s*nodeid:\s*1}
Expand Down Expand Up @@ -234,7 +234,7 @@

it 'configures votequorum' do
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{nodelist\s*\{}
%r{nodelist}
)
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{^\s*ring0_addr: node1\.test\.org(?:\r\n|\n)\s*nodeid:\s*1}
Expand All @@ -250,7 +250,7 @@
it 'supports persistent node IDs' do
params[:quorum_members_ids] = [3, 11]
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{nodelist\s*\{}
%r{nodelist}
)
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{^\s*ring0_addr:\s*node1\.test\.org(?:\r\n|\n)\s*nodeid:\s*3}
Expand All @@ -264,7 +264,7 @@
params[:quorum_members] = ['192.168.0.1', '192.168.0.2']
params[:quorum_members_names] = ['node1.test.org', 'node2.test.org']
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{nodelist\s*\{}
%r{nodelist}
)
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{^\s*ring0_addr: 192\.168\.0\.1(?:\r\n|\n)\s*nodeid:\s*1(?:\r\n|\n)\s*name:\s*node1\.test\.org}
Expand Down Expand Up @@ -593,7 +593,7 @@

it 'does not contain nodelist' do
is_expected.not_to contain_file('/etc/corosync/corosync.conf').with_content(
%r{nodelist\s*\{}
%r{nodelist}
)
end
end
Expand All @@ -608,7 +608,7 @@

it 'does not contain nodelist' do
is_expected.not_to contain_file('/etc/corosync/corosync.conf').with_content(
%r{nodelist\s*\{}
%r{nodelist}
)
end
end
Expand Down Expand Up @@ -955,7 +955,7 @@

it 'does not contain the quorum device config in corosync.conf' do
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{quorum\s*\{\s*provider:\s*corosync_votequorum\s*\}\s*$}
%r{quorum\s*\{\s*provider:\s*corosync_votequorum\s*\}\s*}
)
end

Expand Down

0 comments on commit 702cfad

Please sign in to comment.