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.

49 lines
1.5KB

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