Skip to content

Commit

Permalink
Merge pull request #161 from raoulbhatia/fix-spec-for-file-permissions
Browse files Browse the repository at this point in the history
Spec: Follow puppetlabs-apt "MODULES-10548: make files readonly"
  • Loading branch information
ekohl authored Mar 1, 2020
2 parents af3024e + 086e0e5 commit 3a79efd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions spec/classes/debian_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
is_expected.to create_file(file_periodic).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
/APT::Periodic::Enable "1";/
).with_content(
Expand Down Expand Up @@ -52,7 +52,7 @@
is_expected.to create_file(file_options).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
/^Dpkg::Options\s{/
).with_content(
Expand Down Expand Up @@ -84,7 +84,7 @@
is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
# This section varies for different releases
/\Unattended-Upgrade::Allowed-Origins\ {\n
Expand All @@ -100,7 +100,7 @@
is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
# This section varies for different releases
/\Unattended-Upgrade::Allowed-Origins\ {\n
Expand All @@ -116,7 +116,7 @@
is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
# This section varies for different releases
/\Unattended-Upgrade::Origins-Pattern\ {\n
Expand All @@ -131,7 +131,7 @@
is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
# This section varies for different releases
/\Unattended-Upgrade::Origins-Pattern\ {\n
Expand All @@ -146,7 +146,7 @@
is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
# This section varies for different releases
/\Unattended-Upgrade::Origins-Pattern\ {\n
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/other_debians_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
)
end
end
Expand All @@ -52,7 +52,7 @@
is_expected.to create_file(file_unattended).with(
'owner' => 'root',
'group' => 'root',
'mode' => '0644'
'mode' => '0444'
).with_content(
# This is the only section that's different for Ubuntu compared to Debian
%r{\Unattended-Upgrade::Allowed-Origins\ {\n
Expand Down Expand Up @@ -84,7 +84,7 @@
is_expected.to create_file(file_unattended).with(
'owner' => 'root',
'group' => 'root',
'mode' => '0644'
'mode' => '0444'
).with_content(
# This is the only section that's different for Ubuntu compared to Debian
%r{\Unattended-Upgrade::Allowed-Origins\ {\n
Expand Down Expand Up @@ -116,7 +116,7 @@
is_expected.to create_file(file_unattended).with(
'owner' => 'root',
'group' => 'root',
'mode' => '0644'
'mode' => '0444'
).with_content(
# This is the only section that's different for Ubuntu compared to Debian
%r{\Unattended-Upgrade::Allowed-Origins\ {\n
Expand Down
10 changes: 5 additions & 5 deletions spec/classes/ubuntu_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
is_expected.to create_file(file_periodic).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
/APT::Periodic::Enable "1";/
).with_content(
Expand Down Expand Up @@ -52,7 +52,7 @@
is_expected.to create_file(file_options).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
/^Dpkg::Options\s{/
).with_content(
Expand Down Expand Up @@ -84,7 +84,7 @@
is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
# This is the only section that's different for Ubuntu compared to Debian
/\Unattended-Upgrade::Allowed-Origins\ {\n
Expand All @@ -99,7 +99,7 @@
is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
# This is the only section that's different for Ubuntu compared to Debian
/\Unattended-Upgrade::Allowed-Origins\ {\n
Expand All @@ -114,7 +114,7 @@
is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
# This is the only section that's different for Ubuntu compared to Debian
/\Unattended-Upgrade::Allowed-Origins\ {\n
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/unattended_upgrades_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
is_expected.to create_file(file_unattended).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
/Unattended-Upgrade::Allowed-Origins {\n\t"bananas";\n};/
).with_content(
Expand Down Expand Up @@ -147,7 +147,7 @@
is_expected.to create_file(file_periodic).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
/APT::Periodic::Enable "1";/
).with_content(
Expand Down Expand Up @@ -181,7 +181,7 @@
is_expected.to create_file(file_options).with(
owner: 'root',
group: 'root',
mode: '0644'
mode: '0444'
).with_content(
/^Dpkg::Options\s{/
).without_content(
Expand Down

0 comments on commit 3a79efd

Please sign in to comment.