Saltstack Official Apt Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.5KB

  1. control 'Apt preferences' do
  2. title 'should be configured'
  3. describe file('/etc/apt/preferences') do
  4. it { should exist }
  5. its(:size) { should eq 0 }
  6. end
  7. describe file('/etc/apt/preferences.d') do
  8. it { should be_directory }
  9. it { should be_owned_by 'root' }
  10. it { should be_grouped_into 'root' }
  11. its('mode') { should cmp '0755' }
  12. end
  13. describe file('/etc/apt/preferences.d/00-rspamd') do
  14. it { should exist }
  15. it { should be_owned_by 'root' }
  16. it { should be_grouped_into 'root' }
  17. its('mode') { should cmp '0644' }
  18. its(:content) { should match("Package: rspamd\nPin: origin rspamd.com\nPin-Priority: 650\n") }
  19. end
  20. describe file('/etc/apt/preferences.d/01-all') do
  21. it { should exist }
  22. it { should be_owned_by 'root' }
  23. it { should be_grouped_into 'root' }
  24. its('mode') { should cmp '0644' }
  25. its(:content) { should match("Package: *\nPin: release stable\nPin-Priority: 610\n") }
  26. end
  27. describe file('/etc/apt/preferences.d/02-all') do
  28. it { should exist }
  29. it { should be_owned_by 'root' }
  30. it { should be_grouped_into 'root' }
  31. its('mode') { should cmp '0644' }
  32. its(:content) { should match("Package: *\nPin: release testing\nPin-Priority: 600\n") }
  33. end
  34. describe file('/etc/apt/preferences.d/03-all') do
  35. it { should exist }
  36. it { should be_owned_by 'root' }
  37. it { should be_grouped_into 'root' }
  38. its('mode') { should cmp '0644' }
  39. its(:content) { should match("Package: *\nPin: release unstable\nPin-Priority: 50\n") }
  40. end
  41. end